Skip to content

Commit 6f9302e

Browse files
Shivam-nagar23Ash-exp
authored andcommitted
dex-config namespace configurable (#4499)
1 parent 2fdea90 commit 6f9302e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/auth/sso/SSOLoginService.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727

2828
"github.com/devtron-labs/devtron/api/bean"
2929
util2 "github.com/devtron-labs/devtron/util"
30-
"github.com/devtron-labs/devtron/util/argo"
3130
"github.com/go-pg/pg"
3231
"go.uber.org/zap"
3332
"sigs.k8s.io/yaml"
@@ -233,7 +232,7 @@ func (impl SSOLoginServiceImpl) updateDexConfig(request *bean.SSOLoginDto) (bool
233232
retryCount := 0
234233
for !updateSuccess && retryCount < 3 {
235234
retryCount = retryCount + 1
236-
secret, err := impl.K8sUtil.GetSecret(argo.DEVTRONCD_NAMESPACE, impl.devtronSecretConfig.DevtronSecretName, k8sClient)
235+
secret, err := impl.K8sUtil.GetSecret(impl.devtronSecretConfig.DevtronDexSecretNamespace, impl.devtronSecretConfig.DevtronSecretName, k8sClient)
237236
if err != nil {
238237
impl.logger.Errorw("exception in fetching configmap", "error", err)
239238
return flag, err
@@ -250,7 +249,7 @@ func (impl SSOLoginServiceImpl) updateDexConfig(request *bean.SSOLoginDto) (bool
250249
data["dex.config"] = []byte(updatedData["dex.config"])
251250
data["url"] = []byte(request.Url)
252251
secret.Data = data
253-
_, err = impl.K8sUtil.UpdateSecret(argo.DEVTRONCD_NAMESPACE, secret, k8sClient)
252+
_, err = impl.K8sUtil.UpdateSecret(impl.devtronSecretConfig.DevtronDexSecretNamespace, secret, k8sClient)
254253
if err != nil {
255254
impl.logger.Warnw("config map update failed for sso config", "err", err)
256255
continue

util/GlobalConfig.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ func GetGlobalEnvVariables() (*GlobalEnvVariables, error) {
2020
}
2121

2222
type DevtronSecretConfig struct {
23-
DevtronSecretName string `env:"DEVTRON_SECRET_NAME" envDefault:"devtron-secret"`
23+
DevtronSecretName string `env:"DEVTRON_SECRET_NAME" envDefault:"devtron-secret"`
24+
DevtronDexSecretNamespace string `env:"DEVTRON_DEX_SECRET_NAMESPACE" envDefault:"devtroncd"`
2425
}
2526

2627
func GetDevtronSecretName() (*DevtronSecretConfig, error) {

0 commit comments

Comments
 (0)