From 1cd98b5d5519e889987bc9aeb379050ef9e4735e Mon Sep 17 00:00:00 2001 From: Rajiv Senthilnathan Date: Wed, 25 Feb 2026 12:11:51 -0500 Subject: [PATCH 1/2] Remove unused DurationBeforeChangeTierRequestDeletion config --- .../toolchain.dev.openshift.com_toolchainconfigs.yaml | 4 ---- controllers/toolchainconfig/configuration.go | 9 --------- controllers/toolchainconfig/configuration_test.go | 9 --------- go.mod | 4 ++++ go.sum | 8 ++++---- 5 files changed, 8 insertions(+), 26 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index 9d4e9ee53..cf2e6d6ed 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -439,10 +439,6 @@ spec: description: DefaultUserTier specifies the default tier to assign for new users type: string - durationBeforeChangeTierRequestDeletion: - description: DurationBeforeChangeTierRequestDeletion specifies - the duration before a ChangeTierRequest resource is deleted - type: string featureToggles: description: FeatureToggles specifies the list of feature toggles/flags diff --git a/controllers/toolchainconfig/configuration.go b/controllers/toolchainconfig/configuration.go index 549a0220b..3daf4bf93 100644 --- a/controllers/toolchainconfig/configuration.go +++ b/controllers/toolchainconfig/configuration.go @@ -313,15 +313,6 @@ func (d TiersConfig) DefaultSpaceTier() string { return commonconfig.GetString(d.tiers.DefaultSpaceTier, "base") } -func (d TiersConfig) DurationBeforeChangeTierRequestDeletion() time.Duration { - v := commonconfig.GetString(d.tiers.DurationBeforeChangeTierRequestDeletion, "24h") - duration, err := time.ParseDuration(v) - if err != nil { - duration = 24 * time.Hour - } - return duration -} - func (d TiersConfig) FeatureToggles() []FeatureToggle { toggles := make([]FeatureToggle, 0, len(d.tiers.FeatureToggles)) for _, t := range d.tiers.FeatureToggles { diff --git a/controllers/toolchainconfig/configuration_test.go b/controllers/toolchainconfig/configuration_test.go index 5542dbc83..896798413 100644 --- a/controllers/toolchainconfig/configuration_test.go +++ b/controllers/toolchainconfig/configuration_test.go @@ -443,28 +443,19 @@ func TestTiers(t *testing.T) { assert.Equal(t, "deactivate30", toolchainCfg.Tiers().DefaultUserTier()) assert.Equal(t, "base", toolchainCfg.Tiers().DefaultSpaceTier()) - assert.Equal(t, 24*time.Hour, toolchainCfg.Tiers().DurationBeforeChangeTierRequestDeletion()) assert.Empty(t, toolchainCfg.Tiers().FeatureToggles()) }) - t.Run("invalid", func(t *testing.T) { - cfg := commonconfig.NewToolchainConfigObjWithReset(t, testconfig.Tiers().DurationBeforeChangeTierRequestDeletion("rapid")) - toolchainCfg := newToolchainConfig(cfg, map[string]map[string]string{}) - - assert.Equal(t, 24*time.Hour, toolchainCfg.Tiers().DurationBeforeChangeTierRequestDeletion()) - }) t.Run("non-default", func(t *testing.T) { weight10 := uint(10) cfg := commonconfig.NewToolchainConfigObjWithReset(t, testconfig.Tiers(). DefaultUserTier("deactivate90"). DefaultSpaceTier("ourtier"). - DurationBeforeChangeTierRequestDeletion("48h"). FeatureToggle("feature-1", nil). // With default weight FeatureToggle("feature-2", &weight10)) toolchainCfg := newToolchainConfig(cfg, map[string]map[string]string{}) assert.Equal(t, "deactivate90", toolchainCfg.Tiers().DefaultUserTier()) assert.Equal(t, "ourtier", toolchainCfg.Tiers().DefaultSpaceTier()) - assert.Equal(t, 48*time.Hour, toolchainCfg.Tiers().DurationBeforeChangeTierRequestDeletion()) assert.Len(t, toolchainCfg.Tiers().FeatureToggles(), 2) assert.Equal(t, "feature-1", toolchainCfg.Tiers().FeatureToggles()[0].Name()) assert.Equal(t, uint(100), toolchainCfg.Tiers().FeatureToggles()[0].Weight()) // default weight diff --git a/go.mod b/go.mod index 10677ab74..acad00d27 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,9 @@ module github.com/codeready-toolchain/host-operator +replace github.com/codeready-toolchain/api => github.com/rajivnathan/api v0.0.0-20260225164436-80c782ea57de + +replace github.com/codeready-toolchain/toolchain-common => github.com/rajivnathan/toolchain-common v0.0.0-20260225170920-5096cffa010b + require ( cloud.google.com/go/recaptchaenterprise/v2 v2.13.0 github.com/codeready-toolchain/api v0.0.0-20260108115150-4c6695ed18de diff --git a/go.sum b/go.sum index 3601e3497..f3cd650de 100644 --- a/go.sum +++ b/go.sum @@ -35,10 +35,6 @@ github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtM github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/codeready-toolchain/api v0.0.0-20260108115150-4c6695ed18de h1:rc39ZRUk2AyADzH+bt5On7V7qJz6syUrI4qNyCSXY3o= -github.com/codeready-toolchain/api v0.0.0-20260108115150-4c6695ed18de/go.mod h1:O/HyAcz6fynt3LXr8wTGaIXt+0v6BpkiJvDxNQDCqyA= -github.com/codeready-toolchain/toolchain-common v0.0.0-20260108130331-10ca562525fe h1:TOSa/kVCYoLXKX7B/uBLnJsi4Pnaf6nD9K0flumVr6o= -github.com/codeready-toolchain/toolchain-common v0.0.0-20260108130331-10ca562525fe/go.mod h1:rjveL3/1VJeHnDwhvWCEF5jCFRC4xAz93DQp1rKPn3Y= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -249,6 +245,10 @@ github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rajivnathan/api v0.0.0-20260225164436-80c782ea57de h1:jDu6zVmHfCVKnmKTCmMtvGyACGvE94R09CLHrTVIRA4= +github.com/rajivnathan/api v0.0.0-20260225164436-80c782ea57de/go.mod h1:PMg6kNHuCGNlu3MOdrCisqGkBpvzB0qS1+E6nrXxPAc= +github.com/rajivnathan/toolchain-common v0.0.0-20260225170920-5096cffa010b h1:7PjgTyxd+LeOaeJD3pu5IanpoQEKc8olA3e2pyRpVR8= +github.com/rajivnathan/toolchain-common v0.0.0-20260225170920-5096cffa010b/go.mod h1:fP177rBNtGecNLO7JXFhz6UQVaYMnmofE4HjvTFCtBQ= github.com/redhat-cop/operator-utils v1.3.8 h1:xhoMBg2snSzNdcxT53lSBr7PRXxrzP1cDi51NPBLaT4= github.com/redhat-cop/operator-utils v1.3.8/go.mod h1:s4R0YY8lVlHkC78GLV20PPuZmywjSbTwZKCHwWUQ3P8= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= From 98834d69b7e0009ba568f9f8ba7966c8cfa4bf67 Mon Sep 17 00:00:00 2001 From: Rajiv Senthilnathan Date: Wed, 25 Feb 2026 23:10:59 -0500 Subject: [PATCH 2/2] Update deps --- go.mod | 8 ++------ go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index f32f698df..7226a9292 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,9 @@ module github.com/codeready-toolchain/host-operator -replace github.com/codeready-toolchain/api => github.com/rajivnathan/api v0.0.0-20260225164436-80c782ea57de - -replace github.com/codeready-toolchain/toolchain-common => github.com/rajivnathan/toolchain-common v0.0.0-20260225170920-5096cffa010b - require ( cloud.google.com/go/recaptchaenterprise/v2 v2.13.0 - github.com/codeready-toolchain/api v0.0.0-20260108115150-4c6695ed18de - github.com/codeready-toolchain/toolchain-common v0.0.0-20260225205316-85e4bef507f2 + github.com/codeready-toolchain/api v0.0.0-20260226033043-912fcbd23dc7 + github.com/codeready-toolchain/toolchain-common v0.0.0-20260226040150-d7d5d0163ff7 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/go-logr/logr v1.4.2 github.com/gofrs/uuid v4.4.0+incompatible diff --git a/go.sum b/go.sum index 33952848c..ce4dacbb8 100644 --- a/go.sum +++ b/go.sum @@ -35,6 +35,10 @@ github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtM github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8= github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/codeready-toolchain/api v0.0.0-20260226033043-912fcbd23dc7 h1:1YCopXDF7WSjhM7sQAFoNeJvoIVPCHDY35jNVqc0Xh4= +github.com/codeready-toolchain/api v0.0.0-20260226033043-912fcbd23dc7/go.mod h1:PMg6kNHuCGNlu3MOdrCisqGkBpvzB0qS1+E6nrXxPAc= +github.com/codeready-toolchain/toolchain-common v0.0.0-20260226040150-d7d5d0163ff7 h1:NLTKW/An6PfcgqUyjeloAl0cmR0/lJopURsMMY/VZcs= +github.com/codeready-toolchain/toolchain-common v0.0.0-20260226040150-d7d5d0163ff7/go.mod h1:TtwbNKTtHxDEaO2fOhJbYM4S1FykJHOf/4/nCw7hFwo= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -245,10 +249,6 @@ github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rajivnathan/api v0.0.0-20260225164436-80c782ea57de h1:jDu6zVmHfCVKnmKTCmMtvGyACGvE94R09CLHrTVIRA4= -github.com/rajivnathan/api v0.0.0-20260225164436-80c782ea57de/go.mod h1:PMg6kNHuCGNlu3MOdrCisqGkBpvzB0qS1+E6nrXxPAc= -github.com/rajivnathan/toolchain-common v0.0.0-20260225170920-5096cffa010b h1:7PjgTyxd+LeOaeJD3pu5IanpoQEKc8olA3e2pyRpVR8= -github.com/rajivnathan/toolchain-common v0.0.0-20260225170920-5096cffa010b/go.mod h1:fP177rBNtGecNLO7JXFhz6UQVaYMnmofE4HjvTFCtBQ= github.com/redhat-cop/operator-utils v1.3.8 h1:xhoMBg2snSzNdcxT53lSBr7PRXxrzP1cDi51NPBLaT4= github.com/redhat-cop/operator-utils v1.3.8/go.mod h1:s4R0YY8lVlHkC78GLV20PPuZmywjSbTwZKCHwWUQ3P8= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=