Commit Graph

1341 Commits

Author SHA1 Message Date
Sean Sullivan 348bd97228 OpenAPIResourcesGetter allows lazy-loading OpenAPI V2
Kubernetes-commit: 6614a29f470f802915d1467f5050dbca1f8bc562
2023-03-13 20:28:40 -07:00
Sean Sullivan 969a47ceed StreamTranslator and FallbackExecutor for WebSockets
Kubernetes-commit: 168998e87bfd49a1b0bc6402761fafd5ace3bb3b
2023-07-06 21:22:07 -07:00
tao.yang 67ef0ca456 cleanup: omit comparison with bool constants
Signed-off-by: tao.yang <tao.yang@daocloud.io>

Kubernetes-commit: b35357b6c08f21ba0fd312536051394c2567ec79
2023-09-04 16:59:23 +08:00
Maciej Szulik bdf68c0441 Allow using upper and lower case true|false when setting kubectl feature flags
Kubernetes-commit: e74f2d41aabc2c27db6f2a2a005572c8dd332912
2023-10-23 11:40:41 +02:00
Arda Güçlü c2f0957625 KEP-3638: Promote plugin resolution to beta (#120663)
* Promote plugin resolution to beta

* Not use plugin for kubectl create -f command execution

`kubectl create -f` is legitimate command execution and we shouldn't
search plugins if user invokes this.

* Add integration test for plugin resolution for create command

* Reintroduce feature flag to ability to disable it explicitly

Kubernetes-commit: 074a8b00840e85cc95fd83b1825b14ab21ad09c4
2023-10-23 14:41:38 +03:00
Arda Güçlü 55333c0817 KEP-3895: Promote interactive delete to beta
Kubernetes-commit: e8564d6c5bcf5757238176f90318ae0164274af9
2023-09-05 10:40:12 +03:00
mochizuki875 04a8b4e325 add CAP_NET_RAW to netadmin profile and remove privileged
Kubernetes-commit: e22f8ed553c0c2ed86fa22c5b281ddf13577b8b1
2023-06-13 13:08:06 +09:00
ithrael 84a37fbc5d fix(test): fix error handling condition in test
Kubernetes-commit: d680bc540b5703510c95b9290bfb4317edc7b2e9
2023-08-27 21:11:39 +08:00
Antonio Ojea 30ffb2dadb remove ClusterCIDR
KEP-2593 proposed to expand the existing node-ipam controller
to be configurable via a ClusterCIDR objects, however, there
were reasonable doubts on the SIG about the feature and after
several months of dicussions we decided to not move forward
with the KEP intree, hence, we are going to remove the existing
code, that is still in alpha.

https://groups.google.com/g/kubernetes-sig-network/c/nts1xEZ--gQ/m/2aTOUNFFAAAJ

Change-Id: Ieaf2007b0b23c296cde333247bfb672441fe6dfc

Kubernetes-commit: c2d473f0d438cedab2f1831d23457d24961e0f4e
2023-10-13 21:31:29 +00:00
Vinay Kulkarni 3eb40ffbb0 Update pkg/apis/core/helper/qos/qos.go
Co-authored-by: Itamar Holder <77444623+iholder101@users.noreply.github.com>

Kubernetes-commit: 40b604e374144351eac463e7077fdb1903f5a033
2023-08-07 10:52:26 -07:00
vinay kulkarni cacd4f8556 Code review fix: Move GetPodQOS code to ComputePodQOS. If set, return PodStatus.QOSClass from GetPodQOS.
Kubernetes-commit: 4063ca40501ce589b4de1ffa5cc814cd9e03e0ac
2023-08-07 14:42:36 +00:00
vinay kulkarni 35d73b6cda Perf optimization: Move away from GetPodQOS, using PodStatus.QOSClass instead
Kubernetes-commit: 5d4410b9601f27942fa1d1a4e65c2aa3a65637b1
2023-07-29 13:30:09 +00:00
Arda Güçlü 507fbad069 Add shortname ambiguity warning in shortcut expander (#117668)
* Add warning handler callback function in shortcut expander

Currently, errors in client-go are propagated back to the callers via
function returns. However, there is no elegant way for just warning users.
For example, when user wants to get a resource with it's short name format
and if there are multiple resources belonging to this short name, we need to
warn user about this ambugity which one is picked and which ones are discarded.

Not only to overcome this particular case mentioned above, but also propose a
way for the possible warnings in the future, this commit adds a warningHandler
callback function in shortcutExpander.

* Add warningPrinter functionality in ConfigFlags

ConfigFlags has neither warning user in a standardized
format functionality nor passing warning callback functions to other upper level
libraries such as client-go.

This commit adds an ability that user can set warningPrinters
according to their IOStreams and this warningPrinters will be used
to raise possible warnings happening not only in cli-runtime but
also in client-go.

* Pass warning callback function in ConfigFlags to shortcutExpander

This commit passes warning callback function to print possible
warnings happened in shortcut expander to warn user in a
standardized format.

* Add integration test for CRDs having ambiguous short names

This commit adds integration test to assure that warning message
related to this ambiguity is printed when resources are being retrieved via their short name
representations in cases where multiple resources have same
short names.

This integration test also ensures that the logic behind which resource
will be selected hasn't been changed which may cause disperancies in
clusters.

* Remove defaultConfigFlag global variable

* Move default config flags initialization into function

* Skip warning for versions of same group/resource

* Run update-vendor

* Warn only once when there are multiple versions registered for ambiguous resource

* Apply gocritic review

* Add multi-resource multi-version ambiguity unit test

Kubernetes-commit: a504aed54d028dbc8ea2508142c94d309f5f1ec6
2023-10-11 19:58:38 +00: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
Abid Malik 64fc8b1f67 fixes the issue in the documentation of kubectl events
Signed-off-by: Abid Malik <AbidMunirMalik@gmail.com>

Kubernetes-commit: d8c145d20da7906722798218652583dea34b48bb
2023-07-13 13:10:33 -04:00
Majid Garoosi 7ce6599fc1 Check --show-events in kubectl describe pvc (#120380)
* Check --show-events arg before fetching events

* Remove unnecessary else statement

* Add test for false show events

Kubernetes-commit: a919079ff3132a070909e9286674b0b0d8672377
2023-09-18 11:50:30 +03:30
justinsb eda2d31bdd kubectl prune v2: switch to contains-group-kinds annotation
The contains-group-resources was an implementation error, we specified
contains-group-kinds in the KEP.

Because it is in alpha, we simply switch to the new annotation.

We will recognize the old annotation and migrate existing alpha
applysets, but support for this migration can be removed in beta/GA of
applyset.

Kubernetes-commit: 10caecb3b22cf93c7caa2ac70d40af9b550c0da2
2023-06-28 11:27:00 -04:00
Majid Garoosi 663031e23e Look for pods in ownerReferences of PVC (#120427)
* Look for pods in ownerReferences of PVC

* Implement for loop instead of using slices package

* Add tests for getPodsForPVC function

* Make PVC names consistent

* Remove volumes part of the pvc owner pod

* Do not store result of append in another variable

* Fix lint error

Kubernetes-commit: 710dceded51d5cf65bc27bca0b0c96f05909b65b
2023-09-13 20:15:30 +00:00
Arda Güçlü 5691f5e6f9 Gracefully handle empty config error when local flag is used
`f.ToRawKubeConfigLoader().Namespace()` throws `ErrEmptyConfig` when
default configuration file can not be found, even if it invalid.

However, when user explicitly passes `--local` flag, that means
we can gracefully handle this error and continue. This commit does that
for the commands having `--local` flag.

Kubernetes-commit: ba49ccdbc9b4761d0c9589ab7ca9f41029a99568
2023-06-15 10:13:52 +03:00
Matthias Riegler 90963a2f06 feat: make user-defined plugins discoverable with e.g. kubectl help (#116752)
* feat: make user-defined plugins discoverable with e.g. kubectl help

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: make help text localizable & rename it

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* chore: address CRs, cleanup

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: plugin execution

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

---------

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

Kubernetes-commit: d7b7a85fbc0b3831cbc6a750a47dfdcdf777d519
2023-09-06 18:12:52 +02:00
ithrael 296dae746e fix(kubectl): kubectl events doesn't filter events by GroupVersion for resource with full name
Kubernetes-commit: 28621f1eb3f3a9ba212c844db4696f7f17450942
2023-08-23 11:34:44 +08:00
Davanum Srinivas 1fb897b3e0 New repo who dis? distribution/reference
github.com/docker/distribution/reference has a new home github.com/distribution/reference

and a new tag v0.5.0. Let's switch to that.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 889c8e919bdc8115ad579bb092a4dafdf695754e
2023-08-31 10:48:53 -04:00
ithrael 3225b852aa doc: Add example for restarting all deployments in a namespace
Kubernetes-commit: f4fc4b16b1d9837b4980850480421da318db04eb
2023-09-01 19:25:54 +08:00
ithrael e01bb717e0 doc(kubectl): Kubectl restart command without specific deployment will restart all deployments
Kubernetes-commit: 79466886a179d61b94e0ba0aa9bc39622849448f
2023-08-23 11:22:53 +08:00
adil ghaffar e112354038 adding more callbacks in kubedrain helper
Kubernetes-commit: 0323fe42e23aee176ff14f3385bc15e81216c7bb
2023-04-20 16:16:11 +03:00
Arda Güçlü 53768a14a7 Add comment about why AttachFunc be overridable
Kubernetes-commit: fa37bebcd4b239cc5ad8eb3899d9868b015b34de
2023-08-28 08:36:32 +03:00
Arda Güçlü 1e115c1960 kubectl debug: Remove legacy server support
Legacy server support for ephemeral containers were added in kubetl
debug in 1.22. Since now we are in 1.29, we can safely remove ephemeral
container legacy server support because 1.22 is already far away from
supported version skew boundary.

Kubernetes-commit: fdea6ad17d74c7f39e55d4ae2b57f2430c12eaba
2023-07-24 15:32:26 +03:00
Arda Güçlü 366796b7e2 kubectl debug: Introduce customizable AttachFunc instead static one
Currently, kubectl debug statically relies on handleAttachPod function
in order to attach to the pod.
However, external tools would want to set their own customized attach
function and this commit introduces generic `AttachFunc` function interface
which can also override by external tools.
From the point of kubectl debug, there is no functionality change.

Kubernetes-commit: baed6240468250c855a5ec235e47a64e078bd042
2023-07-24 15:28:21 +03:00
git-jxj 826006cdb9 cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions

Kubernetes-commit: a5b3a4b738e9576b68c3083de8b72002e0b45551
2023-08-16 21:07:06 +00:00
Todd Neal f5a7ea080f kubectl: fix describe node output when sidecars are present
Update the resource calculation so that it accumulates the resources
from scheduled pods correctly when those pods contain restartable
init containers.

Kubernetes-commit: 479b2d03a4369b8ae4565ba73850c703331cdcc5
2023-07-21 09:02:11 -05:00
Stephen Kitt 4729836f7f Use intstr.Parse instead of reimplementing it
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 7f53f7649e178622ad1a64988913f025399f152b
2023-07-13 12:02:26 +02:00
Andreas Karis 1b4373f26b Improve conditionFuncFor expression parsing for wait --for jsonpath
Make it possible to parse jsonpath filter expressions: Split
jsonpath expressions on single '=' only and leave '==' as part of the
string.

Reported-at: https://github.com/kubernetes/kubernetes/issues/119206
Signed-off-by: Andreas Karis <ak.karis@gmail.com>

Kubernetes-commit: 41889984304c44b879d8bcae92c9ed7aa3fd8c67
2023-06-20 03:34:50 +02:00
Brian Pursley 70109f0921 Prefer pods without a deletion timestamp over pods with a deletion timestamp when getting an ordered list of active pods.
This allows commands like kubectl port-forward, when used with deployments, to avoid selecting a pod that is terminating (due to a rollout, for example).

Kubernetes-commit: d281daee335dc3b2aa67fb3128f00d7d2f5f7d91
2023-07-18 08:31:37 -04:00
Arda Güçlü 042ec77890 Remove KUBECTL_EXPLAIN_OPENAPIV3 environment variable
Since explain openapiv3 has been moved to beta already, there is no
point to having this environment variable.

This PR removes it.

Kubernetes-commit: 4d8f569b037d2979c1d9c5825e5227aadfc8077f
2023-07-13 13:37:03 +03:00
Arda Güçlü 7e050c1e1d kubectl delete: Introduce new interactive flag for interactive deletion (#114530)
Kubernetes-commit: 3267dd9d5294893580538e98c1e410f64583c0cd
2023-07-11 16:05:11 +03:00
Maciej Szulik e0816cbaa1 Remove long/golang version information making short the default
Kubernetes-commit: 3f07fc3acc9014f33fb9bbde12937b35e3f48c75
2023-03-17 15:20:56 +01:00
aimuz 2ec2847518 fix: kubectl expose fails for apps with same-port, different-protocol
Fixed: https://github.com/kubernetes/kubernetes/issues/114402
Signed-off-by: aimuz <mr.imuz@gmail.com>

Kubernetes-commit: e5116a39c96a78511fc8c0da4730d3262b2c121c
2023-06-19 09:58:54 +08:00
minherz bd48fd4c16 chore: address review feedback
add integration test to wait for json without value
refactor JSON condition value parsing and validating
adjusting test to reflect the error message refactoring

Kubernetes-commit: dbdd861ea366af50fb74983426587dad7222cb89
2023-06-29 00:36:07 -07:00
minherz baf5b1c999 chore(fix): test jsonpath condition parsing errors
Test parsing logic for invalid JSONPath condition formats,
excluding JSON path expression parsing.
Fix error in parsing logic

Kubernetes-commit: a5c4fbe979188335f4f414a1aef303f1c0f353f6
2023-06-03 21:40:16 -07:00
minherz 0c921b2f35 Support JSONPath condition without value
Extend current JSONPath condition logic to return from wait on "any" value.
Change parsing JSONPath input to support the syntax without value.
Match any simple or complex (object or array) values.

Kubernetes-commit: 9d3e55ec431f3f595a7739fcc592602f7cc1d69b
2023-05-21 19:03:24 -07:00
Mauren Berti 03a51b01e7 Update the template.pot file with latest message IDs.
Update the template.pot file with the current state of the messages in kubectl. That allows localized messages to be updated accordingly and picked up correctly.

Kubernetes-commit: dfce076c6cf0ad8f7a896a87c07143c63e2d67bd
2023-06-27 12:10:46 -04:00
Frederic Branczyk eca0d6a8b1 kubectl: Allow parallelizing diffing
Kubernetes-commit: 1cfb932111e53e296a3b0f001b6f5d03f212f32f
2023-06-05 13:18:49 +02:00
Varsha Prasad Narsing a49f0e6d53 [refactor] refactoring flags and options in Expose cmd
This PR decouples the command options from the input flags.
The input flags from the command are then translated to
options which are further used while running the command.

Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>

Kubernetes-commit: 8f229057484453bd1b820d00c940efbbc56addc5
2023-05-05 11:31:03 -04:00
Filip Křepinský 138a1cc87a kubectl explain should work for both cluster and namespace resources and without a GET method
Kubernetes-commit: 7f4c187ab26fc8b96a091068ee9c84fa447b9291
2023-06-26 18:39:28 +02:00
Ritikaa96 d5606514d9 Adding review changs to update
Kubernetes-commit: fff5b35023b2b9cd9ec681e188c077225d1293a3
2023-06-16 16:33:07 +05:30
Ritikaa96 13f1a1e448 Updated kubectl explain help output
Kubernetes-commit: e213448db12abb91450028c89a9e8330d693a110
2023-06-14 12:33:18 +05:30
Ritikaa96 26d4d62bb1 Details added in kubectl explain help
Kubernetes-commit: 8c06ca68d7d3a286425ab89bcafb109e83199a94
2023-06-13 17:01:46 +05:30
Vihang Mehta 64086544bc [bug] Update DefaultObjectDescriber to handle interface params (#118190)
* Update DefaultObjectDescriber to handle interface params

Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>

* Minor test cleanup for more descriptive errors

Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>

---------

Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>

Kubernetes-commit: 56cb4c93918efdc6e05f1c8f011166734fbe8a2f
2023-06-21 21:46:02 +00: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
Devesh Goyal 03e1b53324 Update k8s.po
Fixed typo mistake

Kubernetes-commit: 0789bbe9f7acdaf0f2c203aef1da292358842f09
2023-05-21 19:33:33 +05:30
Mihai Costea 900a7ab781 Remove StartupProbe on debug with pod copy
Kubernetes-commit: ea6495e8284b7eccd292c67e21a32081c4a29967
2023-06-07 15:40:10 +03: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
Jefftree 6d49571c40 Update gnostic references
Kubernetes-commit: 2111e79f56acdfa6a8dab56780c52e3abc608758
2023-06-01 18:25:39 +00: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
Marly Puckett 7d67323db1 Add more tests that should exist but don't for some reason
Kubernetes-commit: b7cdbca2374610f2122c6a8efde2806030da8338
2023-02-13 10:30:41 -08:00
Marly Puckett 9ae9023ede Add tests
Kubernetes-commit: 5dca1be0160f5b5cb3c85b2ab44d569290eaa1f4
2023-02-11 15:10:56 -08:00
Marly Puckett 2d86c3a191 Add jsonpath support for explain
Kubernetes-commit: bab2c18c2463f51d593b0878d57d42a2844748e5
2023-02-11 15:10:40 -08: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
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
Keita Mochizuki f118a887e5 Fix: Restricted profile comply with PSS (#117543)
* restricted profile comply with PSA v1.27

* add test case

* Reflect review comments

* Reflect review comments 2

* Reflect review comments 3

Kubernetes-commit: 0813904404034fd760d8e7e1e3ca5444610a7fa8
2023-05-24 20:16:49 +09:00
Arda Güçlü a9dd2e4bec Preserve code blocks in templates.Normalizer (#118029)
* Preserve code blocks in templates.Normalizer

Currently, if templates.LongDesc function is invoked multiple times
for a string including a code block, this code block is converted to
invalid code block.

The reason of this issue is that blackfriday package, which templates package uses, relies on
4 * indentation to detect code blocks. This PR always preserves
4 * indentation in code blocks to always detect it code blocks in also
post invocations.

* Add indentations to test for code blocks

* Use strings.repeat for repetition

Kubernetes-commit: 0bff705acd8982e34b937116eb2016c9d6e4c4a6
2023-05-24 09:20:49 +03:00
Brian Pursley 3418528213 i18n: Fix bug where package-level variables are not translated.
The call to `i18n.LoadTranslations` needs to occur on init so
that package-level variables that call `i18n.T()` to initialize
their values will be able to receive the translated string.

Added new integration tests to test help output translation.

Kubernetes-commit: 34d980e77090d065199e9e808f8aebf6ba2db72c
2022-11-21 22:48:42 -05:00
Filip Křepinský a71362e506 rename err to lookupErr
Kubernetes-commit: bafae5c0764a222e336de1d7ce2645186bb455dd
2023-05-15 16:41:54 +02:00
Filip Křepinský 3ebdc043ce fix false positive kubectl plugin unit tests
- test.args should be passed instead of the os.Args of the test framework
  to prevent simple invocation of kubectl without args that could
  manifest in false positive test runs
- plugin execution should have a different test path
- tests should invoke functioning kubectl commands instead of the mock
  ones to ensure the correct subcommand is executed without a failure

Kubernetes-commit: 8b9cbe62025da49a31518870f2aea0ce9797d3ce
2023-05-11 20:12:38 +02:00
Vihang Mehta d3fd4ea37b Sort and limit to the describers the return (string, error)
Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>

Kubernetes-commit: 885f3d7a7dfe4eb09bef86bbeb49499ec3ff2bae
2023-05-17 16:36:46 +00:00
Vihang Mehta 6f146fb23f Add all describers to the exported DefaultObjectDescriber
Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>

Kubernetes-commit: 2cb215e1091fb50a152afca3a8b2166d47f996ee
2023-05-05 18:30:54 +00:00
adil ghaffar 76565cfba8 Changing annotate PrintFlags from annotate to annotated
Kubernetes-commit: d6e488b998effbda9675d4dc3d297a142a4079f7
2023-05-16 14:39:15 +03:00
Arda Güçlü 1fecf3ab58 Simplify plugin resolution check function
Kubernetes-commit: daebf1c735df845f5e8429381593a4de1762361e
2023-05-15 08:51:46 +03:00
Arda Güçlü f53c5f479c Use getter function for plugin subcommand resolution
Plugin subcommand resolution is relatively less used than the
builtin subcommands. That's why, instead always initializing a
hash map on memory, it would be better to use a getter function only
serves as needed.

In addition to that this function will be exported that external
libraries can use it.

Kubernetes-commit: 4634073d0b979d2827106a0a1010456ac420baa8
2023-05-10 10:41:43 +03:00
guiyong.ou daae148e73 fix:translations zh_CN LC_MESSAGES k8s.po error
Signed-off-by: guiyong.ou <guiyong.ou@daocloud.io>

Kubernetes-commit: 3a394bbeadac06224f534a99041929e3f9a0e07c
2023-05-10 18:13:28 +08:00
gxwilkerson33 1b129f017b add no resources found message to rollout-status command (#117884)
* add no resources found message to rollout-status command

* return err if not nil before no resource message

Kubernetes-commit: a5575425b039bf7c15dfaa9a7acf257fdc4fde3f
2023-05-11 23:28:58 +00:00
Chris Bandy 1815b0e2ef Cleanup environment in tests that call os.Unsetenv
testing.T.Cleanup ensures the environment is restored after a test and
any of its parallel sub-tests. It's possible that some of these can be
simplified further to T.Setenv(key, ""), but I did not investigate.

Kubernetes-commit: e8d3a4a105cc8ea6e795e24d5dbf0c61ed78cacd
2023-04-15 11:19:24 -05: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
m.nabokikh deeeaea2a7 KEP-3325: Promote SelfSubjectReview to GA
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Kubernetes-commit: 40de26dcff80f29380a4ba90a93ce3ece7482b78
2023-05-02 01:26:20 +02:00
charles-chenzz 0d2299217d reduce util pkg for testing in tempdir.
Kubernetes-commit: aaa30439bdda1589eacc7be8547c297a73e346b9
2023-04-18 11:18:10 +08:00
Brian Pursley 198d4bdc32 Fix typo in kubectl api-resources help text for --categories flag
Kubernetes-commit: 6d8a0100f70f2df61340bd52385841c5df7bda58
2023-04-25 20:26:10 -04:00
aditya-K2 9ce8f5e1fc Remove repeated info
Kubernetes-commit: 28ac914bc54a946188b98254dfe85a0d721e22f5
2023-04-24 10:22:08 +05:30
aditya-K2 c60b12df3a Move info where its most relevant
Kubernetes-commit: e0d5c4aa93e6279979a60db5c8357799c2d54a8f
2023-04-08 00:27:13 +05:30
aditya-K2 06bf9e7cc8 Update `kubectl edit` documentation
kubectl defaults to /bin/bash if the SHELL environment variable isn't
set. Updating the docs to mention that you can override the shell
location by setting the SHELL environment variable.

Kubernetes-commit: 0a508ad8067dcc8d48420daca536fca09df5846b
2023-03-13 00:01:39 +05:30
Antoine Pelisse 2c4bec21e5 openapi: Make file client more easy to re-use
A few notes about the change:
1. I need to initialize the fileclient once, in an init function, so I
don't have access to `testing.T` yet.
2. I want to be able to configure the openapi files that I use
3. We already have a "cache" client that wraps another client, we don't
need to re-implement caching here, one can just do:
`cache.NewClient(openapitest.NewFileClient("some/path"))` to do a cached
client. Or initialize it in an init/global var.

Since there is still some value to use the embedded file, make an
alternative constructor while using fs.FS interface to be able to
manipulate both virtual and disk-based filesystems.

Kubernetes-commit: 29503fd8d45bc2c9438e92936bf4111162529b40
2023-03-28 13:40:28 -07: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
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
Tim Hockin a431fc3d05 Replace apimachinery diff.StringDiff with cmp
I forced failures of most of these tests and verified readability

Kubernetes-commit: 97bab44cae3857710bfb072d233e654784082ee3
2023-03-23 11:10:32 -07:00
Arda Güçlü da6bd32b26 More migrations from genericclioptions to genericiooptions
Kubernetes-commit: b4e4db336f690606fcdb69bf1d3109f4edc9bd7b
2023-04-05 15:14:51 +03:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
Arda Güçlü 5de8e8f539 kubectl events: Support fully qualified names for --for flag
Users can pass resources into `kubectl events` command via `--for` flag,
if they have desire to only get events for the resource they specify.

However, current `kubectl events` does not support passing fully qualified
names(e.g. `replicasets.apps`, `cronjobs.v1.batch`, etc.). This PR adds support
for this.

Kubernetes-commit: 457bb58ebbf5a863ce30f51c53a84bc41c2380dc
2023-03-31 12:34:00 +03:00
Katrina Verey 03f092a1af Use standard *.kubernetes.io instead of *.k8s.io for ApplySet
Kubernetes-commit: a0cff30104ea950a5cc733a109e7f9084275e49e
2023-03-20 18:21:04 -04:00
justinsb 11dbc9b97f prunev2: find resources in parallel
To improve wall-clock speed, we run list operations in parallel.  This
particularly helps when the round-trip time is high.

We issue requests as quickly as possible, kube-apiservers should all
have priority and fairness at this point and we don't want to
duplicate/fight that system.

Kubernetes-commit: 82eee59d0feb4b303e6ef78ebb7ec646a059f266
2023-03-14 12:45:45 +00:00
Antonio Ojea 9be7ad1c53 kubectl describe IPAddress
Change-Id: I201c2980830058c92b66e2386bfe8bedd8f0dcd4

Kubernetes-commit: 53dbf1752b070dcfe11399b3dd874fa8616851b3
2023-01-02 15:27:05 +00:00
natasha41575 178e0df9e6 Update kubectl kustomize to kyaml/v0.14.1, cmd/config/v0.11.1, api/v0.13.2, kustomize/v5.0.1
Kubernetes-commit: 09e6e4db1d2fd901601f5ed23c7c29b7dc310649
2023-03-14 11:40:28 -05:00
Alexander Zielenski 25f108da25 throw missing field in std err
Kubernetes-commit: 0c0a91d4d97547aa5356e5dc326361d1a375d494
2023-03-14 12:34:04 -07:00
Alexander Zielenski f4936cb9cc log name of mising field, not path
Kubernetes-commit: 180c312f31f5de372eb27b5a120d5a6ce94bc07c
2023-03-14 12:20:11 -07:00
Alexander Zielenski ef349ea77d use referred type's type when it is not an object
i think we should also do this when it has no GVK? objects with no GVK cant be explained

Kubernetes-commit: 636c259474a5e7c5743d3084cca7b50f658d982c
2023-03-14 11:16:30 -07:00
Alexander Zielenski 175f88290e use title case for "Object" type
for backwards compatibility

Kubernetes-commit: 61d408832acac1c703922007d5e590cb86f5c801
2023-03-13 17:34:09 -07:00
Alexander Zielenski 86033dd377 enable openapiv3 by default
Kubernetes-commit: ce3385ab1f9b0cce4d972b8888584dd0fe295c70
2023-03-08 13:15:56 -08:00
justinsb 62b0fbdb7a kubectl prunev2: Refactor the applyset to be more reusable
This enables sharing with diff.

Kubernetes-commit: d016fdcc834099dee721f42a384e1bc1f710e599
2023-03-14 12:12:00 +00:00
justinsb 180519d83a kubectl diff: refactor tracker into a separate type
This means that we can reuse the logic even if we swap out the pruner.

Kubernetes-commit: 9c5c8b243d1a6524e38d847c54de3046b332d373
2023-03-14 12:06:44 +00:00
Madhav Jivrajani 56c5264e50 kubectl: Change subresource flag to beta
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 9fbd08e075dae2b67386fe2c5283f28272858008
2023-03-14 21:44:32 +05:30
Katrina Verey a038484b5c Allow conformant CRDs to be ApplySet parents
Kubernetes-commit: 923d9b63fd87e9446f5746f544237c7e0de009a0
2023-03-07 11:29:50 -05:00