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
dbb92f98
Commit
dbb92f98
authored
Jan 19, 2017
by
Ryan Hallisey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ensure-temp-dir in the common.sh script
Instead of having an ensure-temp-dir function in multiple places, add it to the common.sh script which is sourced by all the providers.
parent
5e4625ca
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
57 deletions
+11
-57
util.sh
cluster/aws/util.sh
+0
-12
util.sh
cluster/azure-legacy/util.sh
+0
-11
common.sh
cluster/common.sh
+11
-0
util.sh
cluster/gce/util.sh
+0
-11
util.sh
cluster/photon-controller/util.sh
+0
-12
util.sh
cluster/vagrant/util.sh
+0
-11
No files found.
cluster/aws/util.sh
View file @
dbb92f98
...
...
@@ -570,18 +570,6 @@ function verify-prereqs {
fi
}
# Create a temp dir that'll be deleted at the end of this bash session.
#
# Vars set:
# KUBE_TEMP
function
ensure-temp-dir
{
if
[[
-z
${
KUBE_TEMP
-
}
]]
;
then
KUBE_TEMP
=
$(
mktemp
-d
-t
kubernetes.XXXXXX
)
trap
'rm -rf "${KUBE_TEMP}"'
EXIT
fi
}
# Take the local tar files and upload them to S3. They will then be
# downloaded by the master as part of the start up script for the master.
#
...
...
cluster/azure-legacy/util.sh
View file @
dbb92f98
...
...
@@ -100,17 +100,6 @@ function verify-prereqs {
echo
"==> CONTAINER:
$CONTAINER
"
}
# Create a temp dir that'll be deleted at the end of this bash session.
#
# Vars set:
# KUBE_TEMP
function
ensure-temp-dir
{
if
[[
-z
${
KUBE_TEMP
-
}
]]
;
then
KUBE_TEMP
=
$(
mktemp
-d
-t
kubernetes.XXXXXX
)
trap
'rm -rf "${KUBE_TEMP}"'
EXIT
fi
}
# Take the local tar files and upload them to Azure Storage. They will then be
# downloaded by the master as part of the start up script for the master.
#
...
...
cluster/common.sh
View file @
dbb92f98
...
...
@@ -308,6 +308,17 @@ function load-or-gen-kube-bearertoken() {
fi
}
# Create a temp dir that'll be deleted at the end of this bash session.
#
# Vars set:
# KUBE_TEMP
function
ensure-temp-dir
{
if
[[
-z
${
KUBE_TEMP
-
}
]]
;
then
KUBE_TEMP
=
$(
mktemp
-d
-t
kubernetes.XXXXXX
)
trap
'rm -rf "${KUBE_TEMP}"'
EXIT
fi
}
# Get the master IP for the current-context in kubeconfig if one exists.
#
# Assumed vars:
...
...
cluster/gce/util.sh
View file @
dbb92f98
...
...
@@ -116,17 +116,6 @@ function verify-prereqs() {
update-or-verify-gcloud
}
# Create a temp dir that'll be deleted at the end of this bash session.
#
# Vars set:
# KUBE_TEMP
function
ensure-temp-dir
()
{
if
[[
-z
${
KUBE_TEMP
-
}
]]
;
then
KUBE_TEMP
=
$(
mktemp
-d
-t
kubernetes.XXXXXX
)
trap
'rm -rf "${KUBE_TEMP}"'
EXIT
fi
}
# Use the gcloud defaults to find the project. If it is already set in the
# environment then go with that.
#
...
...
cluster/photon-controller/util.sh
View file @
dbb92f98
...
...
@@ -1031,18 +1031,6 @@ function verify-cmd-in-path {
}
#
# Checks that KUBE_TEMP is set, or sets it
# If it sets it, it also creates the temporary directory
# and sets up a trap so that we delete it when we exit
#
function
ensure-temp-dir
{
if
[[
-z
${
KUBE_TEMP
-
}
]]
;
then
KUBE_TEMP
=
$(
mktemp
-d
-t
kubernetes.XXXXXX
)
trap-add
"rm -rf '
${
KUBE_TEMP
}
'"
EXIT
fi
}
#
# Repeatedly try a command over ssh until it succeeds or until five minutes have passed
# The timeout isn't exact, since we assume the command runs instantaneously, and
# it doesn't.
...
...
cluster/vagrant/util.sh
View file @
dbb92f98
...
...
@@ -104,17 +104,6 @@ function verify-prereqs {
export
USING_KUBE_SCRIPTS
=
true
}
# Create a temp dir that'll be deleted at the end of this bash session.
#
# Vars set:
# KUBE_TEMP
function
ensure-temp-dir
{
if
[[
-z
${
KUBE_TEMP
-
}
]]
;
then
export
KUBE_TEMP
=
$(
mktemp
-d
-t
kubernetes.XXXXXX
)
trap
'rm -rf "${KUBE_TEMP}"'
EXIT
fi
}
# Create a set of provision scripts for the master and each of the nodes
function
create-provision-scripts
{
ensure-temp-dir
...
...
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