-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(helm): add list of container images #549
base: develop
Are you sure you want to change the base?
Conversation
cf808f6
to
68e3309
Compare
Adds a list of container images which are used by the chart. This list is contained in file: charts/images.txt Sometimes the images can't be figured out using templates, and in such cases we need to manually add them. charts/dependencies-images.txt is covering the this for the dependencies. Signed-off-by: Tiago Castro <tiagolobocastro@gmail.com>
68e3309
to
6d37394
Compare
$HELM dependency update | ||
fi | ||
|
||
$HELM template . --set "$ENABLE_ANALYTICS" | grep "image:" | awk '{ print $2 }' | tr -d \" > "$IMAGES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable analytics is not needed, the analytics code is embedded in the csi-controller image. But anyway since this is helm template should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's safer to enable all many options as we can, maybe tomorrow that can change, who knows.
Also we can enable jaeger here, just for completeness, though it's again tricky because it's operator based :(
if [ "$DEP_UPDATE" = "true" ]; then | ||
$HELM dependency update | ||
fi | ||
|
||
$HELM template . --set "$ENABLE_ANALYTICS" | grep "image:" | awk '{ print $2 }' | tr -d \" > "$IMAGES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: --dependency-update
does the same thing
if [ "$DEP_UPDATE" = "true" ]; then | |
$HELM dependency update | |
fi | |
$HELM template . --set "$ENABLE_ANALYTICS" | grep "image:" | awk '{ print $2 }' | tr -d \" > "$IMAGES" | |
dependency_update_opt= | |
if [ "$DEP_UPDATE" = "true" ]; then | |
dependency_update_opt="--dependency-update" | |
fi | |
$HELM template . --set "$ENABLE_ANALYTICS" "$dependency_update_opt" | grep "image:" | awk '{ print $2 }' | tr -d \" > "$IMAGES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It requires more changes :)
Other than that, any advantage?
echo_stderr() { | ||
echo -e "${1}" >&2 | ||
} | ||
|
||
die() { | ||
local _return="${2:-1}" | ||
echo_stderr "$1" | ||
exit "${_return}" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's /scripts/utils/log.sh you could source and use log_fatal or log_error.
local image="$1" | ||
local file="$2" | ||
|
||
grep -q "^$image$" "$file" || grep -q "^${image##docker.io/}$" "$file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Hostpath LocalPV images don't start with "docker.io".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, are you suggesting any changes here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, sometimes the registry might not be specified, do we handle those cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused.. it's handled in line 29, what's the problem?
|
||
curr_images=$($DOCKER exec $worker crictl image | tail -n+2 | awk '{ print $1 ":" $2 }') | ||
for image in ${curr_images[@]}; do | ||
if grep_image "$image" "$worker/$KIND_IMAGES"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also list the pause image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably yes
Adds a list of container images which are used by the chart. This list is contained in file: charts/images.txt
Sometimes the images can't be figured out using templates, and in such cases we need to manually add them.
charts/dependencies-images.txt is covering the this for the dependencies.