mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 19:46:07 -04:00
cli: add version validation and force flag
Version validation checks that the configured versions are not more than one minor version below the CLI's version. The validation can be disabled using --force. This is necessary for now during development as the CLI does not have a prerelease version, as our images do.
This commit is contained in:
parent
3a7b829107
commit
f204c24174
29 changed files with 590 additions and 61 deletions
|
@ -58,13 +58,18 @@ func runDeploy(cmd *cobra.Command, args []string) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("parsing config path argument: %w", err)
|
||||
}
|
||||
force, err := cmd.Flags().GetBool("force")
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting force flag: %w", err)
|
||||
}
|
||||
|
||||
fs := afero.NewOsFs()
|
||||
fileHandler := file.NewHandler(fs)
|
||||
streamer := streamer.New(fs)
|
||||
transfer := filetransfer.New(log, streamer, filetransfer.ShowProgress)
|
||||
constellationConfig, err := config.FromFile(fileHandler, configName)
|
||||
constellationConfig, err := config.New(fileHandler, configName, force)
|
||||
if err != nil {
|
||||
return err
|
||||
return config.DisplayValidationErrors(cmd.ErrOrStderr(), err)
|
||||
}
|
||||
|
||||
return deploy(cmd, fileHandler, constellationConfig, transfer, log)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue