From 18493eae06c6759a5c915025d06e393040b62c22 Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Wed, 29 May 2024 11:51:05 +0200 Subject: [PATCH 1/6] update api version --- api/v1alpha1/zz_generated.openapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 0597c18d..182fe924 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -5213,7 +5213,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_WebhookConfig(ref common.Refere Properties: map[string]spec.Schema{ "deploy": { SchemaProps: spec.SchemaProps{ - Description: "Defines the flag that determines whether to deploy the Webhook. If the deploy flag is disabled, the Webhook is deployed and deleted immediately after by the memberoperatorconfig controller.", + Description: "Defines the flag that determines whether to deploy the Webhook. If the deploy flag is set to False and the Webhook was deployed previously it will be deleted by the memberoperatorconfig controller.", Type: []string{"boolean"}, Format: "", }, From 870f14a6831ae6b2eb9187cb1d75a16d759e9415 Mon Sep 17 00:00:00 2001 From: Devtools Date: Wed, 26 Feb 2025 12:51:51 +0100 Subject: [PATCH 2/6] add reasons for nstemplatetier --- api/v1alpha1/nstemplatetier_types.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/v1alpha1/nstemplatetier_types.go b/api/v1alpha1/nstemplatetier_types.go index 159d33d2..b0d4d00f 100644 --- a/api/v1alpha1/nstemplatetier_types.go +++ b/api/v1alpha1/nstemplatetier_types.go @@ -4,6 +4,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +const ( + // NSTemplateTierProvisionedReason represents the reason for a successfully provisioned NSTemplateTier. + NSTemplateTierProvisionedReason = provisionedReason + + // NSTemplateTierUnableToEnsureRevisionsReason represents the reason for a successfully provisioned NSTemplateTier. + NSTemplateTierUnableToEnsureRevisionsReason = "UnableToEnsureRevisions" +) + // NSTemplateTierSpec defines the desired state of NSTemplateTier // +k8s:openapi-gen=true type NSTemplateTierSpec struct { From 273d935f8cc84b95440f3e125a2424b87fb05fd2 Mon Sep 17 00:00:00 2001 From: Devtools Date: Mon, 5 May 2025 14:16:41 +0200 Subject: [PATCH 3/6] add new ui config --- api/v1alpha1/docs/apiref.adoc | 8 ++++++++ api/v1alpha1/toolchainconfig_types.go | 12 ++++++++++++ api/v1alpha1/zz_generated.deepcopy.go | 5 +++++ api/v1alpha1/zz_generated.openapi.go | 7 +++++++ 4 files changed, 32 insertions(+) diff --git a/api/v1alpha1/docs/apiref.adoc b/api/v1alpha1/docs/apiref.adoc index 8d036e1a..231613e9 100644 --- a/api/v1alpha1/docs/apiref.adoc +++ b/api/v1alpha1/docs/apiref.adoc @@ -2124,6 +2124,14 @@ Consumed by host operator and set as env var on registration-service deployment | *`registrationServiceURL`* __string__ | RegistrationServiceURL is the URL used to a ccess the registration service + | | | *`replicas`* __integer__ | Replicas specifies the number of replicas to use for the registration service deployment + | | | *`verification`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-registrationserviceverificationconfig[$$RegistrationServiceVerificationConfig$$]__ | Keeps parameters necessary for the registration service verification config + | | +| *`uiCanaryDeploymentWeight`* __integer__ | UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI. + +This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy. + +Once we switch all our users to the new UI this will be removed. + +How this works: + +- backend returns a weight + +- old UI assigns a sticky random number for each user + +- if the user has a number within the weight returned from the backend than user get's redirect to to new UI + +- if the user has a number above the weight they keep using the current UI + | | |=== diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index 1d934b17..e515929f 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -244,6 +244,18 @@ type RegistrationServiceConfig struct { // Keeps parameters necessary for the registration service verification config // +optional Verification RegistrationServiceVerificationConfig `json:"verification,omitempty"` + + // UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI. + // This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy. + // Once we switch all our users to the new UI this will be removed. + // How this works: + // - backend returns a weight + // - old UI assigns a sticky random number for each user + // - if the user has a number within the weight returned from the backend than user get's redirect to to new UI + // - if the user has a number above the weight they keep using the current UI + // + // +optional + UICanaryDeploymentWeight *int32 `json:"uiCanaryDeploymentWeight,omitempty"` } // RegistrationServiceAnalyticsConfig contains the subset of registration service configuration parameters related to analytics diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 87b6b8f6..37a00116 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -2061,6 +2061,11 @@ func (in *RegistrationServiceConfig) DeepCopyInto(out *RegistrationServiceConfig **out = **in } in.Verification.DeepCopyInto(&out.Verification) + if in.UICanaryDeploymentWeight != nil { + in, out := &in.UICanaryDeploymentWeight, &out.UICanaryDeploymentWeight + *out = new(int32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrationServiceConfig. diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 01535db9..0d21ca9c 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -2815,6 +2815,13 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceConfig(ref c Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.RegistrationServiceVerificationConfig"), }, }, + "uiCanaryDeploymentWeight": { + SchemaProps: spec.SchemaProps{ + Description: "UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI. This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy. Once we switch all our users to the new UI this will be removed. How this works: - backend returns a weight - old UI assigns a sticky random number for each user - if the user has a number within the weight returned from the backend than user get's redirect to to new UI - if the user has a number above the weight they keep using the current UI", + Type: []string{"integer"}, + Format: "int32", + }, + }, }, }, }, From 2add993deb955df2f39fb20d853e81ec02091384 Mon Sep 17 00:00:00 2001 From: Devtools Date: Mon, 5 May 2025 14:53:44 +0200 Subject: [PATCH 4/6] switch to in --- api/v1alpha1/toolchainconfig_types.go | 2 +- api/v1alpha1/zz_generated.deepcopy.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index e515929f..344317ed 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -255,7 +255,7 @@ type RegistrationServiceConfig struct { // - if the user has a number above the weight they keep using the current UI // // +optional - UICanaryDeploymentWeight *int32 `json:"uiCanaryDeploymentWeight,omitempty"` + UICanaryDeploymentWeight *int `json:"uiCanaryDeploymentWeight,omitempty"` } // RegistrationServiceAnalyticsConfig contains the subset of registration service configuration parameters related to analytics diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 37a00116..875f4420 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -2063,7 +2063,7 @@ func (in *RegistrationServiceConfig) DeepCopyInto(out *RegistrationServiceConfig in.Verification.DeepCopyInto(&out.Verification) if in.UICanaryDeploymentWeight != nil { in, out := &in.UICanaryDeploymentWeight, &out.UICanaryDeploymentWeight - *out = new(int32) + *out = new(int) **out = **in } } From 381e1d7baa5c5d490dc2f3170cf0542296c00df6 Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Tue, 6 May 2025 12:18:32 +0200 Subject: [PATCH 5/6] Update api/v1alpha1/toolchainconfig_types.go Co-authored-by: Feny Mehta --- api/v1alpha1/toolchainconfig_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index 344317ed..085fb86d 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -251,7 +251,7 @@ type RegistrationServiceConfig struct { // How this works: // - backend returns a weight // - old UI assigns a sticky random number for each user - // - if the user has a number within the weight returned from the backend than user get's redirect to to new UI + // - if the user has a number within the weight returned from the backend than user get's redirect to new UI // - if the user has a number above the weight they keep using the current UI // // +optional From 5ce37a7c572dada3146a486db9b82c0278cf30e5 Mon Sep 17 00:00:00 2001 From: Devtools Date: Tue, 6 May 2025 12:36:51 +0200 Subject: [PATCH 6/6] update --- api/v1alpha1/docs/apiref.adoc | 6 ++++-- api/v1alpha1/toolchainconfig_types.go | 2 ++ api/v1alpha1/zz_generated.openapi.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/v1alpha1/docs/apiref.adoc b/api/v1alpha1/docs/apiref.adoc index 231613e9..f736a5d7 100644 --- a/api/v1alpha1/docs/apiref.adoc +++ b/api/v1alpha1/docs/apiref.adoc @@ -2130,8 +2130,10 @@ Once we switch all our users to the new UI this will be removed. + How this works: + - backend returns a weight + - old UI assigns a sticky random number for each user + -- if the user has a number within the weight returned from the backend than user get's redirect to to new UI + -- if the user has a number above the weight they keep using the current UI + | | +- if the user has a number within the weight returned from the backend than user get's redirect to new UI + +- if the user has a number above the weight they keep using the current UI + | | Maximum: 100 + +Minimum: 0 + + |=== diff --git a/api/v1alpha1/toolchainconfig_types.go b/api/v1alpha1/toolchainconfig_types.go index 085fb86d..137833c0 100644 --- a/api/v1alpha1/toolchainconfig_types.go +++ b/api/v1alpha1/toolchainconfig_types.go @@ -255,6 +255,8 @@ type RegistrationServiceConfig struct { // - if the user has a number above the weight they keep using the current UI // // +optional + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 UICanaryDeploymentWeight *int `json:"uiCanaryDeploymentWeight,omitempty"` } diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 0d21ca9c..5fa7f5ff 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -2817,7 +2817,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_RegistrationServiceConfig(ref c }, "uiCanaryDeploymentWeight": { SchemaProps: spec.SchemaProps{ - Description: "UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI. This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy. Once we switch all our users to the new UI this will be removed. How this works: - backend returns a weight - old UI assigns a sticky random number for each user - if the user has a number within the weight returned from the backend than user get's redirect to to new UI - if the user has a number above the weight they keep using the current UI", + Description: "UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI. This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy. Once we switch all our users to the new UI this will be removed. How this works: - backend returns a weight - old UI assigns a sticky random number for each user - if the user has a number within the weight returned from the backend than user get's redirect to new UI - if the user has a number above the weight they keep using the current UI", Type: []string{"integer"}, Format: "int32", },