mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
@@ -86,7 +86,7 @@ require (
|
||||
k8s.io/client-go v0.19.3
|
||||
k8s.io/cluster-bootstrap v0.19.3
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231114104913-5c1363fc971d
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231115130252-a322ce3ced5f
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
|
||||
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
|
||||
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
|
||||
|
||||
@@ -1192,8 +1192,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231114104913-5c1363fc971d h1:WNe7ZQEQLO7eXNjvKCSWMqWdJ7F9m8+H21nSKx551+c=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231114104913-5c1363fc971d/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231115130252-a322ce3ced5f h1:VWGqYO7ZdI8SYb9zPnGjua+hLZ/OsN6YHPkYkxfjCyw=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231115130252-a322ce3ced5f/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
|
||||
Vendored
+1
-1
@@ -1458,7 +1458,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
|
||||
# sigs.k8s.io/yaml v1.2.0
|
||||
## explicit; go 1.12
|
||||
sigs.k8s.io/yaml
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231114104913-5c1363fc971d
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231115130252-a322ce3ced5f
|
||||
## explicit; go 1.18
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
|
||||
+2
-22
@@ -268,17 +268,7 @@ func (rds *SDBInstance) GetDescription() string {
|
||||
}
|
||||
|
||||
func (rds *SDBInstance) Update(ctx context.Context, input cloudprovider.SDBInstanceUpdateOptions) error {
|
||||
if len(input.NAME) > 0 {
|
||||
params := map[string]string{
|
||||
"DBInstanceIdentifier": input.NAME,
|
||||
"ApplyImmediately": "true",
|
||||
}
|
||||
err := rds.region.rdsRequest("ModifyDBInstance", params, nil)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "ModifyDBInstance")
|
||||
}
|
||||
}
|
||||
return rds.SetTags(map[string]string{"Description": input.Description}, true)
|
||||
return rds.SetTags(map[string]string{"Description": input.Description}, false)
|
||||
}
|
||||
|
||||
func (region *SRegion) Update(instanceId string, input cloudprovider.SDBInstanceUpdateOptions) error {
|
||||
@@ -286,17 +276,7 @@ func (region *SRegion) Update(instanceId string, input cloudprovider.SDBInstance
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "GetDBInstance")
|
||||
}
|
||||
if len(input.NAME) > 0 {
|
||||
params := map[string]string{
|
||||
"DBInstanceIdentifier": input.NAME,
|
||||
"ApplyImmediately": "true",
|
||||
}
|
||||
err := region.rdsRequest("ModifyDBInstance", params, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return dbinstance.SetTags(map[string]string{"Description": input.Description}, true)
|
||||
return dbinstance.SetTags(map[string]string{"Description": input.Description}, false)
|
||||
}
|
||||
|
||||
func (rds *SDBInstance) GetMaintainTime() string {
|
||||
|
||||
+12
@@ -439,6 +439,18 @@ func (instance *SInstance) DeployVM(ctx context.Context, name string, username s
|
||||
instance.Metadata.Items = items
|
||||
return instance.host.zone.region.SetMetadata(instance.SelfLink, instance.Metadata)
|
||||
}
|
||||
if deleteKeypair {
|
||||
items := []SMetadataItem{}
|
||||
items = append(items, SMetadataItem{Key: METADATA_STARTUP_SCRIPT, Value: cloudinit.CLOUD_SHELL_HEADER + "\nrm -rf /root/.ssh/authorized_keys"})
|
||||
instance.Refresh()
|
||||
for _, item := range instance.Metadata.Items {
|
||||
if item.Key != METADATA_STARTUP_SCRIPT {
|
||||
items = append(items, item)
|
||||
}
|
||||
}
|
||||
instance.Metadata.Items = items
|
||||
return instance.host.zone.region.SetMetadata(instance.SelfLink, instance.Metadata)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user