Skip to content

Commit

Permalink
validate when not creating on a pp, that pp flags are not passed
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsullivan committed Mar 3, 2020
1 parent 6bf8f56 commit d4c9331
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion instance/cloudServerCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,16 @@ func (ci *Client) CloudServerCreate(params *CloudServerCreateParams) (string, er
if params.ConfigId <= 0 {
return "", fmt.Errorf("--config_id is required when not specifying --private-parent")
}

// not on a private parent, shouldnt pass private parent flags
if params.Memory != -1 {
return "", fmt.Errorf("--memory should not be passed with --config-id")
}
if params.Diskspace != -1 {
return "", fmt.Errorf("--diskspace should not be passed with --config-id")
}
if params.Vcpu != -1 {
return "", fmt.Errorf("--vcpu should not be passed with --config-id")
}
}

if params.Template == "" && params.BackupId == -1 && params.ImageId == -1 {
Expand Down

1 comment on commit d4c9331

@dwburke
Copy link
Contributor

@dwburke dwburke commented on d4c9331 Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.