Skip to content

Commit d4c9331

Browse files
committed
validate when not creating on a pp, that pp flags are not passed
1 parent 6bf8f56 commit d4c9331

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

instance/cloudServerCreate.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,16 @@ func (ci *Client) CloudServerCreate(params *CloudServerCreateParams) (string, er
110110
if params.ConfigId <= 0 {
111111
return "", fmt.Errorf("--config_id is required when not specifying --private-parent")
112112
}
113-
113+
// not on a private parent, shouldnt pass private parent flags
114+
if params.Memory != -1 {
115+
return "", fmt.Errorf("--memory should not be passed with --config-id")
116+
}
117+
if params.Diskspace != -1 {
118+
return "", fmt.Errorf("--diskspace should not be passed with --config-id")
119+
}
120+
if params.Vcpu != -1 {
121+
return "", fmt.Errorf("--vcpu should not be passed with --config-id")
122+
}
114123
}
115124

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

0 commit comments

Comments
 (0)