From 07141ea341349735cd4cc7efb437600ea749f67d Mon Sep 17 00:00:00 2001 From: Vu Dinh Date: Wed, 2 Dec 2020 23:44:05 -0500 Subject: [PATCH] Change OperatorUpgradeable type to string and add utils func Use string as OperatorUpgradeable type instead of intermediate type ConditionType. Add utils func FindConditionType to look up Condition type. Signed-off-by: Vu Dinh --- pkg/operators/v1/operatorcondition_types.go | 2 +- pkg/operators/v1alpha1/clusterserviceversion_types.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/operators/v1/operatorcondition_types.go b/pkg/operators/v1/operatorcondition_types.go index dbfccc5ce..6c06b18a2 100644 --- a/pkg/operators/v1/operatorcondition_types.go +++ b/pkg/operators/v1/operatorcondition_types.go @@ -6,7 +6,7 @@ import ( const ( // OperatorUpgradeable indicates that the operator is upgradeable - OperatorUpgradeable ConditionType = "OperatorUpgradeable" + OperatorUpgradeable string = "OperatorUpgradeable" ) // OperatorConditionSpec allows a cluster admin to convey information about the state of an operator to OLM, potentially overriding state reported by the operator. diff --git a/pkg/operators/v1alpha1/clusterserviceversion_types.go b/pkg/operators/v1alpha1/clusterserviceversion_types.go index 0c251cd49..3bcb83586 100644 --- a/pkg/operators/v1alpha1/clusterserviceversion_types.go +++ b/pkg/operators/v1alpha1/clusterserviceversion_types.go @@ -379,6 +379,7 @@ const ( CSVReasonCannotModifyStaticOperatorGroupProvidedAPIs ConditionReason = "CannotModifyStaticOperatorGroupProvidedAPIs" CSVReasonDetectedClusterChange ConditionReason = "DetectedClusterChange" CSVReasonInvalidWebhookDescription ConditionReason = "InvalidWebhookDescription" + CSVReasonOperatorConditionNotUpgradeable ConditionReason = "OperatorConditionNotUpgradeable" ) // HasCaResources returns true if the CSV has owned APIServices or Webhooks.