-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] OCPBUGS-39148: Add Feature Gate AND on NetworkLoadBalancer CEL #2131
base: master
Are you sure you want to change the base?
[WIP] OCPBUGS-39148: Add Feature Gate AND on NetworkLoadBalancer CEL #2131
Conversation
@gcs278: This pull request references Jira Issue OCPBUGS-39148, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Hello @gcs278! Some important instructions when contributing to openshift/api: |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gcs278 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/jira refresh |
@gcs278: This pull request references Jira Issue OCPBUGS-39148, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
operator/v1/types_ingress.go
Outdated
// +openshift:validation:FeatureGateAwareXValidation:featureGate=SetEIPForNLBIngressController,rule=`has(self.subnets) && has(self.subnets.ids) && has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids + self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" | ||
// +openshift:validation:FeatureGateAwareXValidation:featureGate=SetEIPForNLBIngressController,rule=`has(self.subnets) && has(self.subnets.ids) && !has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" | ||
// +openshift:validation:FeatureGateAwareXValidation:featureGate=SetEIPForNLBIngressController,rule=`has(self.subnets) && has(self.subnets.names) && !has(self.subnets.ids) && has(self.eipAllocations) ? size(self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" | ||
// +openshift:validation:FeatureGateAwareXValidation:featureGate=SetEIPForNLBIngressController;IngressControllerLBSubnetsAWS,rule=`has(self.subnets) && has(self.subnets.ids) && has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids + self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this? I think we added a separate field, so it may need to be
// +openshift:validation:FeatureGateAwareXValidation:featureGate=SetEIPForNLBIngressController;IngressControllerLBSubnetsAWS,rule=`has(self.subnets) && has(self.subnets.ids) && has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids + self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" | |
// +openshift:validation:FeatureGateAwareXValidation:requiredFeatureGate=SetEIPForNLBIngressController;IngressControllerLBSubnetsAWS,rule=`has(self.subnets) && has(self.subnets.ids) && has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids + self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea sorry, I notice this too, and I was trying to change to use requiredFeatureGate
, but now I get:
F0103 11:03:44.606428 1073642 root.go:64] Error running codegen:
error running generator schemapatch on group imageregistry.operator.openshift.io:
could not run schemapatch generator for group/version imageregistry.operator.openshift.io/v1:
could not execute schemapatch for manifest /home/gspence/src/github.com/openshift/api/imageregistry/v1/zz_generated.featuregated-crd-manifests/configs.imageregistry.operator.openshift.io/AAA_ungated.yaml:
github.com/openshift/api/imageregistry/v1:-: unable to locate schema for type "github.com/openshift/api/operator/v1".OperatorStatus
github.com/openshift/api/imageregistry/v1:-: unable to locate schema for type "github.com/openshift/api/operator/v1".OperatorSpec
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:806:1: missing argument "featureGate" (at <input>:1:337)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:807:1: missing argument "featureGate" (at <input>:1:317)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:808:1: missing argument "featureGate" (at <input>:1:319)
github.com/openshift/api/operator/v1:-: unknown type "github.com/openshift/api/operator/v1".OperatorSpec
github.com/openshift/api/operator/v1:-: unknown type "github.com/openshift/api/operator/v1".OperatorStatus
error running generator schemapatch on group operator.openshift.io:
could not run schemapatch generator for group/version operator.openshift.io/v1alpha1:
could not execute schemapatch for manifest /home/gspence/src/github.com/openshift/api/operator/v1alpha1/zz_generated.featuregated-crd-manifests/clusterversionoperators.operator.openshift.io/ClusterVersionOperatorConfiguration.yaml:
github.com/openshift/api/operator/v1alpha1:-: unable to locate schema for type "github.com/openshift/api/operator/v1".LogLevel
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:806:1: missing argument "featureGate" (at <input>:1:337)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:807:1: missing argument "featureGate" (at <input>:1:317)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:808:1: missing argument "featureGate" (at <input>:1:319)
github.com/openshift/api/operator/v1:-: unknown type "github.com/openshift/api/operator/v1".LogLevel
could not run schemapatch generator for group/version operator.openshift.io/v1:
could not execute schemapatch for manifest /home/gspence/src/github.com/openshift/api/operator/v1/manual-override-crd-manifests/clustercsidrivers.operator.openshift.io/AAA_ungated.yaml:
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:806:1: missing argument "featureGate" (at <input>:1:337)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:807:1: missing argument "featureGate" (at <input>:1:317)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:808:1: missing argument "featureGate" (at <input>:1:319)
error running generator schemapatch on group samples.operator.openshift.io:
could not run schemapatch generator for group/version samples.operator.openshift.io/v1:
could not execute schemapatch for manifest /home/gspence/src/github.com/openshift/api/samples/v1/zz_generated.featuregated-crd-manifests/configs.samples.operator.openshift.io/AAA_ungated.yaml:
github.com/openshift/api/samples/v1:-: unable to locate schema for type "github.com/openshift/api/operator/v1".ManagementState
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:806:1: missing argument "featureGate" (at <input>:1:337)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:807:1: missing argument "featureGate" (at <input>:1:317)
/home/gspence/src/github.com/openshift/api/operator/v1/types_ingress.go:808:1: missing argument "featureGate" (at <input>:1:319)
github.com/openshift/api/operator/v1:-: unknown type "github.com/openshift/api/operator/v1".ManagementState
I'm not totally sure why I'm getting missing argument "featureGate"
, I might be doing something silly...any help is appreciated.
Previously, the AWSNetworkLoadBalancerParameters struct had CEL that referenced both Subnets and EIPAllocations, but only was gated on the EIPAllocations feature gate. This means if the subnets feature gate was ever disabled, then the IngressController CRD would be invalid because the CEL would still be present, causing an error when installing the CRD. We are now able to add "AND" logic to the FeatureGateAwareXValidation tag which enables us to feature gate the CEL on both Subnets and EIPAllocations feature gates.
7017b04
to
3b80fa4
Compare
@gcs278: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Previously, the AWSNetworkLoadBalancerParameters struct had CEL that referenced both Subnets and EIPAllocations, but only was gated on the EIPAllocations feature gate. This means if the subnets feature gate was ever disabled, then the IngressController CRD would be invalid because the CEL would still be present, causing an error when installing the CRD.
We are now able to add "AND" logic to the FeatureGateAwareXValidation tag which enables us to feature gate the CEL on both Subnets and EIPAllocations feature gates.