-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CRD fails to apply on upgrade - preserveUnknownFields must be false in order to use defaults #4237
Comments
@bdaoudtdc just want to confirm, you're upgrading from Calico v3.1.4 to v3.1.7 on Kubernetes 1.17? Or do you mean v3.14 to v3.17? We never released a v3.1.14 or a v3.1.17 If you're using Calico v3.1, I'm not sure that can be expected to work. Calico v3.1.x is very old, and we stopped testing of it around the time of Kubernetes 1.10, which is also quite old. https://docs.projectcalico.org/archive/v3.1/getting-started/kubernetes/requirements |
Sorry this was a typo ... versions adjusted. |
Same issue with Kubernetes 1.19.4. Two possible solutions:
spec:
group: crd.projectcalico.org
names:
kind: BGPPeer
listKind: BGPPeerList
plural: bgppeers
singular: bgppeer
scope: Cluster
preserveUnknownFields: false
[...]
The CRD will apply successfully in both cases. |
Thank you . and it ran OK. |
Sounds like we need to be making one of those changes in our CRD manifests, so I'm going to keep this open. |
I ran into the same issue today. Do you already have a recommendation about which of the two solutions is the correct one? |
In this case it appears that the default value specified in the schema matches the default that would occur anyway due to golang defaulting (i.e., false). So, it should be safe to simply remove the default. https://github.com/projectcalico/libcalico-go/blob/master/lib/apis/v3/bgppeer.go#L78 I still need to wrap my head around the implications of setting |
* Remove bgppeer KeepOriginalNextHop default Attempts to fix projectcalico/calico#4237 * Update bgppeers CRD
Expected Behavior
No errors while upgrading
Current Behavior
The CustomResourceDefinition "bgppeers.crd.projectcalico.org" is invalid: spec.preserveUnknownFields: Invalid value: true: must be false in order to use defaults in the schema
Possible Solution
Steps to Reproduce (for bugs)
kubectl apply -f calico.yaml --validate
1.
2.
3.
4.
Context
Trying to upgrade calico
Your Environment
Kubernetes with 1 master & 2 workers
Calico version
Upgrade from 3.14.1 to 3.17.0
Orchestrator version (e.g. kubernetes, mesos, rkt):
Kubernetes 1.17.13
Operating System and version:
RHEL 7.5
The text was updated successfully, but these errors were encountered: