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
4a46c948
Commit
4a46c948
authored
Jun 15, 2016
by
Aditya Kali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make GCI image detection robust
parent
926ff6e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
util.sh
cluster/gce/util.sh
+21
-5
No files found.
cluster/gce/util.sh
View file @
4a46c948
...
...
@@ -30,13 +30,29 @@ else
exit
1
fi
function
get_latest_gci_image
()
{
# GCI milestone to use
GCI_MILESTONE
=
"53"
# First try to find an active (non-deprecated) image on this milestone.
gci_images
=(
$(
gcloud compute images list
--project
google-containers
\
--no-standard-images
--sort-by
=
"~creationTimestamp"
\
--regexp
=
"gci-[a-z]+-
${
GCI_MILESTONE
}
-.*"
--format
=
"table[no-heading](name)"
)
)
# If no active image is available, search across all deprecated images.
if
[[
${#
gci_images
[@]
}
==
0
]]
;
then
gci_images
=(
$(
gcloud compute images list
--project
google-containers
\
--no-standard-images
--show-deprecated
--sort-by
=
"~creationTimestamp"
\
--regexp
=
"gci-[a-z]+-
${
GCI_MILESTONE
}
-.*"
--format
=
"table[no-heading](name)"
)
)
fi
echo
"
${
gci_images
[0]
}
"
}
if
[[
"
${
OS_DISTRIBUTION
}
"
==
"gci"
]]
;
then
# If the master image is not set, we use the
latest GCI dev
image.
# If the master image is not set, we use the
pinned GCI
image.
# Otherwise, we respect whatever is set by the user.
gci_images
=(
$(
gcloud compute images list
--project
google-containers
\
--show-deprecated
--no-standard-images
--sort-by
=
'~creationTimestamp'
\
--regexp
=
'gci-[a-z]+-53-.*'
--format
=
'table[no-heading](name)'
)
)
MASTER_IMAGE
=
${
KUBE_GCE_MASTER_IMAGE
:-
"
${
gci_images
[0]
}
"
}
MASTER_IMAGE
=
${
KUBE_GCE_MASTER_IMAGE
:-
"
$(
get_latest_gci_image
)
"
}
MASTER_IMAGE_PROJECT
=
${
KUBE_GCE_MASTER_PROJECT
:-
google
-containers
}
# The default node image when using GCI is still the Debian based ContainerVM
# until GCI gets validated for node usage.
...
...
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