Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ require (
github.com/argoproj/gitops-engine v0.7.0
github.com/aws/aws-sdk-go v1.42.50
github.com/caarlos0/env v3.5.0+incompatible
github.com/caarlos0/env/v6 v6.7.2
github.com/casbin/casbin v1.9.1
github.com/casbin/xorm-adapter v1.0.1-0.20190716004226-a317737a1007
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/davecgh/go-spew v1.1.1
github.com/devtron-labs/authenticator v0.4.31-0.20220713060637-8fe220e198c5
github.com/devtron-labs/authenticator v0.4.31-0.20220912063754-6ed49155106e
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-pg/pg v6.15.1+incompatible
Expand Down Expand Up @@ -93,7 +94,6 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bombsimon/logrusr/v2 v2.0.1 // indirect
github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 // indirect
github.com/caarlos0/env/v6 v6.7.2 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chai2010/gettext-go v0.0.0-20170215093142-bf70f2a70fb1 // indirect
github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ github.com/devtron-labs/authenticator v0.4.30 h1:cdgkv5hllVwFIn38lcV3LVxtA4Rdiuj
github.com/devtron-labs/authenticator v0.4.30/go.mod h1:pywHrsXFWAkkuST8wR1uABqVvIyI/4eUpw/+EMnqJJM=
github.com/devtron-labs/authenticator v0.4.31-0.20220713060637-8fe220e198c5 h1:pC0JJUu4aMlYCrIlSusQv2apO5J9Vb4YzRPSVFt6ZcE=
github.com/devtron-labs/authenticator v0.4.31-0.20220713060637-8fe220e198c5/go.mod h1:pywHrsXFWAkkuST8wR1uABqVvIyI/4eUpw/+EMnqJJM=
github.com/devtron-labs/authenticator v0.4.31-0.20220909102118-636330106c44 h1:ArnamZ6d/xSsu0iqtNfVC9Y+kfUA1LJWzxzAS/s4EQQ=
github.com/devtron-labs/authenticator v0.4.31-0.20220909102118-636330106c44/go.mod h1:ozNfT8WcruiSgnUbyp48WVfc41++W6xYXhKFp67lNTU=
github.com/devtron-labs/authenticator v0.4.31-0.20220909183148-60c18c49e5df h1:iGQ2txGYjrbamftMHOxCmIbNxLnXs3dkgKa7M+E/o+0=
github.com/devtron-labs/authenticator v0.4.31-0.20220909183148-60c18c49e5df/go.mod h1:ozNfT8WcruiSgnUbyp48WVfc41++W6xYXhKFp67lNTU=
github.com/devtron-labs/authenticator v0.4.31-0.20220910091604-5219e2c89b5e h1:zvESF8q58qGGWmIfIrGLFQ5SWiDHQK442CYM+ka7xgU=
github.com/devtron-labs/authenticator v0.4.31-0.20220910091604-5219e2c89b5e/go.mod h1:ozNfT8WcruiSgnUbyp48WVfc41++W6xYXhKFp67lNTU=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
Expand Down
18 changes: 9 additions & 9 deletions pkg/sso/SSOLoginService.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ package sso
import (
"encoding/json"
"fmt"
"github.com/devtron-labs/authenticator/client"
"github.com/devtron-labs/devtron/api/bean"
"github.com/devtron-labs/devtron/internal/util"
"github.com/devtron-labs/devtron/util/argo"
"github.com/ghodss/yaml"
"github.com/go-pg/pg"
"go.uber.org/zap"
Expand Down Expand Up @@ -187,7 +187,7 @@ func (impl SSOLoginServiceImpl) updateArgocdConfigMapForDexConfig(request *bean.
retryCount := 0
for !updateSuccess && retryCount < 3 {
retryCount = retryCount + 1
cm, err := impl.K8sUtil.GetConfigMap(client.ArgocdNamespaceName, client.ArgoCDConfigMapName, k8sClient)
secret, err := impl.K8sUtil.GetSecret(argo.DEVTRONCD_NAMESPACE, argo.DEVTRON_SECRET, k8sClient)
if err != nil {
impl.logger.Errorw("exception in fetching configmap", "error", err)
return flag, err
Expand All @@ -197,14 +197,14 @@ func (impl SSOLoginServiceImpl) updateArgocdConfigMapForDexConfig(request *bean.
impl.logger.Errorw("exception in update configmap sso config", "error", err)
return flag, err
}
data := cm.Data
if cm.Data == nil {
data = make(map[string]string)
data := secret.Data
if secret.Data == nil {
data = make(map[string][]byte)
}
data["dex.config"] = updatedData["dex.config"]
data["url"] = request.Url
cm.Data = data
_, err = impl.K8sUtil.UpdateConfigMap(client.ArgocdNamespaceName, cm, k8sClient)
data["dex.config"] = []byte(updatedData["dex.config"])
data["url"] = []byte(request.Url)
secret.Data = data
_, err = impl.K8sUtil.UpdateSecret(argo.DEVTRONCD_NAMESPACE, secret, k8sClient)
if err != nil {
impl.logger.Warnw("config map update failed for sso config", "err", err)
continue
Expand Down
2 changes: 2 additions & 0 deletions util/argo/ArgoUserService.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
DEVTRON_ARGOCD_USERNAME_KEY = "DEVTRON_ACD_USER_NAME"
DEVTRON_ARGOCD_USER_PASSWORD_KEY = "DEVTRON_ACD_USER_PASSWORD"
DEVTRON_ARGOCD_TOKEN_KEY = "DEVTRON_ACD_TOKEN"
DEVTRON_CM = "devtron-cm"
DEVTRON_SECRET = "devtron-secret"
)

type ArgoUserService interface {
Expand Down
6 changes: 5 additions & 1 deletion util/session/Manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package session

import (
"context"
"fmt"
"github.com/argoproj/argo-cd/v2/util/settings"
"github.com/devtron-labs/devtron/client/argocdServer"
"k8s.io/client-go/kubernetes"
Expand All @@ -29,7 +30,10 @@ import (
func CDSettingsManager(settings *settings.SettingsManager) (*settings.ArgoCDSettings, error) {
at, err := settings.GetSettings()
if err != nil {
return nil, err
//return nil, err
//skip this error for no git-ops , as it will be set auto when acd configured for acd case
fmt.Printf("skiping this error, error on getting acd setting, err=%s", err.Error())

}
return at, nil
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading