seedling: Add auth flags to upgrade (#1179)

This commit is contained in:
Itxaka
2023-03-24 14:00:33 +01:00
parent e576303a4c
commit 148fc21c0e

View File

@@ -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, " "))