chzhuo opened a new issue #621: URL: https://github.com/apache/apisix-ingress-controller/issues/621
### Issue description Should add tag `omitempty` to v2alpha1's config item `backend` and `backends` https://github.com/apache/apisix-ingress-controller/blob/master/pkg/kube/apisix/apis/config/v2alpha1/types.go#L95-L99 When using `clientset v2alpha1` to create a `ApisixRoute`, if set `backends` not `nil` and set `backend=nil` you will get error: ``` "spec.http" must validate one and only one schema (oneOf). Found 2 valid alternatives, spec.http.backend: Invalid value: "null": spec.http.backend in body must be of type object: "null" ``` Because there is a validation in CRD that will checking `backend` and `backends`, so only oneOf `backend` and `backends` should marshal to ### Environment apisix-ingress-controller: github.com/apache/apisix-ingress-controller v1.0.0 k8s: Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T12:41:49Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"} -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
