Merge pull request #12007 from rainzm/automated-cherry-pick-of-#12006-upstream-release-3.8

Automated cherry pick of #12006: feat(region): add direct vpc options
This commit is contained in:
Zexi Li
2021-08-26 11:25:59 +08:00
committed by GitHub
3 changed files with 5 additions and 2 deletions
+1 -2
View File
@@ -143,8 +143,7 @@ func (guest *SGuest) sshableTryEach(
if vpc == nil {
continue
}
if vpc.Id == compute_api.DEFAULT_VPC_ID {
// - vpc_id == "default"
if vpc.Id == compute_api.DEFAULT_VPC_ID || vpc.Direct {
if ok := guest.sshableTryDefaultVPC(ctx, tryData, gn); ok {
return nil
}
+3
View File
@@ -87,6 +87,9 @@ type SVpc struct {
// Vpc外网访问模式
ExternalAccessMode string `width:"16" charset:"ascii" nullable:"true" list:"user" update:"user" create:"optional"`
// Can it be connected directly
Direct bool `default:"false" list:"user" update:"user"`
}
func (manager *SVpcManager) GetContextManagers() [][]db.IModelManager {
+1
View File
@@ -88,6 +88,7 @@ func (opts *VpcIdOptions) Params() (jsonutils.JSONObject, error) {
type VpcUpdateOptions struct {
BaseUpdateOptions
ExternalAccessMode string `help:"Filter by external access mode" choices:"distgw|eip|eip-distgw"`
Direct bool `help:"Can it be connected directly"`
}
func (opts *VpcUpdateOptions) Params() (jsonutils.JSONObject, error) {