From b823cd8aca4e83d79c1abd422a38ebe3489e4e73 Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Tue, 19 Oct 2021 11:18:13 -0600 Subject: [PATCH 1/2] apis/v1alpha2: fix GatewayClass controllerName print column Signed-off-by: Steve Kriss --- apis/v1alpha2/gatewayclass_types.go | 2 +- .../crd/v1alpha2/gateway.networking.k8s.io_gatewayclasses.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/v1alpha2/gatewayclass_types.go b/apis/v1alpha2/gatewayclass_types.go index 8af38526b5..699bc78c8a 100644 --- a/apis/v1alpha2/gatewayclass_types.go +++ b/apis/v1alpha2/gatewayclass_types.go @@ -26,7 +26,7 @@ import ( // +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc // +kubebuilder:subresource:status // +kubebuilder:storageversion -// +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controller` +// +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // +kubebuilder:printcolumn:name="Description",type=string,JSONPath=`.spec.description`,priority=1 diff --git a/config/crd/v1alpha2/gateway.networking.k8s.io_gatewayclasses.yaml b/config/crd/v1alpha2/gateway.networking.k8s.io_gatewayclasses.yaml index cac5b0ee79..87e3e59a4c 100644 --- a/config/crd/v1alpha2/gateway.networking.k8s.io_gatewayclasses.yaml +++ b/config/crd/v1alpha2/gateway.networking.k8s.io_gatewayclasses.yaml @@ -21,7 +21,7 @@ spec: scope: Cluster versions: - additionalPrinterColumns: - - jsonPath: .spec.controller + - jsonPath: .spec.controllerName name: Controller type: string - jsonPath: .metadata.creationTimestamp From 2d00e06982885cf15d9365e9e245024aa977d388 Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Mon, 13 Dec 2021 09:31:35 -0800 Subject: [PATCH 2/2] Fixing bug where namespace could be unspecified in ReferencePolicy --- apis/v1alpha2/referencepolicy_types.go | 2 +- .../gateway.networking.k8s.io_referencepolicies.yaml | 1 + .../v1alpha2/referencepolicy/missing-ns.yaml | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 hack/invalid-examples/v1alpha2/referencepolicy/missing-ns.yaml diff --git a/apis/v1alpha2/referencepolicy_types.go b/apis/v1alpha2/referencepolicy_types.go index 32738c05af..aac24b1b92 100644 --- a/apis/v1alpha2/referencepolicy_types.go +++ b/apis/v1alpha2/referencepolicy_types.go @@ -104,7 +104,7 @@ type ReferencePolicyFrom struct { // Namespace is the namespace of the referent. // // Support: Core - Namespace Namespace `json:"namespace,omitempty"` + Namespace Namespace `json:"namespace"` } // ReferencePolicyTo describes what Kinds are allowed as targets of the diff --git a/config/crd/v1alpha2/gateway.networking.k8s.io_referencepolicies.yaml b/config/crd/v1alpha2/gateway.networking.k8s.io_referencepolicies.yaml index 685f5fb999..846311ca7c 100644 --- a/config/crd/v1alpha2/gateway.networking.k8s.io_referencepolicies.yaml +++ b/config/crd/v1alpha2/gateway.networking.k8s.io_referencepolicies.yaml @@ -86,6 +86,7 @@ spec: required: - group - kind + - namespace type: object maxItems: 16 minItems: 1 diff --git a/hack/invalid-examples/v1alpha2/referencepolicy/missing-ns.yaml b/hack/invalid-examples/v1alpha2/referencepolicy/missing-ns.yaml new file mode 100644 index 0000000000..cb681340ea --- /dev/null +++ b/hack/invalid-examples/v1alpha2/referencepolicy/missing-ns.yaml @@ -0,0 +1,11 @@ +apiVersion: gateway.networking.k8s.io/v1alpha2 +kind: ReferencePolicy +metadata: + name: missing-ns +spec: + to: + - group: "" + kind: "Service" + from: + - group: "gateway.networking.k8s.io" + kind: "HTTPRoute"