Commit Graph

42 Commits

Author SHA1 Message Date
Arda Güçlü 608a0553d7 Use generic sets rather than deprecated sets.String
Kubernetes-commit: c3f15fd707a092e6cb7d96b84b81ada1f118d759
2024-11-21 13:22:39 +03:00
TessaIO 25c985cf66 fix: add namespace autocompletion for kubectl config set-context command
Signed-off-by: TessaIO <ahmedgrati1999@gmail.com>

Kubernetes-commit: 62be85249e27e58a92ab3a1caf672159dc3cfd7f
2024-05-20 14:44:54 +02:00
Claudiu Belu 0ee0d225f2 Replaces path.Operation with filepath.Operation (staging)
The path module has a few different functions:
Clean, Split, Join, Ext, Dir, Base, IsAbs. These functions do not
take into account the OS-specific path separator, meaning that they
won't behave as intended on Windows.

For example, Dir is supposed to return all but the last element of the
path. For the path "C:\some\dir\somewhere", it is supposed to return
"C:\some\dir\", however, it returns ".".

Instead of these functions, the ones in filepath should be used instead.

Kubernetes-commit: 856bb5c8f266f5276f1a576f47be622d7cb384e7
2022-06-15 15:17:24 +03:00
Arda Güçlü cb3e3dd9f6 Use tristate for provideclusterinfo to manage provided flag
Kubernetes-commit: 38c67af789bc62b88275e6a12facfe3f7881208c
2023-11-29 08:58:59 +03:00
Arda Güçlü 2f794d398e move provideclusterinfo assignment into correct place
Kubernetes-commit: 5e5f8b1dd29d1c4f983620dd818b1bc1f00d7319
2023-11-28 08:54:54 +03:00
Arda Güçlü 7af2fcf712 kubectl config set-credentials: Add InteractiveMode and ProvideClusterInfo flags
`set-credentials` command can also be used to config kubeconfig with credentials
exec plugins. However, there is no flag provided by this command to set
`InteractiveMode` and `ProvideClusterInfo` fields in credentials exec plugins.
Since `InteractiveMode` is required field, this makes the command's output
is incomplete and invalid. This PR introduces 2 new flags in set-credentials
command to let users can configure these 2 fields in credentials exec plugins,
especially the one `InteractiveMode` which is required.

Kubernetes-commit: b088e65007761bda1aee0b5fb92f79d1aae82c05
2023-11-23 15:32:32 +03:00
Andrea Hoffer b676723184 Update CLI help text for grammar and consistency
Kubernetes-commit: a86380c7813a6d0cfa248c9165c878038730526a
2023-06-12 15:55:59 -04:00
HirazawaUi 08300912da fix fd leaks and failed file removing for pkg kubectl and pod-security-admission
Kubernetes-commit: b94c6daa0b7602e2d30e35cf2b94f9d1e8fde56e
2023-05-03 01:36:46 +08:00
Tim Hockin ece694d5d1 Replace uses of diff.ObjectDiff with cmp.Diff
ObjectDiff is already a shim over cmp.Diff, so no actual output or
behavior changes

Kubernetes-commit: 29c0b73d640b6e50c4f2dfeee7b07ca66a530dbd
2023-03-23 11:29:01 -07:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
inosato 8272d71ba6 Remove ioutil from kubectl
Signed-off-by: inosato <si17_21@yahoo.co.jp>

Kubernetes-commit: 774ab1349bfd553c97a99b992e9f38659f541c84
2022-07-30 22:31:16 +09:00
Marly Puckett 9cebc60d68 Update redacting functionality to redact all sensitive info in config when printing with view (#109189)
* Add RedactSecrets function

* Move RedactSecrets method to existing RawBytesData case

* Update TestRedactSecrets to use new pattern of os.CreateTemp()

Kubernetes-commit: e721272d10dd6c4d85ff613182ba0eaddcec9272
2022-11-08 18:06:48 +00:00
21kyu 0bf778323e Change reflect.Ptr to reflect.Pointer
Kubernetes-commit: df168d5b5c2dab7414fc00ead1a51257ec326a98
2022-06-26 01:23:43 +09:00
Arda Güçlü 81a25f37b5 Set validate functions requiring no parameters for all commands
Validate function is used to validate command options and should not get
any additional parameter. To preserve compatibility across all
kubectl commands, this PR removes all parameters in validate functions.

Kubernetes-commit: 8fb423bfabe0d53934cc94c154c7da2dc3ce1332
2022-05-17 11:38:20 +03:00
Marc Khouzam cd5b039b42 Refactor completion code into its own package
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: c4f8c57b43843abd13bae677b73c622e1c30b46f
2022-03-24 09:06:05 -04:00
Chok Yip Lau 6a5a78c26b Beautify kubectl help flag commands
Kubernetes-commit: 1c031d4fa8450550fa9a6bd5abe7fac45816156e
2021-09-02 13:41:07 -04:00
brianpursley 131a58c252 Renamed create_authinfo.go, create_cluster.go, and create_context.go
to match their kubectl config subcommand names and reflect that they
are used for setting values, not just creating.

Deprecated NewCmdConfigSetAuthInfo in favor of NewCmdConfigSetCredentials.

Did some minor refactoring of one of the complete functions to eliminate
an unused argument and not wrap returned errors that do not add detail.

Kubernetes-commit: 48007fc32bb473d1d0d7d7c24b9daa2157e433d1
2022-02-06 21:31:13 -05:00
Sebastian Sterk 31436b2c03 simple grammar fix
Kubernetes-commit: 5e286470fa16c4d53aa24b76a4fe94edf7b7016c
2022-02-02 00:02:11 +01:00
David Hotham 675d0d2328 Completions for kubectl config delete-user
Kubernetes-commit: 62eb74880cc3a97b04d1ea7fab62a207433a0f77
2021-12-20 14:40:56 +00:00
Kebe d100fd0cee Add completion for
Kubernetes-commit: a57e6c892448f0ef21d7af551170773b57e8b397
2021-11-30 18:20:05 +08:00
Arda Güçlü f6fcb7d932 Enable setting proxyurl in kubeconfig via kubectl config (#105566)
* Enable setting proxyurl in kubeconfig via kubectl config

This PR enables setting `proxy-url` in kubeconfig via kubectl config.

* Add godoc for proxy-url unit tests

Kubernetes-commit: afdde383210294c3da573decc44b5ce55cffcb94
2021-12-20 21:54:05 +00:00
navist2020 2128ec58c8 remove Factory that not used
Kubernetes-commit: 0a83041d4d3698d36ade2a310184248c61eec64f
2021-05-17 16:56:12 +08:00
Andrea Hoffer 09ed00ef49 Minor adjustments to descriptions and example text
Kubernetes-commit: 6b736f348483bb6b20d4633319305960f4d9e4c1
2021-07-06 15:05:26 -04:00
Marc Khouzam 724356168b Revert "Add Go tests for custom completions"
This reverts commit 0e18f0380042b652996d795559bfb818698abec3.

Kubernetes-commit: 1babceac650cfe8ec7ac71b34ed1ecf118b50f9d
2021-05-22 20:47:14 -04:00
Marc Khouzam 5c679b006e Join common functions for completion
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: 9625872d1e4fd0d4d397b3ab732c6969a3a376fe
2021-05-15 21:22:42 -04:00
Marc Khouzam b817d296dd Update staging/src/k8s.io/kubectl/pkg/cmd/config/config.go
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

Kubernetes-commit: 9d03185d3c12a0b3f2f36a5096d4a9658bba5472
2021-05-03 14:18:00 -04:00
Marc Khouzam af40736fcc Add Go tests for custom completions
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: c0b3a698fa15265eecdec0bd8776658c40d8d151
2021-03-05 15:44:30 -05:00
Marc Khouzam 1946af5761 Move all completion bash code to Go code
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: 879cdc5fa9e518ce76b9e1dc7e795132457966f3
2021-03-05 15:43:31 -05:00
zhouya0 ccd9dd871c Move kubectl get-context validate logic to Validate function
Kubernetes-commit: c41fb9e3bfe5d13347a46d6b08f1b2a8347b1bc8
2020-07-15 19:02:26 +08:00
Karl 'NaN' Wikström 38408eaa8c cleanup: use i18n.T on all command descriptions
cleanup: use i18n.T only on string literals

cleanup: sort imports

Add i18n dependency for wait.go

Remove translation on envResource

cleanup: translate string instead of variable

cleanup: sort imports

cleanup: translate string literal only

Kubernetes-commit: cc8428566ea7160c5b20410a1bee53ca7ddb998e
2020-10-09 13:16:13 +02:00
Marek Siarkowicz 01f27135e8 Add datapolicy tags to staging/src/k8s.io/kubectl
Kubernetes-commit: 4b29b03573ff66c32224672d9e7e4c1dbfe2c414
2020-10-29 18:11:22 +01:00
Eddie Zaneski 951c0caa13 Add get-users and delete-user to kubectl config
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 95b189fd8f69812738ba9ea472237ab946863d23
2020-04-03 16:41:46 -06:00
Maciej Szulik e80cf9ce71 Use temporary directory when creating temporary file in tests
Kubernetes-commit: a7529f4cd90ea6f662e1398608eccd86e886026f
2020-07-17 10:41:16 +02:00
Brian Pursley 7ed1bb5485 Changed kubectl config set-cluster and set-credentials to support process substitution for filenames
Kubernetes-commit: 84d5e664afb809b92c31a4c36acb2baa1fc8649e
2020-05-15 09:22:59 -04:00
Brian Pursley 1a80e2e210 Changed kubectl config view to redact token
Kubernetes-commit: 6fad4ee5e5f5fa6fbf38e88f165b012fa0ae5795
2020-03-17 15:13:50 -04:00
David Eads 257e232d28 update override behavior for kubectl --tls-server-name
Kubernetes-commit: 9dcbc0bf909a794cf77a801bfd29e306791b1e24
2020-03-03 13:16:50 -05:00
Suresh Kumar Ponnusamy 55c8634c3c Support TLS Server Name overrides in kubeconfig file
Signed-off-by: Suresh Kumar Ponnusamy <suresh.ponnusamy@freshworks.com>

Kubernetes-commit: 37c81ed79ac6836bce4b96f888aa407dc18d747c
2019-08-28 10:51:14 +05:30
drfish 5aa1be61e1 Staticcheck: vendor/k8s.io/kubectl/pkg/cmd/exec|config|certificates
Kubernetes-commit: a14ceeb2c00d8048ce05ad199c919bdab6fb6954
2020-01-23 14:03:11 +08:00
Hidetake Iwata 0f70b0c27b Fix example of kubectl config set-credentials
Kubernetes-commit: 0368a7d5f7acea476f4adcd85ea037cfe24ccd3f
2020-02-12 21:11:24 +09:00
Tim Allclair 6fca42a14a Ensure testing credentials are labeled as such
Kubernetes-commit: 9d3670f3586c98c02cdca93b7c98dd91fc0b87bd
2020-02-04 10:36:05 -08:00
Sean Sullivan c6a8c8a72e Removes duplicate TabWriter. Several updates to reference the one remaining TabWriter in cli-runtime.
Kubernetes-commit: 958d7d3b6e74b8648fb897ce09f52049eb9823a1
2019-10-17 13:32:40 -07:00
Sean Sullivan c6063dd846 Move pkg/kubectl/cmd/{command} to staging
Kubernetes-commit: 0e0ea523392f1121f61f99ac30a9bc2043eaed90
2019-08-01 11:01:40 -07:00