■ ■ ■ ■ ■ ■
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 |