From 6afbebaa19f8fab2fb79d380e9e9251e62bede97 Mon Sep 17 00:00:00 2001 From: Jakub Warczarek Date: Tue, 9 Jul 2024 17:54:34 +0200 Subject: [PATCH] CR suggestions --- ...on.go => kongplugin_installation_types.go} | 38 +++++++++---------- ...or.konghq.com_kongplugininstallations.yaml | 4 +- 2 files changed, 19 insertions(+), 23 deletions(-) rename api/v1alpha1/{kongplugin_installation.go => kongplugin_installation_types.go} (77%) diff --git a/api/v1alpha1/kongplugin_installation.go b/api/v1alpha1/kongplugin_installation_types.go similarity index 77% rename from api/v1alpha1/kongplugin_installation.go rename to api/v1alpha1/kongplugin_installation_types.go index 3c4d6a5df..7bc0bd626 100644 --- a/api/v1alpha1/kongplugin_installation.go +++ b/api/v1alpha1/kongplugin_installation_types.go @@ -31,7 +31,7 @@ func init() { //+kubebuilder:subresource:status //+kubebuilder:resource:shortName=kpi,categories=kong;all //+kubebuilder:subresource:status -//+kubebuilder:printcolumn:name="Programmed",type=string,JSONPath=`.status.conditions[?(@.type=="Programmed")].status` +//+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` // KongPluginInstallation allows to use a custom Kong Plugin distributed as a container image available in a registry. // Such plugin can be associated with GatewayConfiguration or DataPlane to be available for particular Kong Gateway @@ -90,7 +90,7 @@ type KongPluginInstallationConditionReason string const ( // This condition indicates whether the controller has fetched the plugin image - // and made it available for use as a specific Custom Kong Plugin. + // and made it available for use as a specific Custom Kong Plugin. // // It is a positive-polarity summary condition, and so should always be // present on the resource with ObservedGeneration set. @@ -99,31 +99,27 @@ const ( // status before it has all the information it needs to be able to determine // if the condition is true. // - // Possible reasons for this condition to be True are: + // Possible reasons for this condition to be "True" are: // - // * "Programmed" + // * "Ready" // - // Possible reasons for this condition to be False are: + // Possible reasons for this condition to be "False" are: // - // * "Invalid" - // * "Fetching" + // * "Failed" + // * "Pending" // - // Possible reasons for this condition to be Unknown are: + // Possible reasons for this condition to be "Unknown" are: // - // * "Fetching". + // * "Pending". // + KongPluginInstallationConditionStatusAccepted KongPluginInstallationConditionType = "Ready" - // Controllers should prefer to use the values of KongPluginInstallationConditionReason - // for the corresponding Reason, where appropriate. - KongPluginInstallationConditionStatusAccepted KongPluginInstallationConditionType = "Accepted" + // KongPluginInstallationReasonFailedParameters is used with the "Ready" condition when + // the KongPluginInstallation can't be configured e.g. image can't be fetched. More details + // can be obtained from the condition's message. + KongPluginInstallationReasonFailedParameters KongPluginInstallationConditionReason = "Failed" - // This reason is used with the "Accepted" condition when the KongPluginInstallation - // was not accepted because image can't be fetched, more details can be obtained from the - // condition's message. - KongPluginInstallationReasonInvalidParameters KongPluginInstallationConditionReason = "Invalid" - - // This reason is used with the "Accepted" condition when the - // requested controller has started processing the KongPluginInstallation, - // but it haven't yet finished. - KongPluginInstallationReasonPending KongPluginInstallationConditionReason = "Fetching" + // KongPluginInstallationReasonPending is used with the "Accepted" condition when the requested + // controller has started processing the KongPluginInstallation, but it hasn't yet finished. + KongPluginInstallationReasonPending KongPluginInstallationConditionReason = "Pending" ) diff --git a/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml b/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml index 058dad253..6e50a907f 100644 --- a/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml +++ b/config/crd/bases/gateway-operator.konghq.com_kongplugininstallations.yaml @@ -20,8 +20,8 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="Programmed")].status - name: Programmed + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready type: string name: v1alpha1 schema: