forked from toolshed/abra
		
	WIP: Initial stab at secrets/configs/images
This commit is contained in:
		| @ -1,6 +1,7 @@ | ||||
| package app | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"errors" | ||||
| 	"strings" | ||||
|  | ||||
| @ -19,6 +20,7 @@ import ( | ||||
| 	"coopcloud.tech/abra/pkg/client" | ||||
| 	"coopcloud.tech/abra/pkg/log" | ||||
| 	"github.com/AlecAivazis/survey/v2" | ||||
| 	"github.com/docker/docker/api/types" | ||||
| 	"github.com/spf13/cobra" | ||||
| ) | ||||
|  | ||||
| @ -190,6 +192,36 @@ beforehand. See "abra app backup" for more.`), | ||||
| 		} | ||||
| 		appPkg.SetUpdateLabel(compose, stackName, app.Env) | ||||
|  | ||||
| 		filters, err := app.Filters(false, false) | ||||
| 		if err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		secretList, err := cl.SecretList(context.Background(), types.SecretListOptions{Filters: filters}) | ||||
| 		if err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		var secretStrings []string | ||||
| 		for _, cont := range secretList { | ||||
| 			secretStrings = append(secretStrings, cont.Spec.Name) | ||||
| 		} | ||||
|  | ||||
| 		configList, err := cl.ConfigList(context.Background(), types.ConfigListOptions{Filters: filters}) | ||||
| 		if err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		var configStrings []string | ||||
| 		for _, config := range configList { | ||||
| 			configStrings = append(configStrings, config.Spec.Name) | ||||
| 		} | ||||
|  | ||||
| 		var imageStrings []string | ||||
| 		for _, service := range compose.Services { | ||||
| 			imageStrings = append(imageStrings, service.Image) | ||||
| 		} | ||||
|  | ||||
| 		// NOTE(d1): no release notes implemeneted for rolling back | ||||
| 		if err := internal.DeployOverview( | ||||
| 			app, | ||||
| @ -197,6 +229,9 @@ beforehand. See "abra app backup" for more.`), | ||||
| 			chosenDowngrade, | ||||
| 			"", | ||||
| 			downgradeWarnMessages, | ||||
| 			strings.Join(secretStrings, "\n"), | ||||
| 			strings.Join(configStrings, "\n"), | ||||
| 			strings.Join(imageStrings, "\n"), | ||||
| 		); err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
|  | ||||
		Reference in New Issue
	
	Block a user