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

feat: Add --context flag to choose specific context from kubeconfig #1234

Merged
merged 7 commits into from
Feb 23, 2021
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
5 changes: 5 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
|===
| | Description | PR

| 🎁
| Add `--context` and `--cluster` flags to choose specific context from kubeconfig
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't decide if that shouldn't be split to 2 entries per flag. Please let me know wdyt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine

| https://github.com/knative/client/pull/1234[#1234]

| 🐣
| Making a toReference public to enable reuse from kn-plugins
| https://github.com/knative/client/pull/1203[#1203]

| 🐣
| Do not print serviceUID and configUID labels in service export result
| https://github.com/knative/client/pull/1194[#1194]
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ kn is the command line interface for managing Knative Serving and Eventing resou
### Options

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
-h, --help help for kn
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_broker.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ kn broker
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_broker_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ kn broker create NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_broker_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ kn broker delete NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_broker_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ kn broker describe NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_broker_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ kn broker list
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ kn channel COMMAND
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_channel_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ kn channel create NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_channel_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ kn channel delete NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_channel_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ kn channel describe NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_channel_list-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ kn channel list-types
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_channel_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ kn channel list
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ kn completion SHELL
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ kn options
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ kn plugin
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_plugin_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ kn plugin list
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_revision.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ kn revision
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_revision_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ kn revision delete NAME [NAME ...]
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_revision_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ kn revision describe NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_revision_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ kn revision list
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_route.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ kn route
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_route_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ kn route describe NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_route_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ kn route list NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ kn service
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ kn service apply s0 --filename my-svc.yml
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ kn service create NAME --image IMAGE
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ kn service delete NAME [NAME ...]
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ kn service describe NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ kn service export NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ kn service import FILENAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ kn service list
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_service_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ kn service update NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ kn source SOURCE|COMMAND
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_source_apiserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ kn source apiserver COMMAND
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_source_apiserver_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ kn source apiserver create NAME --resource RESOURCE --sink SINK
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_source_apiserver_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ kn source apiserver delete NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_source_apiserver_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ kn source apiserver describe NAME
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
2 changes: 2 additions & 0 deletions docs/cmd/kn_source_apiserver_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ kn source apiserver list
### Options inherited from parent commands

```
--cluster string name of the kubeconfig cluster to use
--config string kn configuration file (default: ~/.config/kn/config.yaml)
--context string name of the kubeconfig context to use
--kubeconfig string kubectl configuration file (default: ~/.kube/config)
--log-http log http traffic
```
Expand Down
Loading