-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[v1.8] k8s: Fix non-structural schema with CiliumNode #13196
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
[v1.8] k8s: Fix non-structural schema with CiliumNode #13196
Conversation
test-backport-1.8 |
Just a question on how we decide to do direct backport instead of backporting from upstream PR :). Thanks. |
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.
Also, please write a good release note for our users
@@ -31,7 +31,7 @@ const ( | |||
|
|||
// CustomResourceDefinitionSchemaVersion is semver-conformant version of CRD schema | |||
// Used to determine if CRD needs to be updated in cluster | |||
CustomResourceDefinitionSchemaVersion = "1.21.1" | |||
CustomResourceDefinitionSchemaVersion = "1.21.2" |
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 versioning is only used for Cilium [C]CNP. Lines 261-263 are missing this annotation so the "upgrade" of this CRD won't work.
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.
Ah good catch. How should we workaround this 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.
We just need to add the annotation in the Cilium Node. AFAIK, the update logic will update a CRD if the old one does not contain the annotation but the new one does.
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.
Presumably we'll need another fix on master to propagate the schema version for 1.9 or later.
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.
master
already attaches the schema versions to all CRDs:
Labels: map[string]string{ |
@sayboras We usually do this when the issue is not on |
@aanm I updated it, but unsure how to best word this one. Feel free to update the PR description to your liking. |
@christarazi The question is typically "If I'm a user without deep understanding of Cilium internals, how do I know if this bug might be fixing the issue I'm hitting?". From this perspective:
This says OK there's some problem with the schema, but the symptoms and consequences aren't clear. I would suggest instead something like:
|
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've fixed up the release note. Just need to address the schema version issue Andre pointed out below.
@@ -31,7 +31,7 @@ const ( | |||
|
|||
// CustomResourceDefinitionSchemaVersion is semver-conformant version of CRD schema | |||
// Used to determine if CRD needs to be updated in cluster | |||
CustomResourceDefinitionSchemaVersion = "1.21.1" | |||
CustomResourceDefinitionSchemaVersion = "1.21.2" |
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.
Presumably we'll need another fix on master to propagate the schema version for 1.9 or later.
Thanks! This is a helpful way to frame the release notes. The new release note sounds much better to me 👍 |
The schema was missing a `type` field on the `spec` property. ``` conditions: - lastTransitionTime: "2020-09-16T21:08:18Z" message: '[spec.validation.openAPIV3Schema.properties[spec].type: Required value: must not be empty for specified object fields, spec.validation.openAPIV3Schema.type: Required value: must not be empty at the root]' reason: Violations status: "True" type: NonStructuralSchema ``` Signed-off-by: Chris Tarazi <chris@isovalent.com>
This commit allows the CiliumNode CRD to be versioned. Signed-off-by: Chris Tarazi <chris@isovalent.com>
Signed-off-by: Chris Tarazi <chris@isovalent.com>
f90c9d6
to
b5d16f9
Compare
test-backport-1.8 |
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.
LGTM, though @aanm would know the nuance of these specifications more clearly
test-missed-k8s |
This is a direct backport to 1.8.
Fixes: #13192