Skip to content

Commit

Permalink
fix: configurable secret names for registries
Browse files Browse the repository at this point in the history
  • Loading branch information
karlderkaefer committed Jun 17, 2023
1 parent 43c3d05 commit dcf080a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ repoServer:
env:
- name: HELM_PLUGINS
value: /custom-tools/helm-plugins
# optionally if you want to login to ECR before fetching the charts
# it expects a comma separated list of secret names
- name: HELM_DEPS_SECRET_NAMES
value: helm-ecr-staging,helm-ecr-production
volumeMounts:
- mountPath: /custom-tools
name: custom-tools
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package main
import (
"flag"
"log"
"os"
"strings"
)

func main() {
chartPath := flag.String("chartPath", ".", "path to the chart")
secretNamespace := flag.String("secretNamespace", "argocd", "namespace where the secret is located")
secretNames := flag.String("registries", "", "comma separated list of registries to update")
secretNames := flag.String("registries", os.Getenv("HELM_DEPS_SECRET_NAMES"), "comma separated list of registries to update")
ecrLoginEnabled := flag.Bool("ecr", true, "enable ecr login")
flag.Parse()

if ecrLoginEnabled != nil && *ecrLoginEnabled && *secretNames != "" {
registryMap := make(map[string]*RegistryInfo)
for _, registry := range strings.Split(*secretNames, ",") {
Expand Down

0 comments on commit dcf080a

Please sign in to comment.