Commit Graph

3458 Commits

Author SHA1 Message Date
Patrick Ohly 044351a519 dependencies: update klog v2.90.1
This improves performance of the text formatting and ktesting.

Because ktesting no longer buffers messages by default, one unit
test needs to ask for that explicitly.

Kubernetes-commit: 961819a4d09488e20931103e0c36d2bed588fdcb
2023-01-23 18:19:54 +01:00
Kubernetes Publisher c2ac561fed Merge pull request #115988 from justinsb/prunev2_add_labels
prunev2: Add labels for objects that we apply

Kubernetes-commit: a023a5eb17471410ec0b07cd6c78bdd356820875
2023-03-01 05:40:10 +00:00
Justin SB 78b973156e prunev2: Add labels for objects that we apply
As we apply objects when using apply/prune v2, we want to be sure they
include the label that ties them back to the applyset they are part
of.

Co-Authored-By: Katrina Verey <katrina.verey@shopify.com>

Kubernetes-commit: ab058308401b35b4865424cfa43ed75a554af2a3
2023-02-22 22:06:48 -05:00
Katrina Verey 530dea246b Introduce CLI for ApplySet-based pruning (#115979)
* Introduce CLI for ApplySet-based pruning

* Address feedback from justinsb

* Fix parent namespace sourcing and restrict types. Increase test coverage.

Kubernetes-commit: 0dd346673c00158247c8232f9e81a308fb741463
2023-02-27 12:20:40 -05:00
Kubernetes Publisher c80bfb61bf Merge pull request #115953 from pohly/lint-gomega
test: fixing + linting gomega usage

Kubernetes-commit: 015e2fa20c2e08d78e5772c2d0eea00500843e4b
2023-02-27 09:38:51 +00:00
Kubernetes Publisher 246ecbce3d Merge pull request #115784 from seans3/openapi-fake-client
Refactor to use openapi fake client

Kubernetes-commit: 5961d8ce1bb4eb6537f7ca3b3eaf7fd9d5cd2595
2023-02-24 05:46:35 +00:00
Patrick Ohly 3dc5e5ffdf test: fix ginkgolinter issues
All of these issues were reported by https://github.com/nunnatsa/ginkgolinter.
Fixing these issues is useful (several expressions get simpler, using
framework.ExpectNoError is better because it has additional support for
failures) and a necessary step for enabling that linter in our golangci-lint
invocation.

Kubernetes-commit: 41f23f52d09689ede3540b8bd3ef7ec4f09410a1
2023-02-22 10:35:09 +01:00
Sean Sullivan 321eced643 Refactor to use openapi fake client
Kubernetes-commit: e352d94e45cdd7f92574ac02e37fc3ab78a34798
2023-02-14 18:00:08 -08:00
Kubernetes Publisher 293136c4d6 Merge pull request #115571 from ardaguclu/diff-prune-l-test
Add integration test for diff --prune --selector

Kubernetes-commit: 1bc34fe3396f39b7b816deb1f9bdb8a2b7a3d95e
2023-02-20 13:38:45 +00:00
Kubernetes Publisher 4ee3cae7f8 Merge pull request #115839 from wedaly/kubectl-netadmin-unit-test-followup
kubectl: add unit tests for kubectl debug profiles

Kubernetes-commit: 1d02d014e8c1f0de84b0b58b2165548182815320
2023-02-20 09:38:17 +00:00
Kubernetes Publisher 060672725b Merge pull request #115809 from seans3/openapi-file-client
New openapi v3 testing file client

Kubernetes-commit: 1c97dbc8c9096495706b1e141b0fe256ff3185e9
2023-02-17 21:41:13 +00:00
Kubernetes Publisher 04af20f5a9 Merge pull request #115837 from wedaly/kubectl-netadmin-pointer-bool
kubectl: use pointer.Bool instead of deprecated pointer.BoolPtr

Kubernetes-commit: 4c4f0c3a2011bd01c01b8e3828bea9f57da5b12e
2023-02-16 21:46:32 +00:00
Kubernetes Publisher 23fbd26fb5 Merge pull request #115604 from pacoxu/fix-design-proposals-links
old design proposals are now moved to Design Proposals Archive repo

Kubernetes-commit: ffe410bbb4e43ba7b7ceaec379709575e817d866
2023-02-16 21:46:31 +00:00
Will Daly bfae4f6bfd kubectl: add unit tests for kubectl debug profiles
Unit test netadmin profile preserves existing capabilities.
Unit test debug profiles in TestGenerateNodeDebugPod
Unit test debug profiles in TestGeneratePodCopyWithDebugContainer
Organize Go imports in unit tests

Signed-off-by: Will Daly <widaly@microsoft.com>

Kubernetes-commit: 21e8d2958190e9813fe1122d1e7a91e8143a5193
2023-02-16 06:38:12 -08:00
Will Daly ffa6cc1628 kubectl: use pointer.Bool instead of deprecated pointer.BoolPtr
Signed-off-by: Will Daly <widaly@microsoft.com>

Kubernetes-commit: 4101b796063942fa2d7bb04e9252a4725a834c88
2023-02-16 06:35:23 -08:00
Kubernetes Publisher cd833457db Merge pull request #115712 from wedaly/kubectl-netadmin-debug-profile
kubectl debug: add netadmin profile

Kubernetes-commit: 6a5c88b9dd0a0e9ef0115d1bbcb196284777832b
2023-02-16 09:08:38 +00:00
Paco Xu c7d11433fb API docs: point to current docs instead of archived designs
Kubernetes-commit: 3d536bd14bba0586f20d1d96560073e5d9e82f97
2023-02-16 15:29:56 +08:00
Sean Sullivan add00720bf New openapi v3 testing file client
Kubernetes-commit: 195a55c84c1a0ba9dcc278cc1cccee320334d5e1
2023-02-15 11:37:08 -08:00
Kubernetes Publisher 20506dc2c7 Merge pull request #115786 from liggitt/net-0.7.0-master
Update golang.org/x/net to v0.7.0

Kubernetes-commit: b3d8ac8496a23d65a907f9333d906bcd5463764e
2023-02-15 15:20:04 +00:00
Kubernetes Publisher edf661f9c9 Merge pull request #115785 from liggitt/fix-kubectl-test
Revert "Refactor fake versions of openapi client into testing subdir"

Kubernetes-commit: 98406e2a3e88bd6a2affe5674b7a577aa0926d48
2023-02-15 07:27:13 +00:00
Jordan Liggitt 6453bd2a8f Update golang.org/x/net to v0.7.0
Kubernetes-commit: f8e00778ddca11c08117ccf1d1c410641c70c428
2023-02-14 23:14:30 -05:00
Jordan Liggitt a1aee20215 Revert "Refactor fake versions of openapi client into testing subdir"
This reverts commit 869da89eab37ce670759cea2c86325f36625e7fc.

Kubernetes-commit: f98944590058f936c7adb76ea2c974899a460fe2
2023-02-14 22:14:37 -05:00
Kubernetes Publisher 8bdb81f5e6 Merge pull request #115465 from seans3/openapi-client-testing
Refactor fake versions of openapi client into testing subdir

Kubernetes-commit: 08bbecb8e315fc976e35575e4e33c8a4a0e1cd28
2023-02-15 07:27:10 +00:00
Kubernetes Publisher 31af32762d Merge pull request #115722 from ardaguclu/restclientgetter-debug
kubectl debug: Use restClientGetter instead cmd.Factory

Kubernetes-commit: 281acc6a6bb22adae34fc49c906f4146d0870897
2023-02-13 23:20:06 +00:00
Arda Güçlü 6cb44356e3 kubectl debug: Use restClientGetter instead cmd.Factory
As the move towards using `restClientGetter` interface instead
gigantic `cmd.Factory`, this PR does that change.

Kubernetes-commit: f5b0d728c59fbcca571e4a21ca2f473149e72f03
2023-02-13 13:16:35 +03:00
Arda Güçlü c0da8f17bf kubectl debug: Initialize pod client and builder in complete
This PR initializes podclient and builder in complete function
instead run function.

Kubernetes-commit: d66b339868ea08ef4d3bda09fdf64abacaa3f41e
2023-02-13 13:03:50 +03:00
Arda Güçlü 2c98b95ac3 kubectl debug: Standartize add flag function
This PR standartize add flag function interface to align with
other kubectl commands.

Kubernetes-commit: 3ffdee7d2b2afb48d67828ac136f05ba9c6d8619
2023-02-13 12:36:18 +03:00
Kubernetes Publisher 7b99655ff3 Merge pull request #115594 from wking/included-failed-to-evict-pod-namespace
kubectl/pkg/drain: Include namespace in evictPods return error

Kubernetes-commit: cfa295f5691c6c406da667b6f9883dae714b1798
2023-02-13 07:12:56 +00:00
Kubernetes Publisher a08b3656df Merge pull request #111453 from ardaguclu/debug-support-files
(kubectl debug): Support debugging via files

Kubernetes-commit: 70dde8d746a07392d945dde32dd7e3b12ca9a043
2023-02-10 03:43:30 -08:00
Arda Güçlü 6bb46c3def Add explicitNamespace into ignore list in debug unit tests
Since, `explicitNamespace` is set by kubeconfig automatically, we can
safely add this field into ignore list.

Kubernetes-commit: c40f9f8bbb34d9bc58dbf8e6c7f664aacb0c5b91
2023-02-10 11:31:19 +03:00
Arda Güçlü 2d1cd8a4fc (kubectl debug): Support debugging via files
Currently `kubectl debug` only supports passing names in command line.
However, users might want to pass resources in files by passing `-f` flag like
in all other kubectl commands.

This PR adds this ability.

Kubernetes-commit: e0fedec69d494cf02ac99a83733d7d92f6cc0c51
2023-02-10 10:21:15 +03:00
Kubernetes Publisher c230e1b221 Merge pull request #115665 from aramase/aramase/f/update_vendor_k8s_utils
Update k8s.io/utils to `a36077c30491`

Kubernetes-commit: 9a51625ebebcc8345c851afc2b5cc98eb19ac193
2023-02-10 01:55:09 +00:00
Anish Ramasekar 0abb668640 Update k8s.io/utils to `a36077c30491`
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 09e02052fdf3d248368b3d05d5c922d616528c4c
2023-02-09 20:09:41 +00:00
Shang Jian Ding 04703e5d61 Implement kubectl debug profiles: general, baseline, and restricted (#114280)
* feat(debug): add more profiles

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>

* feat(debug): implment serveral debugging profiles

Including `general`, `baseline` and `restricted`.

I plan to add more profiles afterwards, but I'd like to get early
reviews.

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>

* test: add some basic tests

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>

* chore: add some helper functions

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>

* ensure pod copies always get their probes cleared

not wanting probes to be present is something we want
for all the debug profiles; so an easy place to implement
this is at the time of pod copy generation.

* ensure debug container in pod copy is added before the profile application

The way that the container list modification was defered causes the
debug container to be added after the profile applier runs. We now
make sure to have the container list modification happen before
the profile applier runs.

* make switch over pod copy, ephemeral, or node more clear

* use helper functions

added a helper function to modify a container out of a list that
matches the provided container name.

also added a helper function that adds capabilities to container
security.

* add tests for the debug profiles

* document new debugging profiles in command line help text

* add file header to profiles_test.go

* remove URL to KEP from help text

* move probe removal to the profiles

* remove mustNewProfileApplier in tests

* remove extra whiteline from import block

* remove isPodCopy helper func

* switch baselineProfile to using the modifyEphemeralContainer helper

* rename addCap to addCapability, and don't do deep copy

* fix godoc on modifyEphemeralContainer

* export DebugOptions.Applier for extensibility

* fix unit test

* fix spelling on overriden

* remove debugStyle facilities

* inline setHostNamespace helper func

* remove modifyContainer, modifyEphemeralContainer, and remove probes

their logic have been in-lined at call sites

* remove DebugApplierFunc convenience facility

* fix baseline profile implementation

it shouldn't have SYS_PTRACE base on
https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/1441-kubectl-debug#profile-baseline

* remove addCapability helper, in-lining at call sites

* address Arda's code review comments

1 use Bool instead of BoolPtr (now deprecated)
2 tweak for loop to continue when container name is not what we expect
3 use our knowledge on how the debug container is generated to simplify
  our modification to the security context
4 use our knowledge on how the pod for node debugging is generated to no
  longer explicit set pod's HostNework, HostPID and HostIPC fields to
  false

* remove tricky defer in generatePodCopyWithDebugContainer

* provide helper functions to make debug profiles more readable

* add note to remind people about updating --profile's help text when adding new profiles

* Implement helper functions with names that improve readability

* add styleUnsupported to replace debugStyle(-1)

* fix godoc on modifyContainer

* drop style prefix from debugStyle values

* put VisitContainers in podutils & use that from debug

* cite source for ContainerType and VisitContainers

* pull in AllContainers ContainerType value

* have VisitContainer take pod spec rather than pod

* in-line modifyContainer

* unexport helper funcs

* put debugStyle at top of file

* merge profile_applier.go into profile.go

* tweak dropCapabilities

* fix allowProcessTracing & add a test for it

* drop mask param from help funcs, since we can already unambiguous identify the container by name

* fix grammar in code comment

---------

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
Co-authored-by: Jian Zeng <anonymousknight96@gmail.com>

Kubernetes-commit: d35da348c60a3c7505419741f2546ff8b0e38454
2023-02-09 11:18:22 -06:00
Kubernetes Publisher ddf00a2aef Merge pull request #110953 from Abirdcfly/220705
cleanup kubectl describe cronjob v1beta1 in 1.26

Kubernetes-commit: 19eddfc5675c3a9206e33333719bcf719bb99928
2023-02-09 14:57:08 +00:00
Paco Xu 0760d00522 archived design proposals are now moved to Design Proposals Archive Repo.
Kubernetes-commit: 019d2615af3f7fd0ed0d593ef9df348f6d85b204
2023-02-08 11:12:22 +08:00
W. Trevor King 7ad33aa9fe kubectl/pkg/drain: Include namespace in evictPods return error
And also in the terminating-namespace log output.  This makes it
easier to track down drain-blocking pods, without having to hunt
around in earlier logs for 'evicting pod ...' messages.  Before this
change, caller logs might look like:

  evicting pod {namespace}/{name}
  ...
  error when waiting for pod "{name}" terminating: global timeout reached: 20s

With this change, they will look like:

  evicting pod {namespace}/{name}
  ...
  error when waiting for pod "{name}" in namespace "{namespace}" to terminate: global timeout reached: 20s

Kubernetes-commit: b6318d4e5b9b8eb0d2e2d5a8568df14817733f26
2023-02-07 13:10:30 -08:00
Arda Güçlü df850bc339 Re-enable label selector
Kubernetes-commit: 6c346e6cc9fba23475f9b3600857ededdddc7429
2023-02-07 11:11:05 +03:00
Arda Güçlü 0ce25bf6ed Add integration test for diff --prune --selector
This PR adds new integration tests for `kubectl diff --prune -l` to
catch possible regressions in the future.

Kubernetes-commit: 6e8a1beda7eb036c2494840e7c82a49cbff1d827
2023-02-07 11:04:05 +03:00
Kubernetes Publisher e67364c45a Merge pull request #115379 from artemvmin/serial-mkfs
Add an option to limit the number of concurrent mkfs calls

Kubernetes-commit: 6eb008620cd0ee3501326ee003d47fbaf1fa5b52
2023-02-07 05:54:29 +00:00
Artem Minyaylov 74a067ea6e Update k8s.io/utils to latest version
Update all usages of FakeExec to pointer to avoid copying the mutex

Kubernetes-commit: f573e149423dc578284789fdff8eeb3c195b5ccf
2023-02-03 14:51:25 -08:00
Kubernetes Publisher 4a582d37a9 Merge pull request #115485 from SergeyKanzhelev/epmeneralContainersQoS
small comment the ephemeral containers are not accounted for the QoS …

Kubernetes-commit: c34ddb5054e50a39e75cfc2eb7c5ca4a2145f6e6
2023-02-03 17:42:27 +00:00
Sergey Kanzhelev 8890f6a4d9 small comment the ephemeral containers are not accounted for the QoS calculation
Kubernetes-commit: b517d640a418f30dbc3c5bd5eb4fe5e8e26ab231
2023-02-02 18:21:39 +00:00
Sean Sullivan e1a547bdf0 Refactor fake versions of openapi client into testing subdir
Kubernetes-commit: 869da89eab37ce670759cea2c86325f36625e7fc
2023-02-01 18:39:18 -08:00
Kubernetes Publisher 1126105b03 Merge pull request #115266 from pohly/gomega-update
dependencies: update gomega to v1.26.0

Kubernetes-commit: 6d17cb2051b3a9958ed3353df242312d85e75d43
2023-01-30 21:50:16 +00:00
Kubernetes Publisher 1683b2d704 Merge pull request #108835 from guettli/patch-2
Extend example to contain --as=...

Kubernetes-commit: 4198d66457d5147ff717bf4beae52c0ec8a5f7cf
2023-01-30 17:47:54 +00:00
Thomas Guettler b7f6852b36 Extend example to contain --as==...
Kubernetes-commit: 2b980b8c01dfa17c08a4357b185b684bf69aa86f
2023-01-29 19:39:58 +01:00
Kubernetes Publisher 3ec401449e Merge pull request #114550 from alexzielenski/apiserver/smd/update-kube-openapi
update kube-openapi dependency

Kubernetes-commit: df03edaf755f71a61f4f817ca374ebe3b6416270
2023-01-25 05:50:40 +00:00
Alexander Zielenski 3c71e2f30f update kube-openapi
Kubernetes-commit: 7641ff75412c1d8b547c4fa388d3901aeeda6948
2023-01-23 15:32:33 -08:00
Patrick Ohly 116ace9325 dependencies: update gomega to v1.26.0
If gomega.Eventually/Consistently run into a situation where it observes some
state of e.g. a pod which does not satisfy the condition and then further
polling fails with API server errors, gomega will report both the most recent
pod state and API error instead of just the API error.

Kubernetes-commit: aa1279b5eb79177f5351368d8d9159982b1bfb5e
2023-01-23 15:19:38 +01:00