Closed MenD32 closed 3 months ago
It affects https://github.com/kubernetes-sigs/controller-tools/releases/tag/v0.16.0-beta.0, works with v0.15.0 in my case
Another case was reported here: https://github.com/kubernetes-sigs/controller-tools/issues/1034
I assume the relevant change since v0.15.0 is this one: https://github.com/kubernetes-sigs/controller-tools/pull/938
Not sure what's going on, clearly looks like a bug:
// Protocol for port. Must be UDP, TCP, or SCTP.
// Defaults to "TCP".
// +optional
// +default="TCP"
Protocol corev1.Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"`
leads to
protocol:
allOf:
- default: TCP
- default: TCP
description: |-
Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
@sbueringer do you want to fix it?
Already on it
PR is open: https://github.com/kubernetes-sigs/controller-tools/pull/1035
If possible, please also test in your use cases to ensure it fixes the entire issue (although I'm pretty confident)
Once the PR merges I would cut a patch release
If possible, please also test in your use cases to ensure it fixes the entire issue (although I'm pretty confident)
Yes, it's working fine. Thank you so much!
PR is open: #1035
If possible, please also test in your use cases to ensure it fixes the entire issue (although I'm pretty confident)
Once the PR merges I would cut a patch release
It does look like it doesn't produce the defaults for container port. 👍
Thx for reporting everyone! v0.16.1 with the fix is now available: https://github.com/kubernetes-sigs/controller-tools/releases/tag/v0.16.1
I have the following types.go file:
after generating a CRD from this code with controller-gen like so:
controller-gen crd:generateEmbeddedObjectMeta=true paths="./pkg/apis/..." output:stdout | tail -n +2 > manifests/crd.yaml
and trying to apply with
kubectl create
I get the following error(s):after some messing around i found that removing the
// +default="TCP"
comment from ContainerPort.Protocol in k8s.io/api, fixes the issue while maintaining the default value of TCP in the CRD itself.versions: