Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Travis Raines <[email protected]>
  • Loading branch information
programmer04 and rainest committed Jul 15, 2024
1 parent 932716f commit a07b2de
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
21 changes: 11 additions & 10 deletions api/v1alpha1/kongplugin_installation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:_
Expand Down

0 comments on commit a07b2de

Please sign in to comment.