mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-20 12:14:23 -04:00
cli: fix apply flag issues (#2526)
* Fix flag order * Fix missing phases in flag parsing --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
e4d8bda792
commit
a0863bafe7
3 changed files with 35 additions and 29 deletions
|
@ -283,26 +283,6 @@ func TestUpgradeApply(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestUpgradeApplyFlagsForSkipPhases(t *testing.T) {
|
||||
require := require.New(t)
|
||||
cmd := newUpgradeApplyCmd()
|
||||
// register persistent flags manually
|
||||
cmd.Flags().String("workspace", "", "")
|
||||
cmd.Flags().Bool("force", true, "")
|
||||
cmd.Flags().String("tf-log", "NONE", "")
|
||||
cmd.Flags().Bool("debug", false, "")
|
||||
cmd.Flags().Bool("merge-kubeconfig", false, "")
|
||||
|
||||
require.NoError(cmd.Flags().Set("skip-phases", "infrastructure,helm,k8s,image"))
|
||||
wantPhases := skipPhases{}
|
||||
wantPhases.add(skipInfrastructurePhase, skipHelmPhase, skipK8sPhase, skipImagePhase)
|
||||
|
||||
var flags applyFlags
|
||||
err := flags.parse(cmd.Flags())
|
||||
require.NoError(err)
|
||||
assert.Equal(t, wantPhases, flags.skipPhases)
|
||||
}
|
||||
|
||||
type stubKubernetesUpgrader struct {
|
||||
nodeVersionErr error
|
||||
currentConfig config.AttestationCfg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue