refactor: move values to global scope

This commit is contained in:
Kevin Franklin Kim 2024-10-27 13:32:41 +01:00
parent d16e6e442f
commit e43d200045
No known key found for this signature in database
2 changed files with 6 additions and 7 deletions

View File

@ -3,7 +3,6 @@ package config
import (
"bytes"
"context"
"fmt"
"os"
"path"
"sort"
@ -112,8 +111,8 @@ func (u *Unit) Template(ctx context.Context, name, squadron, unit, namespace str
Args("--dependency-update").
Args("--namespace", namespace).
Args("--debug").
Args("--set", fmt.Sprintf("squadron=%s", squadron)).
Args("--set", fmt.Sprintf("unit=%s", unit)).
Args("--set", "global.foomo.squadron.name="+squadron).
Args("--set", "global.foomo.squadron.unit="+unit).
Args(u.PostRendererArgs()...).
Args("--values", "-").
Args(helmArgs...)

View File

@ -411,8 +411,8 @@ func (sq *Squadron) Diff(ctx context.Context, helmArgs []string, parallel int) e
cmd := exec.CommandContext(ctx, "helm", "upgrade", name,
"--install",
"--namespace", namespace,
"--set", fmt.Sprintf("squadron=%s", key),
"--set", fmt.Sprintf("unit=%s", k),
"--set", "global.foomo.squadron.name="+key,
"--set", "global.foomo.squadron.unit="+k,
"--hide-notes",
"--values", "-",
"--dry-run",
@ -687,8 +687,8 @@ func (sq *Squadron) Up(ctx context.Context, helmArgs []string, username, version
Stdin(bytes.NewReader(valueBytes)).
Stdout(os.Stdout).
Args("upgrade", name, "--install").
Args("--set", fmt.Sprintf("squadron=%s", key)).
Args("--set", fmt.Sprintf("unit=%s", k)).
Args("--set", "global.foomo.squadron.name="+key).
Args("--set", "global.foomo.squadron.unit="+k).
Args("--description", string(description)).
Args("--namespace", namespace).
Args("--dependency-update").