Projects STRLCPY SeaMoon Commits e722493f
🤬
  • ■ ■ ■ ■ ■
    cmd/client/sdk/consts.go cmd/client/sdk/aliyun/maps.go
    1  -package sdk
     1 +package aliyun
    2 2   
    3  -var ALiYunBillingMap = map[string]string{
     3 +var BillingMap = map[string]string{
    4 4   "cn-qingdao": "business.aliyuncs.com",
    5 5   "cn-beijing": "business.aliyuncs.com",
    6 6   "cn-zhangjiakou": "business.aliyuncs.com",
    skipped 22 lines
    29 29   "eu-west-1": "business.ap-southeast-1.aliyuncs.com",
    30 30  }
    31 31   
    32  -var SealosRegionMap = map[string]string{
    33  - "internal": "cloud.sealos.run",
    34  - "external": "cloud.sealos.io",
    35  -}
    36  - 
  • ■ ■ ■ ■ ■ ■
    cmd/client/sdk/sealos/maps.go
     1 +package sealos
     2 + 
     3 +var RegionMap = map[string]string{
     4 + "internal": "cloud.sealos.run",
     5 + "external": "cloud.sealos.io",
     6 +}
     7 + 
  • ■ ■ ■ ■ ■ ■
    cmd/client/sdk/sealos/sealos.go
    skipped 23 lines
    24 24   
    25 25   "github.com/DVKunion/SeaMoon/cmd/client/api/models"
    26 26   "github.com/DVKunion/SeaMoon/cmd/client/api/service"
    27  - "github.com/DVKunion/SeaMoon/cmd/client/sdk"
    28 27   "github.com/DVKunion/SeaMoon/pkg/consts"
    29 28   "github.com/DVKunion/SeaMoon/pkg/tools"
    30 29   "github.com/DVKunion/SeaMoon/pkg/tunnel"
    skipped 22 lines
    53 52   
    54 53  func (s *SDK) Auth(providerId uint) error {
    55 54   provider := service.GetService("provider").GetById(providerId).(*models.CloudProvider)
    56  - amountUrl := fmt.Sprintf("https://costcenter.%s/api/account/getAmount", sdk.SealosRegionMap[*provider.Region])
     55 + amountUrl := fmt.Sprintf("https://costcenter.%s/api/account/getAmount", RegionMap[*provider.Region])
    57 56   
    58 57   req, err := http.NewRequest("GET", amountUrl, nil)
    59 58   if err != nil {
    skipped 219 lines
    279 278   Spec: networkingv1.IngressSpec{
    280 279   Rules: []networkingv1.IngressRule{
    281 280   {
    282  - Host: fmt.Sprintf("%s.%s", hostName, sdk.SealosRegionMap[*provider.Region]),
     281 + Host: fmt.Sprintf("%s.%s", hostName, RegionMap[*provider.Region]),
    283 282   IngressRuleValue: networkingv1.IngressRuleValue{
    284 283   HTTP: &networkingv1.HTTPIngressRuleValue{
    285 284   Paths: []networkingv1.HTTPIngressPath{
    skipped 16 lines
    302 301   },
    303 302   TLS: []networkingv1.IngressTLS{
    304 303   {
    305  - Hosts: []string{fmt.Sprintf("%s.%s", hostName, sdk.SealosRegionMap[*provider.Region])},
     304 + Hosts: []string{fmt.Sprintf("%s.%s", hostName, RegionMap[*provider.Region])},
    306 305   SecretName: "wildcard-cloud-sealos-io-cert",
    307 306   },
    308 307   },
    skipped 5 lines
    314 313   }
    315 314   fmt.Println("Ingress创建成功!")
    316 315   *tun.Status = tunnel.ACTIVE
    317  - *tun.Addr = fmt.Sprintf("%s.%s", hostName, sdk.SealosRegionMap[*provider.Region])
     316 + *tun.Addr = fmt.Sprintf("%s.%s", hostName, RegionMap[*provider.Region])
    318 317   service.GetService("tunnel").Update(tun.ID, tun)
    319 318   return nil
    320 319  }
    skipped 113 lines
Please wait...
Page is in error, reload to recover