From 26c51a5516c92981de8f98d075ac2bd2d4ac6389 Mon Sep 17 00:00:00 2001 From: Yi Tao Date: Thu, 19 Sep 2024 16:26:14 +0800 Subject: [PATCH] update comments --- api/configuration/v1/kongconsumer_types.go | 1 - api/configuration/v1alpha1/konnect_controlplaneref_types.go | 4 +++- .../bases/configuration.konghq.com_kongcacertificates.yaml | 3 +-- .../bases/configuration.konghq.com_kongconsumergroups.yaml | 3 +-- config/crd/bases/configuration.konghq.com_kongconsumers.yaml | 3 +-- .../bases/configuration.konghq.com_kongpluginbindings.yaml | 3 +-- config/crd/bases/configuration.konghq.com_kongservices.yaml | 3 +-- config/crd/bases/configuration.konghq.com_kongupstreams.yaml | 3 +-- config/crd/bases/configuration.konghq.com_kongvaults.yaml | 3 +-- docs/api-reference.md | 2 +- 10 files changed, 11 insertions(+), 17 deletions(-) diff --git a/api/configuration/v1/kongconsumer_types.go b/api/configuration/v1/kongconsumer_types.go index 73794bf..3f238c9 100644 --- a/api/configuration/v1/kongconsumer_types.go +++ b/api/configuration/v1/kongconsumer_types.go @@ -34,7 +34,6 @@ import ( // +kubebuilder:printcolumn:name="Programmed",type=string,JSONPath=`.status.conditions[?(@.type=="Programmed")].status` // +kubebuilder:validation:XValidation:rule="has(self.username) || has(self.custom_id)", message="Need to provide either username or custom_id" // +kubebuilder:validation:XValidation:rule="!has(oldSelf.spec.controlPlaneRef) || has(self.spec.controlPlaneRef)", message="controlPlaneRef is required once set" -// REVIEW: allow same namespace? // +kubebuilder:validation:XValidation:rule="!has(self.spec.controlPlaneRef.konnectNamespacedRef) ? true : !has(self.spec.controlPlaneRef.konnectNamespacedRef.__namespace__)", message="spec.controlPlaneRef cannot specify namespace for namespaced resource" // +kubebuilder:validation:XValidation:rule="(!has(self.status) || !self.status.conditions.exists(c, c.type == 'Programmed' && c.status == 'True')) ? true : oldSelf.spec.controlPlaneRef == self.spec.controlPlaneRef", message="spec.controlPlaneRef is immutable when an entity is already Programmed" diff --git a/api/configuration/v1alpha1/konnect_controlplaneref_types.go b/api/configuration/v1alpha1/konnect_controlplaneref_types.go index 8fac7f3..2e4086b 100644 --- a/api/configuration/v1alpha1/konnect_controlplaneref_types.go +++ b/api/configuration/v1alpha1/konnect_controlplaneref_types.go @@ -41,8 +41,10 @@ type KonnectNamespacedRef struct { // TODO: Implement cross namespace references: // https://github.com/Kong/kubernetes-configuration/issues/36 - // Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. + // Namespace is the namespace where the Konnect Control Plane is in. + // Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. + // // +optional Namespace string `json:"namespace,omitempty"` } diff --git a/config/crd/bases/configuration.konghq.com_kongcacertificates.yaml b/config/crd/bases/configuration.konghq.com_kongcacertificates.yaml index 64f08c2..358119c 100644 --- a/config/crd/bases/configuration.konghq.com_kongcacertificates.yaml +++ b/config/crd/bases/configuration.konghq.com_kongcacertificates.yaml @@ -69,9 +69,8 @@ spec: type: string namespace: description: |- - https://github.com/Kong/kubernetes-configuration/issues/36 - Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. + Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. type: string required: - name diff --git a/config/crd/bases/configuration.konghq.com_kongconsumergroups.yaml b/config/crd/bases/configuration.konghq.com_kongconsumergroups.yaml index df48f53..f1f697b 100644 --- a/config/crd/bases/configuration.konghq.com_kongconsumergroups.yaml +++ b/config/crd/bases/configuration.konghq.com_kongconsumergroups.yaml @@ -70,9 +70,8 @@ spec: type: string namespace: description: |- - https://github.com/Kong/kubernetes-configuration/issues/36 - Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. + Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. type: string required: - name diff --git a/config/crd/bases/configuration.konghq.com_kongconsumers.yaml b/config/crd/bases/configuration.konghq.com_kongconsumers.yaml index 65fd33e..9e98665 100644 --- a/config/crd/bases/configuration.konghq.com_kongconsumers.yaml +++ b/config/crd/bases/configuration.konghq.com_kongconsumers.yaml @@ -95,9 +95,8 @@ spec: type: string namespace: description: |- - https://github.com/Kong/kubernetes-configuration/issues/36 - Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. + Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. type: string required: - name diff --git a/config/crd/bases/configuration.konghq.com_kongpluginbindings.yaml b/config/crd/bases/configuration.konghq.com_kongpluginbindings.yaml index 703cef9..08ec523 100644 --- a/config/crd/bases/configuration.konghq.com_kongpluginbindings.yaml +++ b/config/crd/bases/configuration.konghq.com_kongpluginbindings.yaml @@ -73,9 +73,8 @@ spec: type: string namespace: description: |- - https://github.com/Kong/kubernetes-configuration/issues/36 - Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. + Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. type: string required: - name diff --git a/config/crd/bases/configuration.konghq.com_kongservices.yaml b/config/crd/bases/configuration.konghq.com_kongservices.yaml index 5abde12..39fa971 100644 --- a/config/crd/bases/configuration.konghq.com_kongservices.yaml +++ b/config/crd/bases/configuration.konghq.com_kongservices.yaml @@ -78,9 +78,8 @@ spec: type: string namespace: description: |- - https://github.com/Kong/kubernetes-configuration/issues/36 - Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. + Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. type: string required: - name diff --git a/config/crd/bases/configuration.konghq.com_kongupstreams.yaml b/config/crd/bases/configuration.konghq.com_kongupstreams.yaml index 1dda154..8e7607f 100644 --- a/config/crd/bases/configuration.konghq.com_kongupstreams.yaml +++ b/config/crd/bases/configuration.konghq.com_kongupstreams.yaml @@ -75,9 +75,8 @@ spec: type: string namespace: description: |- - https://github.com/Kong/kubernetes-configuration/issues/36 - Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. + Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. type: string required: - name diff --git a/config/crd/bases/configuration.konghq.com_kongvaults.yaml b/config/crd/bases/configuration.konghq.com_kongvaults.yaml index 5047049..ebce8df 100644 --- a/config/crd/bases/configuration.konghq.com_kongvaults.yaml +++ b/config/crd/bases/configuration.konghq.com_kongvaults.yaml @@ -98,9 +98,8 @@ spec: type: string namespace: description: |- - https://github.com/Kong/kubernetes-configuration/issues/36 - Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. + Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. type: string required: - name diff --git a/docs/api-reference.md b/docs/api-reference.md index 8ad6769..7be53d7 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -965,7 +965,7 @@ KonnectNamespacedRef is the schema for the KonnectNamespacedRef type. | Field | Description | | --- | --- | | `name` _string_ | Name is the name of the Konnect Control Plane. | -| `namespace` _string_ | TODO: Implement cross namespace references: https://github.com/Kong/kubernetes-configuration/issues/36 Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. Namespace is the namespace where the Konnect Control Plane is in. | +| `namespace` _string_ | Namespace is the namespace where the Konnect Control Plane is in. Currently only cluster scoped resources (KongVault) are allowed to set `konnectNamespacedRef.namespace`. | _Appears in:_