Skip to content

Commit

Permalink
Validate
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekMichali committed Jan 9, 2025
1 parent 4fe2240 commit 6e7c7ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions testing/e2e/skr-tester/pkg/command/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,16 @@ func (cmd *UpdateCommand) Run() error {
}

func (cmd *UpdateCommand) Validate() error {
if cmd.instanceID != "" && cmd.planID != "" {
return nil
} else {
if cmd.instanceID == "" || cmd.planID == "" {
return errors.New("you must specify the planID and instanceID")
}
if !cmd.updateMachineType && !cmd.updateOIDC {
return errors.New("you must use at least one of updateMachineType or updateOIDC")
}
if cmd.updateMachineType && cmd.updateOIDC {
return errors.New("only one of updateMachineType or updateOIDC can be used")
}
return nil
}

func extractSupportedMachineTypes(planMap map[string]interface{}) ([]interface{}, error) {
Expand Down

0 comments on commit 6e7c7ea

Please sign in to comment.