-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into release-3.1
- Loading branch information
Showing
45 changed files
with
644 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package phase | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/kubesphere/kubekey/v3/cmd/kk/cmd/options" | ||
"github.com/kubesphere/kubekey/v3/cmd/kk/cmd/util" | ||
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/common" | ||
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/phase/addons" | ||
) | ||
|
||
type ApplyAddonsOptions struct { | ||
CommonOptions *options.CommonOptions | ||
ClusterCfgFile string | ||
} | ||
|
||
func NewApplyAddonsOptions() *ApplyAddonsOptions { | ||
return &ApplyAddonsOptions{ | ||
CommonOptions: options.NewCommonOptions(), | ||
} | ||
} | ||
|
||
func NewCmdApplyAddons() *cobra.Command { | ||
o := NewApplyAddonsOptions() | ||
cmd := &cobra.Command{ | ||
Use: "addons", | ||
Short: "Apply cluster addons", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
util.CheckErr(o.Run(args)) | ||
}, | ||
} | ||
|
||
o.CommonOptions.AddCommonFlag(cmd) | ||
o.AddFlags(cmd) | ||
return cmd | ||
} | ||
|
||
func (o *ApplyAddonsOptions) Run(args []string) error { | ||
arg := common.Argument{ | ||
FilePath: o.ClusterCfgFile, | ||
Debug: o.CommonOptions.Verbose, | ||
EnabledAddons: args, | ||
} | ||
return addons.ApplyClusterAddons(arg) | ||
} | ||
|
||
func (o *ApplyAddonsOptions) AddFlags(cmd *cobra.Command) { | ||
cmd.Flags().StringVarP(&o.ClusterCfgFile, "filename", "f", "", "Path to a configuration file") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.