From d9f4134f7fc06ebaebdd202b2a109bc40e10e97b Mon Sep 17 00:00:00 2001 From: Rain Date: Sat, 4 Jan 2020 21:33:33 +0800 Subject: [PATCH] fix(region): Add reset_password in guest template's ConfigInfo --- pkg/apis/compute/guesttemplate.go | 1 + pkg/compute/models/guest_template.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/pkg/apis/compute/guesttemplate.go b/pkg/apis/compute/guesttemplate.go index 8e4423c96f..0ae0750101 100644 --- a/pkg/apis/compute/guesttemplate.go +++ b/pkg/apis/compute/guesttemplate.go @@ -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 { diff --git a/pkg/compute/models/guest_template.go b/pkg/compute/models/guest_template.go index ffa3914c9c..628617de6c 100644 --- a/pkg/compute/models/guest_template.go +++ b/pkg/compute/models/guest_template.go @@ -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 }