-
Notifications
You must be signed in to change notification settings - Fork 274
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
Add chart validation tests #4615
Add chart validation tests #4615
Conversation
d265c06
to
4054ffb
Compare
I would probably fix the charts in rke2-charts, then have two commits in this PR:
|
bfb42e7
to
395e54d
Compare
da325f4
to
9379420
Compare
41a4531
to
2da819b
Compare
3cd624e
to
a05c1bc
Compare
4c1ba88
to
132decd
Compare
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.
validate-charts is run as part of the CI for PRs, right?
8f1d403
to
e53024a
Compare
yes as part of |
scripts/validate-charts
Outdated
chart_name=$2 | ||
chart_tmp=$3 | ||
|
||
if [[ $chart_name == 'rancher-vsphere-cpi' ]]; 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.
is this chart untestable? if so, why?
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 chart doesn't work well with helm template
because of the versionOverrides
in its values.yaml
.
Since there is no actual k8s cluster to determine the version of the image to use, helm template
uses the .Capabilities.APIVersion
of the version of k8s that helm was built against so it chooses an image that doesn't match the one we need in the airgap file.
To workaround this we would need manually install the right version of Helm which would be different for the main branch and each release branch and would need to be updated for every new k8s version. Since it's only for this chart, I found it simpler to skip the test.
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.
You don't need to install different versions of Helm, you just need to use the --kube-version
flag to specify the Kubernetes version you want it to use when templating. You could probably just pass all the charts the $VERSION
environment variable set by version.sh
to make sure they handle it properly.
See: https://helm.sh/docs/helm/helm_template/#:~:text=Capabilities.KubeVersion
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.
Thanks for the tip!
Unfortunately now it shows that the vsphere charts aren't updated for k8s 1.28 so the test is still broken.
I started to update them by adding the missing images to image-mirror:
rancher/image-mirror#482
55b26bc
to
01d35a1
Compare
01d35a1
to
b61c72d
Compare
I believe the test failure is valid, and that chart doesn't support 1.28 yet. This will be an ongoing problem whenever upstream support lags on a new minor. |
I made a PR to update the upstream chart: rancher/vsphere-charts#62 In any case, the problem will happen for every new minor release so I guess it would still be better if the test doesn't fail because of this chart. |
Yeah, but we don't want to ignore problems on minors that ARE supported. Some of the charts have an annotation that we could probably use to decide whether to fail or warn, based on whether or not the chart is expected to support the current Kubernetes version: |
84a441d
to
84cfb1b
Compare
if [ "$lower_bound_major" -le "$kube_version_major" ] && \ | ||
[ "$kube_version_major" -le "$upper_bound_major" ] && \ | ||
[ "$lower_bound_minor" -le "$kube_version_minor" ] && \ | ||
[ "$kube_version_minor" -le "$upper_bound_minor" ] && \ | ||
[ "$lower_bound_patch" -le "$kube_version_patch" ] && \ | ||
[ "$kube_version_patch" -le "$upper_bound_patch" ]; 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.
this is a little gnarly but I think it'll work...
d0dcaef
to
8da1dd3
Compare
validate-charts runs as part of 'make validate' step and checks that all images used in packaged charts: - use systemGlobalRegistry - are present in script/build-images Signed-off-by: Thomas Ferrandiz <[email protected]>
8da1dd3
to
8681d0e
Compare
Proposed Changes
validate-charts runs as part of 'make validate' step and checks that all images used in packaged charts:
Types of Changes
Tests
Verification
Testing
Linked Issues
#4485
User-Facing Change
Further Comments
At the moment, the new test fails because some charts don't use
systemGlobalRegistry
at all.I'm not sure what would be the best way to move forward:
Also I don;t know if the
busybox
image should be an exception or not.