From 0c4b30335bf5b965b38c40a042f8568f2a3e90e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Mon, 5 Feb 2024 11:23:45 +0800 Subject: [PATCH] fix(region): cloudpods deploy api (#19447) --- pkg/mcclient/cloudpods/instance.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/mcclient/cloudpods/instance.go b/pkg/mcclient/cloudpods/instance.go index 597a712fe8..0895cdf963 100644 --- a/pkg/mcclient/cloudpods/instance.go +++ b/pkg/mcclient/cloudpods/instance.go @@ -282,6 +282,7 @@ func (self *SInstance) RebuildRoot(ctx context.Context, opts *cloudprovider.SMan func (self *SInstance) DeployVM(ctx context.Context, opts *cloudprovider.SInstanceDeployOptions) error { input := api.ServerDeployInput{} input.Password = opts.Password + input.DeleteKeypair = opts.DeleteKeypair if len(opts.PublicKey) > 0 { keypairId, err := self.host.zone.region.syncKeypair(self.Name, opts.PublicKey) if err != nil { @@ -289,7 +290,7 @@ func (self *SInstance) DeployVM(ctx context.Context, opts *cloudprovider.SInstan } input.KeypairId = keypairId } - + cloudprovider.WaitMultiStatus(self, []string{api.VM_READY, api.VM_RUNNING}, time.Second*5, time.Minute*3) _, err := self.host.zone.region.perform(&modules.Servers, self.Id, "deploy", input) if err != nil { return errors.Wrapf(err, "deploy")