Skip to content

Conversation

gaurav-splunk
Copy link
Collaborator

Problem
If we upgrade the operator from 1.0.1 to 1.0.2, the CRD version is also upgraded from v1 to v2. Now after the upgrade the spec section of the CRs(which were still on version v1) was pruned and pods either started crashing or they came up with no spec section at all.

This happened because of the default kubernetes behavior of pruning the unknown fields(fields that are not native to K8s server, such as the spec section of a CRD) of a CRD.

Solution
To fix this we had to add the field x-kubernetes-preserve-unknown-fields: true to older versions of the CRDs so that when we upgrade to newer version/s, we still retain all the fields of the older versions.

Copy link
Collaborator

@akondur akondur left a comment

Choose a reason for hiding this comment

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

Looks good, great find @gaurav-splunk

@smohan-splunk smohan-splunk merged commit 3b3c7c9 into develop Aug 12, 2021
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.

5 participants