Skip to content

Commit

Permalink
Include the developer username and password to the command get secret
Browse files Browse the repository at this point in the history
Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Nov 22, 2024
1 parent 80a785b commit 3c3511d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/cmd/get/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"os"
"path/filepath"
"strings"
"text/template"

"github.com/cnoe-io/idpbuilder/api/v1alpha1"
Expand Down Expand Up @@ -206,6 +207,18 @@ func secretToTemplateData(s v1.Secret) TemplateData {
for k, v := range s.Data {
data.Data[k] = string(v)
}

// TODO: The following code should be reviewed and improved as the secret containing the developer username/password is argocd-secret
// where the password has been bcrypted and by consequence we cannot get and decode it from the secret
// This is why we are going to add it here BUT it will be displayed every time no matter if --dev-mode has been used or not
if strings.Contains(s.Name, "gitea") {
data.Data["username-developer"] = "giteAdmin"
data.Data["password-developer"] = "developer"
} else if strings.Contains(s.Name, "argocd") {
data.Data["username-developer"] = "developer"
data.Data["password-developer"] = "developer"
}

return data
}

Expand Down

0 comments on commit 3c3511d

Please sign in to comment.