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: spec.preserveUnknownFields must be explicitly false to allow upgrades from apiextensions.k8s.io/v1beta1 #1069

Merged

Conversation

jessesuen
Copy link
Member

@jessesuen jessesuen commented Apr 6, 2021

Resolves #1067

After switching from v1beta1 to v1 CRD, the default value of spec.preserveUnknownFields in Kubernetes went from true to false. Because this field is unmanaged in our previous and current set of manifests, when upgrading from the v1beta1 CRD version to v1, it would encounter the following error:

spec.preserveUnknownFields: Invalid value: true: must be false in order to use defaults in the schema

This is because when the v1 CRD was attempted to be applied (over the existing v1beta1 version), K8s rejected the update stating the value must be false (since a v1 manifest was being applied). This change explicitly sets it to false so that upgrades can happen from v0.10 to v1.0

Also removes our removeDescriptions workaround now that controller-gen has the ability to remove descriptions.

Signed-off-by: Jesse Suen jesse_suen@intuit.com

@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #1069 (386a4b7) into master (7facfaa) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1069   +/-   ##
=======================================
  Coverage   81.22%   81.22%           
=======================================
  Files         103      103           
  Lines        9180     9180           
=======================================
  Hits         7456     7456           
  Misses       1229     1229           
  Partials      495      495           

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 7facfaa...386a4b7. Read the comment docs.

@jessesuen jessesuen requested a review from alexmt April 9, 2021 18:53
Copy link
Contributor

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM

…rades from apiextensions.k8s.io/v1beta1

Signed-off-by: Jesse Suen <jesse_suen@intuit.com>
@jessesuen jessesuen force-pushed the fix-explicit-preserveUnknownFields branch from 90b254d to 386a4b7 Compare April 10, 2021 00:48
@sonarqubecloud
Copy link

Kudos, SonarCloud 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
33.7% 33.7% Duplication

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.

spec.preserveUnknownFields: Invalid value: true: must be false in order to use defaults in the schema
2 participants