Sometimes it happens that users mis-configure something in the custom resource - for example by placing the field into the wrong path etc. That can have sometimes serious consequences - we had several users who had this issue with authorization and were wondering why does the authorization nor work. This applies similarly also to deprecated fields.
We already detect such fields and print them in logs. E.g.:
2020-07-24 23:10:20 WARN AbstractOperator:92 - Kafka resource my-cluster in namespace myproject: In API version kafka.strimzi.io/v1beta1 the property tolerations at path spec.kafka.tolerations has been deprecated. This feature should now be configured at path spec.kafka.template.pod.tolerations. 2020-07-24 23:10:20 WARN AbstractOperator:117 - Kafka resource my-cluster in namespace myproject: Contains object at path spec.kafka.listeners with an unknown property: authorization
However, it seems people often miss them in logs. For example when the operator is running in different namespace, possibly installed by someone else or from OperatorHub.io it might be hard to even find the logs.
We should add these fields in addition to the logs also to the status condition where they might be easier to notice:
# ... status: conditions: - lastTransitionTime: 2020-07-24T23:09:27+0000 status: "True" type: Ready - lastTransitionTime: "2020-07-24T23:06:34.339352Z" message: 'Contains object at path spec.kafka.listeners with an unknown property: authorization' reason: UnknownFields status: "True" type: Warning - lastTransitionTime: "2020-07-24T23:06:34.339445Z" message: In API version kafka.strimzi.io/v1beta1 the property tolerations at path spec.kafka.tolerations has been deprecated. This feature should now be configured at path spec.kafka.template.pod.tolerations. reason: DeprecatedFields status: "True" type: Warning # ...
This issue does not impact KafkaRebalance and KafkaConnector resources which have their own reconciliation cycle and do not seem to use the ValidatingVisitor. Separate GitHub issues #3637 and #3638 have been opened to cover that.