Commit Graph

1455 Commits

Author SHA1 Message Date
Kazuki Suda be4495d187 Revert shorthand for kubectl explain --output
Kubernetes-commit: 060a4985376ecfa3dd277ff8fe63e6158041c32e
2025-05-26 12:16:24 +09:00
Taha Farahani 343265002b Automated cherry pick of #130503: Unhandled panic crash on rollout_history printer.PrintObj (#131496)
* 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: cce99a8c73a32c6dff31768c4757968440ef91c3
2025-05-14 12:45:57 +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
ndixita 9a565d149e QOS changes for Pod Level resources
Kubernetes-commit: 26f11c458620751733250b35d1f60c9ed2a96e57
2024-10-30 01:24:36 +00:00
ndixita 1f9df3421a Adding support for pod level resources in kubectl
1. Add support for pod level resources in kubectl
2. Reuse the existing method to describe container resources and generalize it to describe both pod and container level resources

Kubernetes-commit: 502e0f55c43291af800e8633760d461343bd39b3
2024-10-24 21:13:54 +00:00
Omer Aplatony 2bb31e1a0f Replace PollImmediate with PollUntilContextTimeout (#128147)
* Replace PollImmediate with PollUntilContextTimeout

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

* Add context to RetryErrorCondition function

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

* lint: fix error comparison in scale package

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

* Fix RetryErrorCondition function signature

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

* revert to if err statement

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

---------

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

Kubernetes-commit: 9d816f1587c918e7acae6d9195d33606aec998b1
2024-11-07 16:57:29 +02:00
AxeZhan 4657409ea3 consider sidecar containers in maxContainerRestarts
Kubernetes-commit: 7533123eb5e7c6ecd59d00d236235581f7f1157b
2024-05-19 23:50:25 +08:00
Anish Shah b22c40d47c kubectl: remove subresource restrictions from all commands
Removing this restrictions will allow us to use these commands with the
new resize subresource.

Kubernetes-commit: e1ca63489f2b788f893ab37a27242ce319e1eaf6
2024-10-31 16:00:52 -07:00
Tim Allclair af49e676b2 Stop using status.AllocatedResources to aggregate resources
Kubernetes-commit: 81df1958196e04f04d038e5ec9e2025989a30b29
2024-10-25 21:18:19 -07:00
ah8ad3 e4a11c9548 realign line breaks in kubectl exaplin wrap method
Kubernetes-commit: 008f17419a0decbb82985a74a730a8b60ed07e5d
2024-08-04 10:02:17 +03:30
Omer Aplatony dc6975b78c port-forward: fixed error handling for empty remote port
Signed-off-by: Omer Aplatony <omerap12@gmail.com>

Kubernetes-commit: c01a8a51af10811e182be896795168bbd561c7e9
2024-10-26 14:24:09 +03:00
Davanum Srinivas 69f03b081e Drop go-colortext and its usage
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: d450b6e653a8dcf11f28822eadea379734b3f53d
2024-11-01 09:55:42 -04:00
Omer Aplatony bb485d40d9 kubectl: add test coverage for autoscale command
Signed-off-by: Omer Aplatony <omerap12@gmail.com>

Kubernetes-commit: 6cb17d85a550ce8237f8542a9e59fdd03973c7d6
2024-10-31 14:26:15 +02:00
Monis Khan 1014b1d5f2 Fix tests that assume core clients use JSON
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 6595fa40268bc8e7f46dcc28267e5e8b0b1ae493
2024-08-19 10:38:16 -04:00
Yihao Wang 9a6ad3e08e Fix typo in i18n usage examples
Kubernetes-commit: e9c30951051b66bb5050d0d5bf622d4ef7a4481c
2024-01-17 13:12:21 +13:00
Arda Güçlü 4c8c153513 Wire context to logs command and add interrupt handler (#127503)
* Wire context to logs command and add interrupt handler

* Move conditional outside of interrupt handler

Kubernetes-commit: 5826868586d501060a6151d04c511236b11a26d4
2024-10-22 21:49:06 +03:00
Arda Güçlü 484ede079f KEP-4292: Add e2e test for custom profile in kubectl debug (#127187)
* Remove KUBECTL_DEBUG_CUSTOM_PROFILE env var

* Add e2e test for custom profile in kubectl debug

* Keep feature flag until 1.33

* Update comment

* Simplify tests by relying on test framework functionality

* Rename import alias to better to pass verify-import-alias

Kubernetes-commit: 1caf9a150b794a7c4a17e63a54b902ec0b0be570
2024-10-22 21:48:59 +03:00
Maciej Szulik 80dc149179 Fix spacing in --validate flag description
Kubernetes-commit: 7b0660ec9f572c7b8c964c5447aa9169684f9a2b
2024-10-15 11:16:33 +02:00
googs1025 c90e4a0fd8 bug(kubectl): return resource builder error in scale cmd
Kubernetes-commit: 8d084809296a845f01a0a1177bb0bf825f498d84
2024-10-14 18:25:13 +08:00
Omer Aplatony c329ccff7c Update waitForDelete to use PollUntilContextTimeout
Signed-off-by: Omer Aplatony <omerap12@gmail.com>

Kubernetes-commit: bba055067e6283f94ee05cedeb33dacafe4a1094
2024-10-05 22:07:37 +03:00
Akash 4106fc8791 Added shorthand for explain --output
Removed short flag example

Kubernetes-commit: 923a41370dc85062241fa149edda1307a16910e2
2024-10-05 03:19:57 +05:30
koba1t 983dddad9d Update kubectl kustomize to kyaml/v0.18.1, cmd/config/v0.15.0, api/v0.18.0, kustomize/v5.5.0
Kubernetes-commit: e7daa708520502cb375945af117b9e647acf5014
2024-10-09 23:32:45 +09:00
Stephen Kitt 0f462824c7 Use sigs.k8s.io/yaml instead of gopkg.in/yaml
Since we have a Kubernetes-specific fork of go-yaml, use that
consistently throughout the project. This doesn't eliminate the
dependencies on gopkg.in/yaml, which are still used indirectly; but it
ensures that the whole project benefits from fixes or changes to
sigs.k8s.io/yaml.

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

Kubernetes-commit: f1fa4086b329376861272708d81da7988e8c4ad0
2024-10-07 14:27:52 +02:00
Josh Soref 209732ca71 chore: Order ScalingReplicaSet message from->to
* change format of event
* include `from 0` for new replicas
* update describe tests to reflect current output

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

Kubernetes-commit: 502c05ed019573e8ed43c412f739882eec0f5f7c
2024-05-24 12:18:06 -04:00
zhifei92 f3a7f811d0 fix: kubeclt describe service endpoints shows endpoints that are not ready
Kubernetes-commit: 64e2066e5c823eaa958fcbdd6024d0253688f36c
2024-08-27 12:42:37 +08:00
David Eads d6ad8b12b7 add --subresource to kubectl apply
Kubernetes-commit: 55ba8b2cbb375aaedcd01dd5d4dd0f81ef0415bf
2024-09-25 17:23:09 -04:00