Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
eb1ea269
Commit
eb1ea269
authored
Apr 17, 2015
by
Robert Bailey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7012 from jlowdermilk/export-kubeconfig
export KUBECONFIG so callers of common.sh functions can use it
parents
f2f40b06
1c265f37
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
common.sh
cluster/common.sh
+3
-3
util.sh
cluster/gce/util.sh
+0
-1
No files found.
cluster/common.sh
View file @
eb1ea269
...
@@ -38,7 +38,7 @@ DEFAULT_KUBECONFIG="${HOME}/.kube/config"
...
@@ -38,7 +38,7 @@ DEFAULT_KUBECONFIG="${HOME}/.kube/config"
function
create-kubeconfig
()
{
function
create-kubeconfig
()
{
local
kubectl
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
local
kubectl
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
KUBECONFIG
=
${
KUBECONFIG
:-
$DEFAULT_KUBECONFIG
}
export
KUBECONFIG
=
${
KUBECONFIG
:-
$DEFAULT_KUBECONFIG
}
# KUBECONFIG determines the file we write to, but it may not exist yet
# KUBECONFIG determines the file we write to, but it may not exist yet
if
[[
!
-e
"
${
KUBECONFIG
}
"
]]
;
then
if
[[
!
-e
"
${
KUBECONFIG
}
"
]]
;
then
mkdir
-p
$(
dirname
"
${
KUBECONFIG
}
"
)
mkdir
-p
$(
dirname
"
${
KUBECONFIG
}
"
)
...
@@ -63,7 +63,7 @@ function create-kubeconfig() {
...
@@ -63,7 +63,7 @@ function create-kubeconfig() {
# KUBECONFIG
# KUBECONFIG
# CONTEXT
# CONTEXT
function
clear-kubeconfig
()
{
function
clear-kubeconfig
()
{
KUBECONFIG
=
${
KUBECONFIG
:-
$DEFAULT_KUBECONFIG
}
export
KUBECONFIG
=
${
KUBECONFIG
:-
$DEFAULT_KUBECONFIG
}
local
kubectl
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
local
kubectl
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
"
${
kubectl
}
"
config
unset
"clusters.
${
CONTEXT
}
"
"
${
kubectl
}
"
config
unset
"clusters.
${
CONTEXT
}
"
"
${
kubectl
}
"
config
unset
"users.
${
CONTEXT
}
"
"
${
kubectl
}
"
config
unset
"users.
${
CONTEXT
}
"
...
@@ -89,7 +89,7 @@ function clear-kubeconfig() {
...
@@ -89,7 +89,7 @@ function clear-kubeconfig() {
# KUBE_USER,KUBE_PASSWORD will be empty if no current-context is set, or
# KUBE_USER,KUBE_PASSWORD will be empty if no current-context is set, or
# the current-context user does not exist or contain basicauth entries.
# the current-context user does not exist or contain basicauth entries.
function
get-kubeconfig-basicauth
()
{
function
get-kubeconfig-basicauth
()
{
KUBECONFIG
=
${
KUBECONFIG
:-
$DEFAULT_KUBECONFIG
}
export
KUBECONFIG
=
${
KUBECONFIG
:-
$DEFAULT_KUBECONFIG
}
# Templates to safely extract the username,password for the current-context
# Templates to safely extract the username,password for the current-context
# user. The long chain of 'with' commands avoids indexing nil if any of the
# user. The long chain of 'with' commands avoids indexing nil if any of the
# entries ("current-context", "contexts"."current-context", "users", etc)
# entries ("current-context", "contexts"."current-context", "users", etc)
...
...
cluster/gce/util.sh
View file @
eb1ea269
...
@@ -837,7 +837,6 @@ function kube-down {
...
@@ -837,7 +837,6 @@ function kube-down {
--quiet
\
--quiet
\
"
${
MASTER_NAME
}
-ip"
||
true
"
${
MASTER_NAME
}
-ip"
||
true
export
KUBECONFIG
=
"
${
HOME
}
/.kube/.kubeconfig"
export
CONTEXT
=
"
${
PROJECT
}
_
${
INSTANCE_PREFIX
}
"
export
CONTEXT
=
"
${
PROJECT
}
_
${
INSTANCE_PREFIX
}
"
clear-kubeconfig
clear-kubeconfig
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment