-
Notifications
You must be signed in to change notification settings - Fork 706
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
Use bitnami images before updating bitnami chart #976
Conversation
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.
nice, thanks!
script/chart_sync_utils.sh
Outdated
# Replace quay.io images for docker.io | ||
sed -i.bk 's/registry: quay.io/registry: docker.io/g' "${targetChartPath}/values.yaml" | ||
# Remove v prefix from tags | ||
sed -i.bk 's/tag: v\(.*\)/tag: \1/g' "${targetChartPath}/values.yaml" |
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.
We might want to be more careful here and only change the tag of images that match the repository: (helmpack|kubeapps)\/
on the previous line. See https://stackoverflow.com/questions/18620153/find-matching-text-and-replace-next-line for an example of how to do this with sed.
That said, it might not be necessary since we expect to do this for all images once keycloak-gatekeeper has a corresponding bitnami 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.
the problem is that the regex gets a bit complicated:
sed -i.bk '/repository: \(helmpack\|kubeapps\)\/\(.*\)/{n;s/tag: v\(.*\)/tag: \1/g}' "${targetChartPath}/values.yaml"
Actually it will be simpler if we directly use bitnami images for helmpack
images. Since we are not publishing directly in that repo we can just use the bitnami one in master.
script/chart_sync_utils.sh
Outdated
# Remove v prefix from tags | ||
sed -i.bk 's/tag: v\(.*\)/tag: \1/g' "${targetChartPath}/values.yaml" | ||
# Use bitnami images | ||
sed -i.bk 's/repository: helmpack\/\(.*\)/repository: bitnami\/kubeapps-\1/g' "${targetChartPath}/values.yaml" |
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.
we could combine these with ...repository: (helmpack|kubeapps)\/...
, but not that important as again, we will probably just apply this chart-wide once we have the bitnami version of keycloak-gatekeeper.
@@ -57,7 +57,10 @@ updateRepo() { | |||
sed -i.bk 's/appVersion: DEVEL/appVersion: '"${targetTag}"'/g' "${chartYaml}" | |||
rm "${targetChartPath}/Chart.yaml.bk" | |||
# DANGER: This replaces any tag marked as latest in the values.yaml | |||
sed -i.bk 's/tag: latest/tag: '"${targetTag}"'/g' "${targetChartPath}/values.yaml" | |||
local tagWithoutV=$(echo $targetTag | tr -d v) | |||
sed -i.bk 's/tag: latest/tag: '"${tagWithoutV}"'/g' "${targetChartPath}/values.yaml" |
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.
nice solution 👌
It's now a requirement to use bitnami images wherever is possible for charts published at https://github.com/bitnami/charts.
Note that bitnami images are mirrored versions from the ones we are currently using but their tags doesn't contain the prefix
v
:v1.3.0 -> 1.3.0
. They are hosted in the docker hub and have the prefixkubeapps-<name of the image>
.This is an example of changes performed from the dev version of the chart in this repository to the one that will be submitted to the bitnami repository:
I have manually tested the changes and I didn't found any issue with the mirrored images.