Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename sandbox-cli to ksctl #8

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/client/sandbox_config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
return "", err
}
}
filePath := path.Join(dirPath, "sandbox-cli-config")
filePath := path.Join(dirPath, "ksctl-config")

Check warning on line 19 in pkg/client/sandbox_config_file.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/sandbox_config_file.go#L19

Added line #L19 was not covered by tests
_, err = os.Stat(filePath)
if os.IsNotExist(err) {
emptyFile, err := os.Create(filePath)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/adm/generate_cli_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
command := &cobra.Command{
Use: "generate-cli-configs --sandbox-config=<path-to-sandbox-config-file>",
Short: "Generate ksctl.yaml files",
Long: `Generate ksctl.yaml files, that is used by sandbox-cli, for every ServiceAccount defined in the given sandbox-config.yaml file`,
Long: `Generate ksctl.yaml files, that is used by ksctl, for every ServiceAccount defined in the given sandbox-config.yaml file`,

Check warning on line 40 in pkg/cmd/adm/generate_cli_configs.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/adm/generate_cli_configs.go#L40

Added line #L40 was not covered by tests
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, _ []string) error {
term := ioutils.NewTerminal(cmd.InOrStdin, cmd.OutOrStdout)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/adm/register_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func NewRegisterMemberCmd() *cobra.Command {
}

func registerMemberCluster(ctx *clicontext.CommandContext, newCommand client.CommandCreator, hostKubeconfig, memberKubeconfig string) error {
ctx.AskForConfirmation(ioutils.WithMessagef("register member cluster from kubeconfig %s. Be aware that the sandbox-cli disables automatic approval to prevent new users being provisioned to the new member cluster. "+
ctx.AskForConfirmation(ioutils.WithMessagef("register member cluster from kubeconfig %s. Be aware that the ksctl disables automatic approval to prevent new users being provisioned to the new member cluster. "+
"You will need to enable it again manually.", memberKubeconfig))

hostClusterConfig, err := configuration.LoadClusterConfig(ctx, configuration.HostName)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/adm/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
f := setupFlags{}
command := &cobra.Command{
Use: "setup --sandbox-config=<path-to-sandbox-config-file> --out-dir <path-to-out-dir>",
Example: `sandbox-cli adm setup ./path/to/sandbox.openshiftapps.com/sandbox-config.yaml --out-dir ./components/auth/devsandbox-production
sandbox-cli adm setup ./path/to/sandbox-stage.openshiftapps.com/sandbox-config.yaml --out-dir ./components/auth/devsandbox-staging -s`,
Example: `ksctl adm setup ./path/to/sandbox.openshiftapps.com/sandbox-config.yaml --out-dir ./components/auth/devsandbox-production
ksctl adm setup ./path/to/sandbox-stage.openshiftapps.com/sandbox-config.yaml --out-dir ./components/auth/devsandbox-staging -s`,

Check warning on line 27 in pkg/cmd/adm/setup.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/adm/setup.go#L26-L27

Added lines #L26 - L27 were not covered by tests
Short: "Generates user-management manifests",
Long: `Reads the sandbox-config.yaml file and based on the content it generates user-management RBAC and manifests.`,
Args: cobra.ExactArgs(0),
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/base_kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func setupKubectlCmd(newCmd newCmd) *cobra.Command {
ErrOut: os.Stderr,
}
cmd := newCmd(factory, ioStreams)
cmd.Example = strings.ReplaceAll(cmd.Example, "kubectl ", "sandbox-cli ")
cmd.Example = strings.ReplaceAll(cmd.Example, "kubectl ", "ksctl ")

// hide unused/redefined flags
kubeConfigFlags.ClusterName = nil // `cluster` flag is redefined for our own purpose
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import (

func NewDescribeCmd() *cobra.Command {
return setupKubectlCmd(func(factory cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
return kubectldesc.NewCmdDescribe("sandbox-cli", factory, ioStreams)
return kubectldesc.NewCmdDescribe("ksctl", factory, ioStreams)
})
}
2 changes: 1 addition & 1 deletion pkg/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import (

func NewGetCmd() *cobra.Command {
return setupKubectlCmd(func(factory cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
return kubectlget.NewCmdGet("sandbox-cli", factory, ioStreams)
return kubectlget.NewCmdGet("ksctl", factory, ioStreams)
})
}
6 changes: 3 additions & 3 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ var rootCmd = NewRootCmd()

func NewRootCmd() *cobra.Command {
return &cobra.Command{
Use: "sandbox-cli",
Short: "Dev Sandbox CLI",
Long: `Dev Sandbox CLI helps you to manage Toolchain resources in Dev Sandbox instances`,
Use: "ksctl",
Short: "KubeSaw command-line",
Long: `KubeSaw command-line tool that helps you to manage your KubeSaw service`,
Version: version.NewMessage(),
}
}
Expand Down
Loading