Merge "Update Validation Logic for Clusterctl Move"
This commit is contained in:
commit
cc5221972a
@ -181,9 +181,6 @@ func (c *ClusterctlExecutor) Validate() error {
|
|||||||
return phaseerrors.ErrInvalidPhase{Reason: "ClusterctlExecutor.InitOptions.CoreProvider is empty"}
|
return phaseerrors.ErrInvalidPhase{Reason: "ClusterctlExecutor.InitOptions.CoreProvider is empty"}
|
||||||
}
|
}
|
||||||
case airshipv1.Move:
|
case airshipv1.Move:
|
||||||
if c.options.MoveOptions.Namespace == "" {
|
|
||||||
return phaseerrors.ErrInvalidPhase{Reason: "ClusterctlExecutor.MoveOptions.Namespace is empty"}
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return errors.ErrUnknownExecutorAction{Action: string(c.options.Action)}
|
return errors.ErrUnknownExecutorAction{Action: string(c.options.Action)}
|
||||||
}
|
}
|
||||||
|
@ -234,11 +234,6 @@ func TestClusterctlExecutorValidate(t *testing.T) {
|
|||||||
actionType: "init",
|
actionType: "init",
|
||||||
executorConfigTmpl: executorConfigTmplGood,
|
executorConfigTmpl: executorConfigTmplGood,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Success move action",
|
|
||||||
actionType: "move",
|
|
||||||
executorConfigTmpl: executorConfigTmplGood,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "Error any other action",
|
name: "Error any other action",
|
||||||
actionType: "any",
|
actionType: "any",
|
||||||
@ -257,12 +252,6 @@ func TestClusterctlExecutorValidate(t *testing.T) {
|
|||||||
executorConfigTmpl: executorConfigTmplBad,
|
executorConfigTmpl: executorConfigTmplBad,
|
||||||
expectedErrString: "invalid phase: ClusterctlExecutor.InitOptions.CoreProvider is empty",
|
expectedErrString: "invalid phase: ClusterctlExecutor.InitOptions.CoreProvider is empty",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Error empty move option",
|
|
||||||
actionType: "move",
|
|
||||||
executorConfigTmpl: executorConfigTmplBad,
|
|
||||||
expectedErrString: "invalid phase: ClusterctlExecutor.MoveOptions.Namespace is empty",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
for _, test := range testCases {
|
for _, test := range testCases {
|
||||||
tt := test
|
tt := test
|
||||||
|
Loading…
Reference in New Issue
Block a user