From 148fc21c0ecafbb9f540326be4c0aa7033728575 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Fri, 24 Mar 2023 14:00:33 +0100 Subject: [PATCH] seedling: Add auth flags to upgrade (#1179) --- internal/agent/upgrade.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/agent/upgrade.go b/internal/agent/upgrade.go index 39f4564..21ff40f 100644 --- a/internal/agent/upgrade.go +++ b/internal/agent/upgrade.go @@ -41,7 +41,10 @@ func ListReleases() []string { return releases } -func Upgrade(version, image string, force, debug, strictValidations bool, dirs []string) error { +func Upgrade( + version, image string, force, debug, strictValidations bool, dirs []string, + authUser string, authPass string, authServer string, authType string, registryToken string, identityToken string, +) error { bus.Manager.Initialize() if version == "" && image == "" { @@ -104,6 +107,14 @@ func Upgrade(version, image string, force, debug, strictValidations bool, dirs [ utils.SetEnv(c.Env) args := []string{"upgrade", "--system.uri", fmt.Sprintf("docker:%s", img)} + args = append(args, + "--auth-username", authUser, + "--auth-password", authPass, + "--auth-server-address", authServer, + "--auth-type", authType, + "--auth-registry-token", registryToken, + "--auth-identity-token", identityToken, + ) if debug { fmt.Printf("Running command: 'elemental %s'", strings.Join(args, " "))