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:
Otto Bittner 2023-01-31 11:45:31 +01:00
parent 3a7b829107
commit f204c24174
29 changed files with 590 additions and 61 deletions

View file

@ -51,6 +51,7 @@ func TestUpgradeExecute(t *testing.T) {
require := require.New(t)
cmd := newUpgradeExecuteCmd()
cmd.Flags().String("config", constants.ConfigFilename, "") // register persistent flag manually
cmd.Flags().Bool("force", true, "") // register persistent flag manually
handler := file.NewHandler(afero.NewMemMapFs())
cfg := defaultConfigWithExpectedMeasurements(t, config.Default(), cloudprovider.Azure)