Skip to content

Commit

Permalink
remove webConsolePlugin from ToolchainClusterConfig
Browse files Browse the repository at this point in the history
Pendo has been decommisioned, we don't need this plugin anymore

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon committed Jul 25, 2024
1 parent 2f6e6a3 commit 056fcf9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 85 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ require (
sigs.k8s.io/controller-runtime v0.13.0
)

replace github.com/codeready-toolchain/api => github.com/xcoulon/api v0.0.0-20240725145329-0fc7541fe19e

require (
github.com/ghodss/yaml v1.0.0
github.com/google/go-cmp v0.5.9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH
github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo=
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
github.com/codeready-toolchain/api v0.0.0-20240717145630-bb67a632867a h1:La7GOCysmkU+4vnN8lDzXFJwJiA1LWZ9YkX/yQXYnpw=
github.com/codeready-toolchain/api v0.0.0-20240717145630-bb67a632867a/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down Expand Up @@ -582,6 +580,8 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/xcoulon/api v0.0.0-20240725145329-0fc7541fe19e h1:6rYzVUcLeuVHmFjd7BU/Oe1SMsPrwdQgak2EYMz+oxM=
github.com/xcoulon/api v0.0.0-20240725145329-0fc7541fe19e/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
Expand Down
20 changes: 0 additions & 20 deletions pkg/configuration/memberoperatorconfig/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ func (c *Configuration) Webhook() WebhookConfig {
}
}

func (c *Configuration) WebConsolePlugin() WebConsolePluginConfig {
return WebConsolePluginConfig{c.cfg.WebConsolePlugin}
}

type AuthConfig struct {
auth toolchainv1alpha1.AuthConfig
}
Expand Down Expand Up @@ -252,19 +248,3 @@ func (a WebhookConfig) VMSSHKey() string {
vmAccessKey := commonconfig.GetString(a.w.Secret.VirtualMachineAccessKey, "")
return a.webhookSecret(vmAccessKey)
}

type WebConsolePluginConfig struct {
w toolchainv1alpha1.WebConsolePlugin
}

func (a WebConsolePluginConfig) Deploy() bool {
return commonconfig.GetBool(a.w.Deploy, false)
}

func (a WebConsolePluginConfig) PendoKey() string {
return commonconfig.GetString(a.w.PendoKey, "")
}

func (a WebConsolePluginConfig) PendoHost() string {
return commonconfig.GetString(a.w.PendoHost, "cdn.pendo.io")
}
27 changes: 0 additions & 27 deletions pkg/configuration/memberoperatorconfig/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,30 +273,3 @@ func TestWebhook(t *testing.T) {
assert.Equal(t, "ssh-rsa abc-123", memberOperatorCfg.Webhook().VMSSHKey())
})
}

func TestWebConsolePlugin(t *testing.T) {
t.Run("default", func(t *testing.T) {
cfg := commonconfig.NewMemberOperatorConfigWithReset(t)
memberOperatorCfg := Configuration{cfg: &cfg.Spec}

assert.False(t, memberOperatorCfg.WebConsolePlugin().Deploy())
})
t.Run("non-default", func(t *testing.T) {
cfg := commonconfig.NewMemberOperatorConfigWithReset(t, testconfig.WebConsolePlugin().Deploy(true))
memberOperatorCfg := Configuration{cfg: &cfg.Spec}

assert.True(t, memberOperatorCfg.WebConsolePlugin().Deploy())
})
t.Run("with PendoKey set", func(t *testing.T) {
cfg := commonconfig.NewMemberOperatorConfigWithReset(t, testconfig.WebConsolePlugin().PendoKey("XXXX"))
memberOperatorCfg := Configuration{cfg: &cfg.Spec}

assert.Equal(t, "XXXX", memberOperatorCfg.WebConsolePlugin().PendoKey())
})
t.Run("with PendoHost set", func(t *testing.T) {
cfg := commonconfig.NewMemberOperatorConfigWithReset(t, testconfig.WebConsolePlugin().PendoHost("abc.pendo.io"))
memberOperatorCfg := Configuration{cfg: &cfg.Spec}

assert.Equal(t, "abc.pendo.io", memberOperatorCfg.WebConsolePlugin().PendoHost())
})
}
36 changes: 0 additions & 36 deletions pkg/test/config/memberoperatorconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,42 +277,6 @@ func (o WebhookOption) VMSSHKey(value string) WebhookOption {
return o
}

type WebConsolePluginOption struct {
*MemberOperatorConfigOptionImpl
}

func WebConsolePlugin() *WebConsolePluginOption {
o := &WebConsolePluginOption{
&MemberOperatorConfigOptionImpl{},
}
o.addFunction(func(config *toolchainv1alpha1.MemberOperatorConfig) {
config.Spec.WebConsolePlugin = toolchainv1alpha1.WebConsolePlugin{}
})

return o
}

func (o WebConsolePluginOption) Deploy(value bool) WebConsolePluginOption {
o.addFunction(func(config *toolchainv1alpha1.MemberOperatorConfig) {
config.Spec.WebConsolePlugin.Deploy = &value
})
return o
}

func (o WebConsolePluginOption) PendoKey(value string) WebConsolePluginOption {
o.addFunction(func(config *toolchainv1alpha1.MemberOperatorConfig) {
config.Spec.WebConsolePlugin.PendoKey = &value
})
return o
}

func (o WebConsolePluginOption) PendoHost(value string) WebConsolePluginOption {
o.addFunction(func(config *toolchainv1alpha1.MemberOperatorConfig) {
config.Spec.WebConsolePlugin.PendoHost = &value
})
return o
}

func NewMemberOperatorConfigObj(options ...MemberOperatorConfigOption) *toolchainv1alpha1.MemberOperatorConfig {
memberOperatorConfig := &toolchainv1alpha1.MemberOperatorConfig{
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit 056fcf9

Please sign in to comment.