Skip to content

Commit

Permalink
Support comma-separated on --enable-crd
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Jul 10, 2023
1 parent e9f0cda commit be6b9d6
Show file tree
Hide file tree
Showing 29 changed files with 109 additions and 109 deletions.
2 changes: 1 addition & 1 deletion pkg/config/flags.go
Expand Up @@ -32,7 +32,7 @@ import (
// InitFlags initializes the flags for the configuration.
func InitFlags(ctx context.Context, flags *pflag.FlagSet) (context.Context, error) {
defaultConfigPath := path.RelFromHome(path.Join(WorkDir, consts.ConfigName))
config := flags.StringArrayP("config", "c", []string{defaultConfigPath}, "config path")
config := flags.StringSliceP("config", "c", []string{defaultConfigPath}, "config path")
_ = flags.Parse(os.Args[1:])

// Expand the all config paths.
Expand Down
2 changes: 1 addition & 1 deletion pkg/kwok/cmd/root.go
Expand Up @@ -85,7 +85,7 @@ func NewCommand(ctx context.Context) *cobra.Command {
cmd.Flags().StringVar(&flags.Master, "master", flags.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).")
cmd.Flags().StringVar(&flags.Options.ServerAddress, "server-address", flags.Options.ServerAddress, "Address to expose the server on")
cmd.Flags().UintVar(&flags.Options.NodeLeaseDurationSeconds, "node-lease-duration-seconds", flags.Options.NodeLeaseDurationSeconds, "Duration of node lease seconds")
cmd.Flags().StringArrayVar(&flags.Options.EnableCRDs, "enable-crd", flags.Options.EnableCRDs, "List of CRDs to enable")
cmd.Flags().StringSliceVar(&flags.Options.EnableCRDs, "enable-crd", flags.Options.EnableCRDs, "List of CRDs to enable")

cmd.Flags().BoolVar(&flags.Options.EnableCNI, "experimental-enable-cni", flags.Options.EnableCNI, "Experimental support for getting pod ip from CNI, for CNI-related components, Only works with Linux")
if config.GOOS != "linux" {
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/generated/kwok.md
Expand Up @@ -10,10 +10,10 @@ kwok [flags]

```
--cidr string CIDR of the pod ip (default "10.0.0.1/24")
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--disregard-status-with-annotation-selector string All node/pod status excluding the ones that match the annotation selector will be watched and managed.
--disregard-status-with-label-selector string All node/pod status excluding the ones that match the label selector will be watched and managed.
--enable-crd stringArray List of CRDs to enable
--enable-crd strings List of CRDs to enable
--experimental-enable-cni Experimental support for getting pod ip from CNI, for CNI-related components, Only works with Linux
-h, --help help for kwok
--kubeconfig string Path to the kubeconfig file to use (default "~/.kube/config")
Expand Down
10 changes: 5 additions & 5 deletions site/content/en/docs/generated/kwokctl.md
Expand Up @@ -9,11 +9,11 @@ kwokctl [command] [flags]
### Options

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
-h, --help help for kwokctl
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
-h, --help help for kwokctl
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_config.md
Expand Up @@ -15,10 +15,10 @@ kwokctl config [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_config_reset.md
Expand Up @@ -15,10 +15,10 @@ kwokctl config reset [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_config_tidy.md
Expand Up @@ -15,10 +15,10 @@ kwokctl config tidy [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_config_view.md
Expand Up @@ -15,10 +15,10 @@ kwokctl config view [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_create.md
Expand Up @@ -15,10 +15,10 @@ kwokctl create [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_create_cluster.md
Expand Up @@ -73,10 +73,10 @@ kwokctl create cluster [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_delete.md
Expand Up @@ -15,10 +15,10 @@ kwokctl delete [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_delete_cluster.md
Expand Up @@ -16,10 +16,10 @@ kwokctl delete cluster [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_etcdctl.md
Expand Up @@ -15,10 +15,10 @@ kwokctl etcdctl [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_export.md
Expand Up @@ -15,10 +15,10 @@ kwokctl export [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_export_logs.md
Expand Up @@ -15,10 +15,10 @@ kwokctl export logs [output-dir] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_get.md
Expand Up @@ -15,10 +15,10 @@ kwokctl get [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_get_artifacts.md
Expand Up @@ -17,10 +17,10 @@ kwokctl get artifacts [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_get_clusters.md
Expand Up @@ -15,10 +15,10 @@ kwokctl get clusters [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_get_kubeconfig.md
Expand Up @@ -19,10 +19,10 @@ kwokctl get kubeconfig [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_kubectl.md
Expand Up @@ -15,10 +15,10 @@ kwokctl kubectl [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_logs.md
Expand Up @@ -16,10 +16,10 @@ kwokctl logs [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_snapshot.md
Expand Up @@ -15,10 +15,10 @@ kwokctl snapshot [command] [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_snapshot_export.md
Expand Up @@ -22,10 +22,10 @@ kwokctl snapshot export [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/generated/kwokctl_snapshot_restore.md
Expand Up @@ -18,10 +18,10 @@ kwokctl snapshot restore [flags]
### Options inherited from parent commands

```
-c, --config stringArray config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO
Expand Down

0 comments on commit be6b9d6

Please sign in to comment.