Skip to content
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

fix: missing array type in the CRD rollout's spec volumes #1737

Merged
merged 3 commits into from
Jan 12, 2022

Conversation

huikang
Copy link
Member

@huikang huikang commented Dec 30, 2021

Signed-off-by: Hui Kang [email protected]

fix #1721

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@huikang huikang requested a review from alexmt December 30, 2021 20:17
@huikang huikang force-pushed the 1721-fix-volumes-rollouts branch from 78009a2 to cd0030d Compare December 30, 2021 20:27
@codecov
Copy link

codecov bot commented Dec 30, 2021

Codecov Report

Merging #1737 (4984772) into master (04494ef) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1737   +/-   ##
=======================================
  Coverage   82.02%   82.02%           
=======================================
  Files         116      116           
  Lines       16096    16096           
=======================================
  Hits        13203    13203           
  Misses       2218     2218           
  Partials      675      675           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04494ef...4984772. Read the comment docs.

@jessesuen
Copy link
Member

@huikang thanks for fixing this. Do you think we could modify an e2e test to have a volume so that we catch this in the future?

@huikang
Copy link
Member Author

huikang commented Jan 4, 2022

@huikang thanks for fixing this. Do you think we could modify an e2e test to have a volume so that we catch this in the future?

Sure, let me look into this and get back to you later.

@huikang
Copy link
Member Author

huikang commented Jan 4, 2022

@jessesuen , checking that the volumes field is an array seems a feature starting from k8s release 1.23.1 (which could put more strict check on the crd fields).

For k8s version v1.21.1, v1.22.1, the original install.yaml works fine, although it misses the array type for the volumes.
Only k8s v1.23.1 reports the following error with the wrong rollout crd:

"The Rollout \"rollouts-demo\" is invalid: spec.template.spec.volumes[0].name: Required value"
  namespace=default rollout=rollouts-demo

Since the existing git CI of this repo defaults to v1.22.1, one solution would be to upgrade the version to v1.23.1

- name: Setup k3s
run: |
curl -sfL https://get.k3s.io | sh -
sudo mkdir ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chmod 755 ~/.kube/config
kubectl version
kubectl create ns argo-rollouts

and then add volumes to one of the existing e2e rollout.

What do you think?

Hui Kang added 2 commits January 4, 2022 12:27
Signed-off-by: Hui Kang <[email protected]>
@huikang huikang force-pushed the 1721-fix-volumes-rollouts branch from 0d7833f to b6b23b6 Compare January 4, 2022 17:27
Signed-off-by: Hui Kang <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Jan 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add e2e test as a separate PR which conditionally skips depending on the k8s version it is running against.

@jessesuen jessesuen added this to the v1.2 milestone Jan 12, 2022
@jessesuen jessesuen merged commit 649aa55 into argoproj:master Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding a volume to a rollout breaks it
2 participants