Skip to content

Commit

Permalink
Merge pull request #62 from openinfradev/import_cluster
Browse files Browse the repository at this point in the history
feature. add parameter cloudService to importCluater
  • Loading branch information
zugwan authored Oct 31, 2023
2 parents 5fbd786 + 1c116f4 commit 44e5658
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ require (
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/openinfradev/tks-api v0.0.0-20231030042143-6d03e4703290 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ github.com/openinfradev/tks-api v0.0.0-20231023034343-1580951459e9 h1:Qhly947Yqv
github.com/openinfradev/tks-api v0.0.0-20231023034343-1580951459e9/go.mod h1:91WDknrRu9zZZ1rI1OGhj7dqqc4DQJb830y7EU5t85I=
github.com/openinfradev/tks-api v0.0.0-20231024113640-194c66729204 h1:rQ7MjKuvn90zayMKJ/Gg+DxsdFhY9f7m9pjQve0MHIo=
github.com/openinfradev/tks-api v0.0.0-20231024113640-194c66729204/go.mod h1:6+54AukAD010HyA0LNK0ydabkQ1vyNcCnCxlFyYvvmg=
github.com/openinfradev/tks-api v0.0.0-20231027014838-4303095007d1 h1:3FMOWQNUcdmSHr6k76aYUcINUSSrGw6D5If7PvCo/Us=
github.com/openinfradev/tks-api v0.0.0-20231027014838-4303095007d1/go.mod h1:6+54AukAD010HyA0LNK0ydabkQ1vyNcCnCxlFyYvvmg=
github.com/openinfradev/tks-api v0.0.0-20231030042143-6d03e4703290 h1:eWXnZno7SsO5uz+tTPp2HyAtYwDHXy3BIsrbGSaJi4M=
github.com/openinfradev/tks-api v0.0.0-20231030042143-6d03e4703290/go.mod h1:6+54AukAD010HyA0LNK0ydabkQ1vyNcCnCxlFyYvvmg=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
Expand Down
3 changes: 3 additions & 0 deletions internal/commands/cluster-import.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func NewClusterImportCommand(globalOpts *GlobalOptions) *cobra.Command {
description string
stackTemplateId string
kubeconfigPath string
cloudService string
)

var command = &cobra.Command{
Expand Down Expand Up @@ -51,6 +52,7 @@ func NewClusterImportCommand(globalOpts *GlobalOptions) *cobra.Command {
Description: description,
ClusterType: clusterType,
Kubeconfig: kubeconfig,
CloudService: cloudService,
}

apiClient, err := _apiClient.NewWithToken(globalOpts.ServerAddr, globalOpts.AuthToken)
Expand All @@ -73,6 +75,7 @@ func NewClusterImportCommand(globalOpts *GlobalOptions) *cobra.Command {
helper.CheckError(command.MarkFlagRequired("organization-id"))

command.Flags().StringVar(&clusterType, "cluster-type", "USER", "the cluster type (USER | ADMIN)")
command.Flags().StringVar(&cloudService, "cloud-service", "AWS", "the cloud service (AWS | BYOH)")

command.Flags().StringVarP(&stackTemplateId, "stack-template-id", "t", "", "the template for installation")
helper.CheckError(command.MarkFlagRequired("stack-template-id"))
Expand Down

0 comments on commit 44e5658

Please sign in to comment.