Skip to content

Commit

Permalink
Merge pull request #23 from spinkube/experimental
Browse files Browse the repository at this point in the history
mark some CLI commands as experimental
  • Loading branch information
bacongobbler authored Feb 21, 2024
2 parents 1e59dbe + d3130db commit 45f2431
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
5 changes: 3 additions & 2 deletions pkg/cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import (
const spinAppPort = "80"

var connectCmd = &cobra.Command{
Use: "connect [<app-name>]",
Short: "connect to spin app locally",
Use: "connect [<app-name>]",
Short: "connect to spin app locally",
Hidden: isExperimentalFlagNotSet,
RunE: func(cmd *cobra.Command, args []string) error {
var appName string
if len(args) > 0 {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
)

var deleteCmd = &cobra.Command{
Use: "delete app-name",
Short: "Delete app",
Use: "delete app-name",
Short: "Delete app",
Hidden: isExperimentalFlagNotSet,
RunE: func(cmd *cobra.Command, args []string) error {
var appName string
if len(args) > 0 {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ var (
)

var deployCmd = &cobra.Command{
Use: "deploy",
Short: "deploy spin app",
Use: "deploy",
Short: "deploy spin app",
Hidden: isExperimentalFlagNotSet,
RunE: func(cmd *cobra.Command, args []string) error {
reference := strings.Split(artifact, ":")[0]
referenceParts := strings.Split(reference, "/")
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
)

var getCmd = &cobra.Command{
Use: "get [app-name]",
Short: "Display detailed information about an app",
Use: "get [app-name]",
Short: "Display detailed information about an app",
Hidden: isExperimentalFlagNotSet,
RunE: func(cmd *cobra.Command, args []string) error {
var appName string
if len(args) > 0 {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
)

var listCmd = &cobra.Command{
Use: "list",
Short: "List apps",
Use: "list",
Short: "List apps",
Hidden: isExperimentalFlagNotSet,
RunE: func(cmd *cobra.Command, args []string) error {
appsResp, err := k8simpl.ListSpinApps(context.TODO(), namespace)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
var logOpts *logs.LogsOptions

var logsCmd = &cobra.Command{
Use: "logs [<app-name>]",
Short: "print the logs for a SpinApp",
Use: "logs [<app-name>]",
Short: "print the logs for a SpinApp",
Hidden: isExperimentalFlagNotSet,
Run: func(cmd *cobra.Command, args []string) {
var appName string
if len(args) > 0 {
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var (
configFlags = genericclioptions.NewConfigFlags(true)
namespace string
k8simpl *k8s.Impl
isExperimentalFlagNotSet = os.Getenv("SPIN_EXPERIMENTAL") == ""
)

// rootCmd represents the base command when called without any subcommands
Expand Down

0 comments on commit 45f2431

Please sign in to comment.