From a07b2de7f63b0879500b8d99af8e650fd827d225 Mon Sep 17 00:00:00 2001 From: Jakub Warczarek Date: Wed, 10 Jul 2024 10:45:58 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Travis Raines <571832+rainest@users.noreply.github.com> --- api/v1alpha1/kongplugin_installation_types.go | 21 ++++++++++--------- ...or.konghq.com_kongplugininstallations.yaml | 13 ++++++------ docs/api-reference.md | 6 +++--- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/api/v1alpha1/kongplugin_installation_types.go b/api/v1alpha1/kongplugin_installation_types.go index 3ca16f8a5..cd792fd1b 100644 --- a/api/v1alpha1/kongplugin_installation_types.go +++ b/api/v1alpha1/kongplugin_installation_types.go @@ -53,17 +53,17 @@ type KongPluginInstallationList struct { Items []KongPluginInstallation `json:"items"` } -// KongPluginInstallationSpec defines the desired state of KongPluginInstallation. +// KongPluginInstallationSpec provides the information necessary to retrieve and install a Kong custom plugin. type KongPluginInstallationSpec struct { - // The image is an OCI image URL for a packaged Custom Kong Plugin. + // The image is an OCI image URL for a packaged custom Kong plugin. // //+kubebuilder:validation:Required Image string `json:"image"` - // SecretRef allows referring specific Kubernetes Secret to use for OCI registry authentication for pulling an image with Custom Kong Plugin. - // The Secret format should follow https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry. - // When the field is omitted it is assumed that the image is public and can be fetched without providing credentials. + // SecretRef is a reference to a Kubernetes Secret containing credentials necessary to pull the OCI image + // in Image. It must follow the format in https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry. + // It is optional. If the image is public, omit this field. // //+optional SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` @@ -79,13 +79,14 @@ type KongPluginInstallationStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } -// KongPluginInstallationConditionType is the type for status conditions on -// KongPluginInstallation resources. This type should be used with the -// KongPluginInstallationStatus.Conditions field. +// The following are KongPluginInstallation specific types for +// https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#condition-v1-meta fields + +// KongPluginInstallationConditionType is the type for Conditions in a KongPluginInstallation's +// Status.Conditions array. type KongPluginInstallationConditionType string -// KongPluginInstallationConditionReason defines the set of reasons that explain why -// a particular KongPluginInstallation condition type has been raised. +// KongPluginInstallationConditionReason is a reason for the KongPluginInstallation condition's last transition. type KongPluginInstallationConditionReason string const ( diff --git a/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml b/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml index 15c0868e3..211286417 100644 --- a/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml +++ b/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml @@ -49,17 +49,18 @@ spec: metadata: type: object spec: - description: KongPluginInstallationSpec defines the desired state of KongPluginInstallation. + description: KongPluginInstallationSpec provides the information necessary + to retrieve and install a Kong custom plugin. properties: image: - description: The image is an OCI image URL for a packaged Custom Kong - Plugin. + description: The image is an OCI image URL for a packaged custom Kong + plugin. type: string secretRef: description: |- - SecretRef allows referring specific Kubernetes Secret to use for OCI registry authentication for pulling an image with Custom Kong Plugin. - The Secret format should follow https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry. - When the field is omitted it is assumed that the image is public and can be fetched without providing credentials. + SecretRef is a reference to a Kubernetes Secret containing credentials necessary to pull the OCI image + in Image. It must follow the format in https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry. + It is optional. If the image is public, omit this field. properties: name: description: name is unique within a namespace to reference a diff --git a/docs/api-reference.md b/docs/api-reference.md index 1258bcbd5..099e743c1 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -315,14 +315,14 @@ _Appears in:_ #### KongPluginInstallationSpec -KongPluginInstallationSpec defines the desired state of KongPluginInstallation. +KongPluginInstallationSpec provides the information necessary to retrieve and install a Kong custom plugin. | Field | Description | | --- | --- | -| `image` _string_ | The image is an OCI image URL for a packaged Custom Kong Plugin. | -| `secretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#secretreference-v1-core)_ | SecretRef allows referring specific Kubernetes Secret to use for OCI registry authentication for pulling an image with Custom Kong Plugin. The Secret format should follow https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry. When the field is omitted it is assumed that the image is public and can be fetched without providing credentials. | +| `image` _string_ | The image is an OCI image URL for a packaged custom Kong plugin. | +| `secretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#secretreference-v1-core)_ | SecretRef is a reference to a Kubernetes Secret containing credentials necessary to pull the OCI image in Image. It must follow the format in https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry. It is optional. If the image is public, omit this field. | _Appears in:_