Commit Graph

1478 Commits

Author SHA1 Message Date
Stephen Kitt abe43f6e92 kubectl: drop dependency on github.com/pkg/errors
The package is unmaintained, and kubectl doesn't rely on the
functionality it provides on top of Golang errors (stack traces).

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

Kubernetes-commit: 54b2fad0330032ae1bbac990f93a3644aa8a12af
2025-05-26 10:44:46 +02:00
Kazuki Suda bb9c5182ea Revert shorthand for kubectl explain --output
Kubernetes-commit: df2857e7777f18c482359cfb43a72a3cdfd89646
2025-05-26 12:16:24 +09:00
Maciej Szulik 46d6f63709 kuberc: make update and update-vendor
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 76f95271a5d563ea31edbcd8f0e8eebf67cb3634
2025-05-15 14:15:20 +02:00
Maciej Szulik 8500d2979d kuberc: introduce fuzzing for kuberc types
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: c29accaf5819bd4b05409cecb9bbb3ba065d840b
2025-05-16 13:45:37 +02:00
Arda Güçlü ca5a831a47 Promote kuberc to beta
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: b0370c483af1bdbc1e2664f53445411c585c4559
2025-05-06 12:52:20 +03:00
Maciej Szulik b011cffff8 kuberc: pick the first known version when decoding + tests
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 1f355e5b44141be55da269a9183d53bbccd16c95
2025-05-15 16:24:43 +02:00
Maciej Szulik cb7efba696 kuberc: align internal and v1alpha1 go-types with v1beta1
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 0341b27c5d0dfb1d10818c9976f54af22971bedc
2025-05-21 13:32:37 +02:00
Maciej Szulik 2be4847754 kuberc: add v1beta1 types
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 39195f9a463cce6b3ce4e3d9f648c2915407596d
2025-05-15 14:14:59 +02:00
Maciej Szulik 47f13bd18b Deprecate kubeconfig's preference field in favor of kuberc
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 8cf5e8db78deb186ef362f64ab779c09e9520156
2025-05-13 13:39:13 +02:00
Omer Aplatony 5ff92a69e3 Kubectl: check version skew (#127365)
Signed-off-by: Omer Aplatony <omerap12@gmail.com>

Kubernetes-commit: 35307319740a3a52cf4632c24b7f99d675537bdf
2025-05-19 20:19:14 +03:00
Maciej Szulik 52ec1da081 Add comment describing the feature gate with a link to KEP
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 9e3a1b0a9081ab49bbc44c415525dce862eb6a12
2025-05-08 14:43:24 +02:00
Maciej Szulik 307936eb9d Swap KUBECTL_COMMAND_HEADERS to use the proper feature gate mechanism
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: e3f3da5e795960508089aed08fe7fd9bec0a6db2
2025-05-08 14:09:17 +02:00
Maciej Szulik 90ee929b88 Drop KUBECTL_ENABLE_CMD_SHADOW featgure gat entirely
https://kep.k8s.io/3638 has been promoted to stable back in 1.32 so now
is the right time to drop this feature gate entirely.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: d1b5f268b48eda4bb8acdeef52407c27add9e076
2025-05-08 14:05:19 +02:00
Maciej Szulik d35aa2c630 Manually read verbosity before kubectl command construction
kubectl command construction is slowly getting more functionality which
sometimes requires to log certain actions. Currently we parse the
verbosity only when actually running the command, so all of construction
code is not able to use -v=5. This commit adds the manual parsing and
loglevel setting berore we even start creating the kubectl command.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 69682b75e508462e01f865a156f2171233b653d1
2025-05-08 13:29:11 +02:00
Arda Güçlü 5bcd2add11 Drop KUBECTL_DEBUG_CUSTOM_PROFILE feature gate entirely
Kubernetes-commit: 94d043b149b845a4f02f12a3d318df278194d377
2025-05-06 13:00:14 +03:00
Arda Güçlü b0f5f0c0aa Continue alias creation when __completion is used to enable completion
Kubernetes-commit: f6d0498017fc71c72891ad9455c4391aa63c6e71
2025-05-02 13:23:22 +03:00
Jordan Liggitt 722397942b Drop null creationTimestamp from test fixtures
Kubernetes-commit: 6bb6c9934294d8265197c9dfc4c9dd3adaca147a
2025-03-24 09:37:26 -04:00
Ondra Kupka 4627533853 kubectl describe service: Add Traffic Distribution
Kubernetes-commit: ad40bc88568bdb19fdba0b960755bd014b2ae5e5
2025-04-26 18:02:19 +02:00
Rodrey ae92d5f0bd Add more test cases to TestDescribeSecret test (#131422)
* Converted to parameterised tests.

* Added test case for sorting with casing.

* Formatted code.

* Added test case for keys that contain numbers.

Kubernetes-commit: 74e84dbf5a339a3830ddd172fe8767ca0952cbb8
2025-04-24 20:10:05 +00:00
Arda Güçlü 399c585899 Increase kubectl cp command timeout to 30 seconds
Kubernetes-commit: 9c228e81d2481150878ca3a431f0ec9a8f150b3f
2025-03-28 12:39:01 +03:00
Arthur Diniz 5b96de1a99 Set LANGUAGE env variable in TestDiffProgram for consistent locale behavior
Signed-off-by: Arthur Diniz <arthurbdiniz@gmail.com>

Kubernetes-commit: bad6c7e4cc5aef010c2fe2abfcbe51a138a04700
2025-03-21 17:28:41 +00:00
Taha Farahani 46f95a7c68 Unhandled panic crash on rollout_history printer.PrintObj (#130503)
* Change: Handling nil runtime.Object

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Return only if there is error in rollout_history

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Return the unknown revision error directly in rollout_history.go

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Remove unintended newline

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Using go idiomatic way for checking if historyInfo[o.Revision] exists

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Remove 'error:' from returned error message in rollout_history.go

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Check for printer.PrintObj returned err

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Add TestRolloutHistoryErrors test

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Simple typo fix on Complete() function description

Signed-off-by: Taha Farahani <tahacodes@proton.me>

* Change: Checking for error on o.Complete in TestRolloutHistoryErrors

Signed-off-by: Taha Farahani <tahacodes@proton.me>

---------

Signed-off-by: Taha Farahani <tahacodes@proton.me>

Kubernetes-commit: 609e4a9ba044e64a6244e053d2b1b7c545a2d2ed
2025-04-24 00:01:14 +03:30
Harald Nordgren 6c0aa1995f pr fix
Kubernetes-commit: 4e3026fdb81667fd5a9fe928736b6e4d67b225e5
2025-04-14 15:59:45 +02:00
Harald Nordgren 3a69c59961 kubectl: sort secrets alphabetically to avoid random order
Kubernetes-commit: 7d6f86594fc0a7d09710c643de63b24cdcb98e65
2025-02-20 13:28:55 +01:00
mochizuki875 81562142de Add warning message for attach
Kubernetes-commit: 97dd6dc284682d76fe7e0bc51df851473deee24f
2024-09-06 02:31:14 +00:00
Tim Allclair f38b1de6c2 Consider AllocatableResources when computing pod requests
Kubernetes-commit: c2927727107cc8123c2688ea571f464650df6b2b
2025-03-17 21:23:32 -07:00
Arda Güçlü 246e544fc4 Add completion in kubectl debug
Kubernetes-commit: 533a1211d30b42c4cb485468562e7712dc7f83c7
2025-02-07 13:44:21 +03:00
Keita Mochizuki 5cbdedb625 kubectl debug: Display a warning message that the debug container's capabilities may not work with a non-root user (#127696)
* Add warning message about capabilities of debug container

* fix1

* fix2

* fix3

Kubernetes-commit: 07a275437f304456b2a32159ec6550a71d020a64
2025-03-19 10:15:57 +00:00
Natasha Sarkar ed22800c0c Move pod resize status to pod conditions
Kubernetes-commit: a15520fbeaf458e2fc0f2be6e1ae0f9572369495
2025-03-17 22:01:05 +00:00
icylord 88b66ece35 kubectl: Remove duplicate selector calculation logic and add missing test cases for the 'describe DaemonSet' functionality
Kubernetes-commit: 3e48d143fa9d31bd690165109c79b413c67d5966
2025-03-15 17:07:44 +08:00
Maciej Szulik e4ccb76c1a kubectl: expose context parameter in DefaultRemoteExecutor
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 78e58b8c49fdcddba8cf939e5327440791c73a91
2025-03-12 15:51:13 +01:00
Tim Hockin 4ccb6a52b9 Fix dup word in API doc
Kubernetes-commit: ec66befdcb2c2cf906e5321378ffd8edcccaeae6
2025-02-19 16:51:11 -08:00
Maciej Szulik 7f2f474232 Update kubetl subresource to stable
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: de984ec9b92bcf6ff17060b1cdecdd8fd948bcbb
2025-02-18 14:28:59 +01:00
Arda Güçlü 2e38fc2204 Introduce kuberc as new flag to customize defaulting and define aliases in kubectl (#125230)
Kubernetes-commit: c7a90b670c40a315bea3667921302675008bc39c
2025-02-12 00:39:09 +00:00
vivzbansal 79fb20cb8b Resolved latest review comments
Kubernetes-commit: 5889da1bbc7a3e515bf6e3d5ca35d600020ff046
2024-12-17 07:56:13 +00:00
Maciej Szulik d74f0e1af1 Switch from using a function to just pure map in create token
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 87139335b0e6ce5f5bc08d860a870fb9f16392b2
2025-01-23 13:10:06 +01:00
Maciej Szulik 1ab40ed1c8 Finish extracting ExplainFlags structure
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 3030b1dc6a445929c20dc911196746c2d8af2bac
2025-01-23 13:09:19 +01:00
PuneetPunamiya bcafb59748 Refactors explain command to split flags from options
Signed-off-by: Puneet Punamiya ppunamiy@redhat.com
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 91afef615ad918cfc364bf5e6d12a96785f2acaf
2022-10-20 12:48:15 +05:30
Antonio Ojea 064a840924 describe servicecidr and ipaddress v1
Kubernetes-commit: e3b39758215f152fe59e94b86d1c6db3320103f5
2024-11-26 03:35:16 +00:00
gshaibi 3e68cbc2c4 [kubectl] Enhance describe output for projected volume sources to indicate optional Secret/ConfigMap (#129457)
* kubectl: enhance output for projected volume sources to indicate optional secrets

* .

Kubernetes-commit: 4114a9b4e45a4df96f0383d87b2649640a6ffbf1
2025-01-06 15:50:16 +02:00
lixiv be364695f5 Add tests for kubectl qos (#129388)
* Add tests for kubectl qos

* Update staging/src/k8s.io/kubectl/pkg/util/qos/qos_test.go

Co-authored-by: Arda Güçlü <aguclu@redhat.com>

---------

Co-authored-by: Arda Güçlü <aguclu@redhat.com>

Kubernetes-commit: 215d0b094b686ae0ad83a8f2d3078e5860a979ba
2024-12-30 09:06:10 +00:00
googs1025 e2968fb8ad feature(kubectl): use autoscalingv2 in kubectl autoscale
Kubernetes-commit: a87dd67a3c89612828d613cd71828a906b4d7c3c
2024-11-23 21:43:29 +08:00
Omer Aplatony 120105a0a9 kubectl: add test coverage for cordon command (#129202)
* kubectl: add test coverage for cordon command

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* using cmp.Diff

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

---------

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

Kubernetes-commit: 3ec97a445f036a38bfec6291dee661954138bac9
2024-12-17 06:34:43 +00:00
Patrick Ohly 348f12d905 remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".

Kubernetes-commit: 8a908e0c0bd96a3455edf7e3b5f5af90564e65b0
2024-12-02 14:43:58 +01:00
Victor Franzi 40fde549ca docs: `-l/--selector` example for set-based requirements
add an example of set-based requirement when using `-l/--selector` as it's a (less known) filtering capability: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#list-and-watch-filtering

Kubernetes-commit: 8f48a82e6ed9fd19601ad8c32a5f1b55b4299fb0
2024-12-06 12:03:48 +01:00
Arda Güçlü 61dc2ecb38 Use generic Contains rather than deprecated ContainsString
Kubernetes-commit: 8312c3ec242faf30f3967e59465ca5a764a4ee85
2024-11-25 11:30:04 +03:00
Arda Güçlü 608a0553d7 Use generic sets rather than deprecated sets.String
Kubernetes-commit: c3f15fd707a092e6cb7d96b84b81ada1f118d759
2024-11-21 13:22:39 +03:00
Omer Aplatony 56c9d286fe kubectl: fix wait --for=create to work correctly with label selectors (#128662)
* kubectl: fix wait --for=create to work correctly with label selectors

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* Add unit test

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* add integration test

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* Increase wait time to 40 seconds

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

---------

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

Kubernetes-commit: 0cc926220067cd814cecd8f3d0c3b9235e6a68db
2024-12-12 06:49:46 +00:00
alingse 92bb3cdeda fix: fix miss makezero bug (#125132)
* fix: fix miss makezero bug

Signed-off-by: alingse <alingse@foxmail.com>

* add testcase for new verb

* Update create_role_test.go

---------

Signed-off-by: alingse <alingse@foxmail.com>

Kubernetes-commit: 5b06498cb24ee68dbc2815a1d9fa505da3452d98
2024-12-12 10:56:37 +08:00
ah8ad3 7ff7f80add Revert PR #126533 and add a test case for the case where there is yaml
structed texts in the description.
We should find a way to both relign line breaks and not break these kind
of texts.

Signed-off-by: ah8ad3 <ah8ad3@gmail.com>

Kubernetes-commit: 7580e6ac00b00cf6e7ba375a3730e0dccbf40463
2024-11-12 14:23:03 +03:30