-
Notifications
You must be signed in to change notification settings - Fork 597
override unmarshalJSON for supportedfeature to ensure comptability #3454
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
override unmarshalJSON for supportedfeature to ensure comptability #3454
Conversation
bee21ac
to
d556655
Compare
d556655
to
79f9a27
Compare
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.
LGTM and manually tested. Thanks a bunch!!
/cherry-pick release-1.2 |
@robscott: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
Looks like we need codegen: diff --git a/apis/v1/zz_generated.deepcopy.go b/apis/v1/zz_generated.deepcopy.go
index 62fb99b0..fe1fb89b 100644
--- a/apis/v1/zz_generated.deepcopy.go
+++ b/apis/v1/zz_generated.deepcopy.go
@@ -1744,3 +1744,18 @@ func (in *SupportedFeature) DeepCopy() *SupportedFeature {
in.DeepCopyInto(out)
return out
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SupportedFeatureInternal) DeepCopyInto(out *SupportedFeatureInternal) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SupportedFeatureInternal.
+func (in *SupportedFeatureInternal) DeepCopy() *SupportedFeatureInternal {
+ if in == nil {
+ return nil
+ }
+ out := new(SupportedFeatureInternal)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go
index a613f40a..ca69f4d3 100644
--- a/pkg/generated/openapi/zz_generated.openapi.go
+++ b/pkg/generated/openapi/zz_generated.openapi.go
@@ -145,6 +145,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"sigs.k8s.io/gateway-api/apis/v1.SecretObjectReference": schema_sigsk8sio_gateway_api_apis_v1_SecretObjectReference(ref),
"sigs.k8s.io/gateway-api/apis/v1.SessionPersistence": schema_sigsk8sio_gateway_api_apis_v1_SessionPersistence(ref),
"sigs.k8s.io/gateway-api/apis/v1.SupportedFeature": schema_sigsk8sio_gateway_api_apis_v1_SupportedFeature(ref),
+ "sigs.k8s.io/gateway-api/apis/v1.SupportedFeatureInternal": schema_sigsk8sio_gateway_api_apis_v1_SupportedFeatureInternal(ref),
"sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicy(ref),
"sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicyList(ref),
"sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref),
@@ -3797,8 +3798,7 @@ func schema_sigsk8sio_gateway_api_apis_v1_GatewayClassStatus(ref common.Referenc
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
- Default: map[string]interface{}{},
- Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SupportedFeature"),
+ Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SupportedFeature"),
},
},
},
@@ -5650,6 +5650,27 @@ func schema_sigsk8sio_gateway_api_apis_v1_SupportedFeature(ref common.ReferenceC
}
}
+func schema_sigsk8sio_gateway_api_apis_v1_SupportedFeatureInternal(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "This is solely for the purpose of ensuring backward compatibility and SHOULD NOT be used elsewhere.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "name": {
+ SchemaProps: spec.SchemaProps{
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ },
+ Required: []string{"name"},
+ },
+ },
+ }
+}
+
func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{ We can do a followup release if needed, but fwiw we are targeting an Istio release tomorrow afternoon that would be great to include this in. Not a big deal if we miss it, though. |
79f9a27
to
93fd4ac
Compare
@howardjohn Will ask for approval in the slack chat later today, wdyt about my comment #3454 (comment) ? |
/lgtm |
93fd4ac
to
c36015e
Compare
c36015e
to
c666019
Compare
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.
Agree with @candita's suggestion + looks like golint is failing, otherwise LGTM.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LiorLieberman, robscott The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
/lgtm
@robscott: new pull request created: #3465 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 kubernetes-sigs/prow repository. |
I messed up the branch name so disregard it.
What type of PR is this?
/kind bug
What this PR does / why we need it:
This change is following an issue with the breaking change we introduced in #3200.
Issue link - istio/istio#53846
I added unitests which hopefully provide enough coverage but happy to add more tests if you have ideas.
Which issue(s) this PR fixes:
Fixes #3464
Does this PR introduce a user-facing change?:
/cc @howardjohn @youngnick @mikemorris @robscott