fix(region): Add reset_password in guest template's ConfigInfo

This commit is contained in:
Rain
2020-01-04 21:33:33 +08:00
parent 9d8933b030
commit d9f4134f7f
2 changed files with 8 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ type GuesttemplateConfigInfo struct {
Secgroup string `json:"secgroup"`
IsolatedDeviceConfig []IsolatedDeviceConfig `json:"isolated_device_config"`
Image string `json:"image"`
ResetPassword bool `json:"reset_password"`
}
type GuesttemplateDisk struct {

View File

@@ -329,6 +329,13 @@ func (gt *SGuestTemplate) getMoreDetailsV2(ctx context.Context, userCred mcclien
// no arrivals
}
// reset_password
if input.ResetPassword == nil {
configInfo.ResetPassword = false
} else {
configInfo.ResetPassword = *input.ResetPassword
}
out.ConfigInfo = configInfo
return
}