operator/ingress: Delete +optional marker on type #440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make the
typefield of the endpoint publishing strategy for an IngressController resource a required field.The
typefield is a union discriminator field, and the KEP for union types states that a union discriminator field "CAN be optional". The IngressController resource'sspec.endpointPublishingStrategyfield is optional, so if it is specified, then it is reasonable to expect an explicit value be specified forspec.endpointPublishingStrategy.type, and the ingress operator will always set an explicit value for thestatus.endpointPublishingStrategy.typefield.The ingress operator currently has a CRD that was generated using controller-tools v0.2.0-beta.1, which ignores the
+optionalmarker, with the result thatspec.endpointPublishingStrategy.typeis required. controller-tools v0.2.0-beta.3 and newer respects the+optionalmarker (kubernetes-sigs/controller-tools@fcf4205), with the result that regenerating the CRD with the current API would cause the field to become no longer required. Because the current CRD specifies the field to be required, it is safe to remove the+optionalmarker now so that the field will continue to be required when the CRD is regenerated using newer controller-tools.operator/v1/types_ingress.go(EndpointPublishingStrategy): Remove the+optionalmarker on thetypefield.