Skip to content

Commit

Permalink
use cloudprovider
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyangyu committed Sep 3, 2024
1 parent 26f46da commit 66c9332
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/cli/serverless/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func CreateCmd(h *internal.Helper) *cobra.Command {
// distinct cloud providers
providers := hashset.New()
for _, provider := range opts.serverlessProviders {
providers.Add(*provider.Provider.Get())
providers.Add(string(*provider.CloudProvider))
}
cloudProvider, err = GetProvider(providers)
if err != nil {
Expand All @@ -151,11 +151,11 @@ func CreateCmd(h *internal.Helper) *cobra.Command {
// filter out regions for the selected cloud provider
regionSet := hashset.New()
for _, provider := range opts.serverlessProviders {
if *provider.Provider.Get() == cloudProvider {
if string(*provider.CloudProvider) == cloudProvider {
regionSet.Add(cloud.Region{
Name: *provider.Name,
DisplayName: *provider.DisplayName,
Provider: *provider.Provider.Get(),
Provider: string(*provider.CloudProvider),
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/serverless/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func ListCmd(h *internal.Helper) *cobra.Command {
item.DisplayName,
string(*item.State),
*item.Version,
*item.Region.Provider.Get(),
string(*item.Region.CloudProvider),
*item.Region.DisplayName,
item.CreateTime.Format(time.RFC3339),
})
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/serverless/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func RegionCmd(h *internal.Helper) *cobra.Command {
rows = append(rows, output.Row{
*item.Name,
*item.DisplayName,
*item.Provider.Get(),
string(*item.CloudProvider),
})
}
err = output.PrintHumanTable(h.IOStreams.Out, columns, rows)
Expand Down

0 comments on commit 66c9332

Please sign in to comment.