[ https://issues.apache.org/jira/browse/FLINK-31794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17714086#comment-17714086 ]
Daren Wong commented on FLINK-31794: ------------------------------------ Hi Gyula, as discussed on Slack and reposting here for clarity, we are considering 2 cases here where CRD has upgraded (i.e new fields added): Case 1: Operator is changed before CRD changes. * User attempts to "k apply -f basicsessionjob.yaml" with the new field added. * Outcome: No problem as Kubernetes will prune this new field. Operator is able to deserialize as new field is pruned. Case 2: CRD is changed before Operator changes. * User attempts to "k apply -f basicsessionjob.yaml" with the new field added. * Outcome: Created FlinkSessionJob contains the new field. Operator is unable to deserialize this new/unknown field using Jackson. Hence, we propose to add {color:#172b4d}JsonIgnoreProperties for this case{color} > Ignore unknown CRD fields > ------------------------- > > Key: FLINK-31794 > URL: https://issues.apache.org/jira/browse/FLINK-31794 > Project: Flink > Issue Type: Improvement > Components: Kubernetes Operator > Affects Versions: kubernetes-operator-1.4.0 > Reporter: Daren Wong > Priority: Minor > Labels: pull-request-available > Fix For: kubernetes-operator-1.4.0 > > > Currently, Kubernetes Operator fails to create a CR (FlinkDeployment or > FlinkSessionJob) if there is a new field in the CR that's not included in the > CRD. > This change is to propose removing this restriction for > FlinkSessionJobStatus, FlinkSessionJobSpec, FlinkDeploymentStatus, > FlinkDeploymentSpec by adding class-level annotation > `{color:#bbb529}@JsonIgnoreProperties{color}(ignoreUnknown = > {color:#cc7832}true{color})`. > > This means that any new fields in CR will be ignored if it's not registered > in CRD preventing failures to create the CR. This helps users who need to > deploy CRD and Kubernetes Operator separately to ensure backward > compatibility. -- This message was sent by Atlassian Jira (v8.20.10#820010)