Commit Graph

120 Commits

Author SHA1 Message Date
James Munnelly b57bb4f06e KEP-4193: promote ServiceAccountTokenNodeBinding feature to beta
Kubernetes-commit: 5481e630dea4c57c31b65a4fadf1bbeca77c2c57
2024-05-31 12:16:03 +01:00
Brian Pursley df7520c1f3 Fix inconsistent validation of -f or -k flag in kubectl create command
Kubernetes-commit: 4fddd6a3cda9c95c8ae5b4a36d3c3fb06aa1dce1
2024-05-22 15:36:28 -04:00
Brian Pursley 8d8b5a6120 Use ptr.To instead of deprecated pointer functions
Kubernetes-commit: 288d132cf62efe029b6359c600565f8c7b12647d
2024-05-20 16:14:54 -04:00
Arda Güçlü 2e9d71e05d kubectl create cronjobs: Manually set OwnerReferences
Kubernetes-commit: 11c0c8bb705f3c4f5dac00f8b0ddbec6a95cd7aa
2024-05-15 13:31:31 +03:00
carlory 7f19a8d4f7 fix unusable secret manifest for type docker-registry
Kubernetes-commit: c12e12bd89570979efd7798a3a809228d36e7ec3
2023-07-26 18:08:01 +08: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
ah8ad3 0184416a0c cleanup: add zero as a value for token create duration and act as default, added test, updated the help text
change duration validator text message in create token

unit bug fixed

Kubernetes-commit: 3b5a79f6471309055090b123a6f88197217e9276
2024-02-28 21:52:58 +03:30
Mohammed Yasin 3e5acb915d fix: create tls secret cert to crt for --cert flag
- Fixed help message for crete tls for --cert flag
- Renamed to "cert" to "crt"

Signed-off-by: Mohammed Yasin <yasindce1998@gmail.com>

Kubernetes-commit: 2203cb7dde8196da4e769d7f7a99918f2c7bb6d3
2023-12-29 06:19:28 +00:00
Ritikaa96 54c3cc2496 making suggested changes
Signed-off-by: Ritikaa96 <ritika@india.nec.com>

Kubernetes-commit: 9efff41b8e0103361cd7b8a41dc9641638c5a292
2023-11-30 13:09:54 +05:30
Ritikaa96 b32cbdf03a Updated descriptions in kubectl create deployment help , added example for multiple images
Signed-off-by: Ritikaa96 <ritika@india.nec.com>

Kubernetes-commit: 76919e9569746e4e1ae0ec190892af3a142553c9
2023-09-04 13:53:57 +09:00
James Munnelly 468fb1fd0c KEP-4193: bound service account token improvements
Kubernetes-commit: 76463e21d4dec90b4d49975b182a13e1fdb6b20a
2023-09-19 15:23:28 +01:00
SataQiu 582f2b8418 kubectl: ensure '--duration' must be positive for 'kubectl create token' command
Kubernetes-commit: 4a8267f26bea6d47801ea8a18bf2635443de1a46
2023-10-07 11:19:33 +08:00
Andrea Hoffer b676723184 Update CLI help text for grammar and consistency
Kubernetes-commit: a86380c7813a6d0cfa248c9165c878038730526a
2023-06-12 15:55:59 -04:00
carlory f4c3a1c36a fix Cronjob status.lastSuccessfulTime not populated by a manually triggered job
Kubernetes-commit: f2a64cb91d7cf7216db60c2e1c8b1e530c85f94f
2023-06-07 19:01:51 +08:00
TommyStarK e88f1b3589 kubectl: use bytes.Buffer.String
Signed-off-by: TommyStarK <thomasmilox@gmail.com>

Kubernetes-commit: da4a8d831b933475cfdb20cb7e6d0ed027d516eb
2023-06-04 15:45:24 +02:00
LronDC 22b4cf895f Optimize usage message of commands which have subcommands.
Signed-off-by: LronDC <lun.su@daocloud.io>

Kubernetes-commit: 15678e4a67e1b725368ca1bd3a97b670c5d97776
2023-05-10 18:10:28 +08:00
Stephen Kitt cfd2169f88 cli: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 45836971f27ca70cd7742e8ee66e99e3c648cf9f
2023-03-14 16:17:48 +01:00
Chris Bandy facdb16b53 Replace os.Setenv with testing.T.Setenv in tests
T.Setenv ensures that the environment is returned to its prior state
when the test ends. It also panics when called from a parallel test to
prevent racy test interdependencies.

Kubernetes-commit: 2181eea48435310d1b6e366ea8db2968c4941b93
2023-04-15 10:09:47 -05:00
charles-chenzz 0d2299217d reduce util pkg for testing in tempdir.
Kubernetes-commit: aaa30439bdda1589eacc7be8547c297a73e346b9
2023-04-18 11:18:10 +08:00
Tim Hockin c131fb884e Replace uses of ObjectReflectDiff with cmp.Diff
ObjectReflectDiff is already a shim over cmp.Diff, so no actual output
or behavior changes

Kubernetes-commit: bc302fa4144d21a338683cd83701661f97be4aba
2023-03-23 11:34:03 -07:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
Brian Pursley a2ae001d8e cmd/get: Remove cmd argument from Run()
Removes the need to pass cmd as an argument to Run(). This change required reading the --sort-by flag in Complete() in a way similar to other flags.

This change allows the cobra.Command not to need to be passed throughout the completion code, which I updated as part of this commit.

It also is a step in the direction of the TODO comment requesting the removal of arguments passed to Run() and watch().

Kubernetes-commit: aa7a828f20b479a8a943d897224e8e76c3bb6cff
2022-12-23 14:56:59 -05:00
Shuang Wang 58a69e79d3 rolebinding often used for serviceaccount (#107124)
* rolebinding offen used for serviceaccount

* fix syntax error

* fix syntax error

Kubernetes-commit: 8c97443b7b5269e3e96ce31e82e0744219917252
2023-03-07 16:59:35 +00:00
Sean Sullivan e5c05deb7b Refactor to simplify factory Validator
Kubernetes-commit: 5e8648b9f1cdbcbb10f22fd46b6ac40dbc471de2
2022-12-11 18:20:28 -08:00
Sean Sullivan 6dde41fea6 Removes unnecessary dry run verifier
Kubernetes-commit: 530f65d6fd5af81c0691143fbf2c00d440476bb9
2022-12-05 16:25:12 -08: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
cndoit18 c688132ac9 style: remove redundant judgment
Signed-off-by: cndoit18 <cndoit18@outlook.com>

Kubernetes-commit: ec43037d0f57fdfc2fdc4960fdb8a7e31ac79fae
2022-07-29 18:25:05 +08:00
Abirdcfly 3614667477 cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: 00b9ead02c37921011ebe5293558cea5277cd295
2022-04-24 20:58:04 +08: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
Shubham Kuchhal e767a9773e Update rs.extensions to rs.apps
Kubernetes-commit: ce17a027477efd933775e320b1ce6c3876c136c3
2022-03-29 16:40:28 +05:30
Shubham Kuchhal bb7ded5a2e typo fix.
Kubernetes-commit: d350eb75d62bc51290826b94aa1d89bb6137595b
2022-03-30 18:57:43 +05:30
Shubham Kuchhal 32aa8d698a Updated the user and group flag.
Kubernetes-commit: bf77c2c3e7cdd67079742996cf47bac1003ffc26
2022-03-30 13:03:05 +05:30
Shubham Kuchhal 357211463f Improvement: Updated the serviceaccount flag for multiple subjects.
Kubernetes-commit: 3aa53c99a99f4dfe7d2e0faf2bf51e8252359e8d
2022-03-11 11:40:30 +05:30
Maciej Szulik 9ca2ff9172 Allow adding new verbs in AddSpecialVerb
Kubernetes-commit: 790396caba63f18ac529cf381b405390b62ad3e7
2022-03-28 12:49:02 +02:00
Rey Lejano b062628db1 updates for kubectl generated ref docs
Kubernetes-commit: 37a86e3e33349baa8fdfd25506dddb6009973337
2022-03-25 12:31:12 -07:00
Kevin Delgado 61f42e595f add server-side validation support to kubectl
Kubernetes-commit: fe3772890f650f9bcf020b43dc5a51fab0fa17f4
2022-03-09 14:52:32 +00: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
Monis Khan f315a5dd88 kubectl create token: use duration instead of expiration seconds
Expiration seconds is great for an unambiguous REST API.  It it not
a great input for a command line meant to be used by humans.

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 6b9d556c9dc1fca37349833d38f8921f436e1874
2022-03-18 16:11:13 -04:00
Kevin Delgado 7e681490ec Generalize dry run verify to arbitrary query param
Kubernetes-commit: d6c83281bc696474a76365a879f2255b8b568786
2022-03-09 14:51:50 +00:00
Jordan Liggitt 344e97b543 Add command to request a bound service account token
Kubernetes-commit: fca9b1d9fcc7288ecb93c969ff9907a5def2dc9e
2022-01-31 11:46:50 -05:00
Aram Peres 8e80d8fd7e Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar'
Kubernetes-commit: 8f8138bc35f59ef04b77a3520d8d1065603ccdb7
2022-01-06 23:28:44 -05:00
Ricardo Katz 36401bb108 fix nil pointer in create secret commands
Kubernetes-commit: 50015c2da621ecaee581f64f737aa2e527905f14
2021-12-25 21:24:21 -03:00
Ross Peoples 88ea823a7a Allow create.specialVerbs to be customized
Kubernetes-commit: 9b2f24aee0668ef54e7f51acc79e51b93f1aedb3
2021-12-16 13:08:28 -06:00
Chok Yip Lau aed179d9d5 Fixed nil pointer dereference
Kubernetes-commit: c337857673e60a44bbdbef9afcbce5b0245b81ec
2021-11-10 12:41:39 -05:00
Shin'ya UEOKA 791e7f9d0b test: Assert max unavailable for PDB test cases
Kubernetes-commit: 5c76507c3f9dd84dd3a56b39a45f99da1735bfed
2021-10-28 05:20:03 +00:00
卢振兴10069964 165827de9c code cleanup for kubectl
Kubernetes-commit: 17993020cdca7eea2fb96a993e048d2d0624fa40
2021-04-12 10:45:08 +08:00
Chok Yip Lau fad6761bba Improve configmap test
Kubernetes-commit: fa7ad6e4657769f767e3a34407cb6ad327d5259c
2021-09-03 15:54:11 -04:00
Chok Yip Lau 5d2f1d8a56 Added support for multiple --from-env flags
Kubernetes-commit: 9a13bae5108beb113dd0ca5605f4adeeac127915
2021-08-09 00:05:43 -04:00
Chok Yip Lau 95dc04b3b3 Added support for multiple --from-env flags
Kubernetes-commit: 99bc2b077fd208885e76281ab8865f1e85f0abb8
2021-04-29 19:16:59 -04:00
Andrea Hoffer 09ed00ef49 Minor adjustments to descriptions and example text
Kubernetes-commit: 6b736f348483bb6b20d4633319305960f4d9e4c1
2021-07-06 15:05:26 -04:00