Closed yuha0 closed 5 years ago
priority
is labeled with omitempty
. This means it will not be returned if the value equals to 0
(0
means empty for an integer type).
Since 0 is already the default priority, I think it can be removed from the CRD definition.
CC @tombentley
TBH when I was implementing this I was just following the documentation here, which doesn't describe what the defaults for any of those fields are. I guess you're right at it could be omitted when 0, but it's harmless to include 0, so I don't see it as a priority to remove it.
@yuha0 sorry, I didn't see all the context provided above. I guess it is problematic for you. It should be trivial to fix, actually. On line 246 or the CrdGenerator
you can just add the priority
property conditionally. Would you be able to provide a PR?
@tombentley Yeah, the issue is trivial. Once I understood how priority
works I just changed the CRD in my cluster and it no longer bothers me.
Looks like this is just a small change in the CrdGenerator
. I can make a PR when I get a chance. Do you think if we can remove all the priority: 0
lines in all the yaml files under https://github.com/strimzi/strimzi-kafka-operator/tree/master/install as well? I am using the topic operator in standalone mode in a cluster with GitOps, so the CRDs are version controlled and I have to modify the yaml files to make the GitOps pipeline happy.
@yuha0 all the CRD YAMLs are generated by the CrdGenerator, so we need to make the fix there.
Describe the bug
kafkatopics.kafka.strimzi.io
has apriority
field inCustomResourceColumnDefinition
: https://github.com/strimzi/strimzi-kafka-operator/blob/master/install/topic-operator/04-Crd-kafkatopic.yaml#L30 However, this field is not returned in aGET
call by the API server:This means, if I execute
kubectl apply
multiple times, it will always show as configured instead of unchanged even if there's no change at all:To Reproduce Steps to reproduce the behavior:
kubectl apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/master/install/topic-operator/04-Crd-kafkatopic.yaml
kubectl apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/master/install/topic-operator/04-Crd-kafkatopic.yaml
priority
fieldExpected behavior I am not sure if this is something we can fix in the CRD, or an issue in Kubernetes API server, but I would want the API server to recognize everything we defined in the CRD definition, including the
priority
field.Additional context This is annoying if you have a GitOps pipeline to control strimzi CRDs -- our GitOps controller thinks the CRD is out of sync because the yaml file has
priority
field but the returned object fromkubectl get
does not have it