Commit Graph

2393 Commits

Author SHA1 Message Date
zc 7f3d19c990 add unit tests for updateEnv
Kubernetes-commit: f79183f2918446907da08325066a334466146711
2021-09-08 10:49:15 +08:00
Matthias Bertschy 68250fd482 add option to make kubectl cp resume on errors
Kubernetes-commit: 00b528cdf42ae4c1771f3a51c557a1f289701113
2021-09-06 10:04:15 +02:00
Sebastiaan van Stijn 9c5348f38a go.mod: github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6
full diff: 9d4ed18562...3f7ff695ad

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Kubernetes-commit: 717e54192696505fa40d3a022f98db1f3c45ed43
2021-09-02 15:26:04 +02:00
W. Trevor King cdcb6ed356 kubectl: Document --for's Unicode case-folding condition-value comparison
When the wait command was added in 76794643c5 (add wait, 2018-05-18, #64034),
this comparison was via ToLower.  It moved to use Unicode case folding
[1,2] in f4940cf55f (Staticcheck:
vendor/k8s.io/kubectl/pkg/scale|describe/versioned|cmd/top|cmd/util/editor|cmd/top,
2020-01-21, #87403).

[1]: https://pkg.go.dev/strings#EqualFold
[2]: http://www.unicode.org/reports/tr30/tr30-1.html

Kubernetes-commit: f69d52338b21da938021af37f49f49a83016534d
2021-08-30 19:41:08 -07:00
astraw99 2ad6554e1e fix kubectl unlabel msg
Kubernetes-commit: cec30fdbedc326ef0abcbd8475b89840ae0f776d
2021-08-15 14:56:07 +08:00
Daein Park 5acf82be0d Add a flag to enable "Capacity" instead of "Allocatable" for an actual node memory total usage.
If "Allocatable" is used to a node total memory size, under high memory pressure or pre-reserved memory value is bigger, the "MEMORY%" can be bigger than 100%.
For suppressing the confusing, add a option to show node real memory usage based on "Capacity".
* Reference: https://github.com/kubernetes/kubernetes/issues/86499

Kubernetes-commit: 862937bf1c7975d3f54ae47a2958e47f2c50150f
2021-06-16 21:25:52 +09:00
卢振兴10069964 165827de9c code cleanup for kubectl
Kubernetes-commit: 17993020cdca7eea2fb96a993e048d2d0624fa40
2021-04-12 10:45:08 +08:00
thomassong 6847974534 fix: include init containers when determining pod QoS that keep consistent with kubelet
Signed-off-by: thomassong <thomassong2012@gmail.com>
Co-authored-by: Paco Xu <paco.xu@daocloud.io>

Kubernetes-commit: 285e43d208a29acc9d19c47099699fe13d012f8a
2021-02-05 09:30:00 +08:00
Maciej Szulik fe89be9c6f Use separate pathSpec for local and remote to properly handle cleaning paths
Kubernetes-commit: 0fb6815f08f39c8af814fa733d5235681a124b81
2020-08-21 19:24:19 +02:00
Kubernetes Publisher 04a41bcaa8 Merge pull request #105445 from ardaguclu/diff-invalid-arg-status-code
Add diff command return status code greater than 1 when flags invalid

Kubernetes-commit: e054181e517b48a3c862207537092c28604aaad9
2021-10-13 01:10:20 +00:00
Kubernetes Publisher a8d3024f11 Merge pull request #105141 from VilledeMontreal/fix/noloadPluginsForComp
Do not try to load plugins for cobra commands

Kubernetes-commit: dbd8d3bcd620037b5262eed1778f0784b49e55bc
2021-10-06 21:08:51 +00:00
Arda Güçlü 8307ca4a3c Add diff command return status code greater than 1 when flags invalid
This PR adds flagerror handler function to detect when flags are invalid.
Default flag handler returns status code 1. However, diff command embraces
this status code as changes are found. By overriding flag errors,
this PR shows same message with default case and returns status code 2.

Kubernetes-commit: 4f0848520d4cdd679c76479949546002c5935e3c
2021-10-04 13:02:34 +03:00
Kubernetes Publisher 5920119027 Merge pull request #105384 from seans3/command-headers-fix
Fixes kubectl command headers which hangs on kubectl run

Kubernetes-commit: e380ce57143fe84f8d575636ab81a06f7f8b28aa
2021-10-02 05:10:04 +00:00
Kubernetes Publisher 1e432bea02 Merge pull request #105076 from pohly/log-flush-frequency-bug
initialize logging after flag parsing + refactor commands

Kubernetes-commit: 82da9bdaab705a1a72e4c5915f6ddd8775592fdf
2021-10-02 01:11:40 +00:00
Kubernetes Publisher d6b2b6aad8 Merge pull request #105372 from MadhavJivrajani/vendor-clock-utils
Vendor in k8s.io/utils

Kubernetes-commit: eebeff9f7e0fccf1d220ce809eaea7f7f9248ce0
2021-10-01 01:15:30 +00:00
Sean Sullivan 8a45e525e5 Fixes kubectl command headers which hangs on kubectl run
Kubernetes-commit: 1d1a5499e717b928c6b2782fdcad9fa4052a38a1
2021-09-30 13:53:00 -07:00
Madhav Jivrajani c2928398a9 run hack/{pind-dependency.sh, update-vendor.sh}
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: a43fca76ea7ff6fb08153c9081f7858cd4d06dd8
2021-09-30 19:15:35 +05:30
Kubernetes Publisher 8f64ba48a0 Merge pull request #105121 from wujiangfa-xlauncher/master
fix top node output format incorrect

Kubernetes-commit: dac94e1c9ee31034d174815e287ba39fa67b2b72
2021-09-30 01:13:11 +00:00
Kubernetes Publisher b81892cba3 Merge pull request #105330 from liggitt/importboss-doc
Make package paths referenced by import boss valid

Kubernetes-commit: d551560a78292e1d4cac1de2ae684c803ddea183
2021-09-30 01:13:09 +00:00
Kubernetes Publisher 4a6a401a01 Merge pull request #105117 from cmssczy/fix_useless_error_handling
handle error when parse Quantity

Kubernetes-commit: 995a1c5abf48f9a3573f4bce4db54c381cdebe23
2021-09-30 01:13:07 +00:00
Kubernetes Publisher 2c81f86bd6 Merge pull request #105327 from julianvmodesto/kubectl-dry-run-flag-removals
Remove deprecated kubectl --dry-run values.

Kubernetes-commit: bac45abf77ed1f96921365c056303066fc177702
2021-09-30 01:13:05 +00:00
Jordan Liggitt 6f01cf6b69 Make package paths referenced by import boss valid
Kubernetes-commit: f6b831aeaca2ff1481074e05c6771050f2b40516
2021-09-28 13:06:39 -04:00
Julian V. Modesto f9ab824bc9 Remove deprecated kubectl --dry-run values.
The boolean values for --dry-run have been deprecated for removal since
1.18, more than 2 releases.

The default value for --dry-run with the flag set and unspecified has
been deprecated for removal since 1.18, more than 2 releases.

Both values are now removed in this change. Any kubectl --dry-run
usage no longer accepts --dry-run=(true|false) boolean values and usage
now requires that a value of (client|server|none) is specified.

Kubernetes-commit: e0b7a85ee5b5d546bec2dc0e8cbf5cd4c0c684d8
2021-09-28 10:03:20 -04:00
Marc Khouzam e6118325f3 Ignore flags that could precede the Cobra command
See https://github.com/kubernetes/kubectl/issues/1119

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: d41c2685b67317fea1d1a3843d8f5870bc724b3b
2021-09-20 18:20:49 -04:00
Marc Khouzam 10504c18ad Do not try to load plugins for cobra commands
Cobra adds the commands 'help', '__complete' and '__completeNoDesc'
inside rootCmd.Execute(), however, when kubectl decides if it should
lookup plugins, rootCmd.Execute() had not been called yet.  Therefore,
the call to cmd.Find(cmdPathPieces) done by kubectl does not find the
commands added by Cobra.  To fix this we must check for them explicitly.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: e703b3d25377e763b117805b3d88fe7236f3ff76
2021-09-19 14:34:10 -04:00
caozhiyuan 0cf1a18bec handle error when parse Quantity
Kubernetes-commit: b9d7584c3a838d83c6c8c6e405907bf05addc850
2021-09-18 15:05:21 +08:00
wujiangfa-xlauncher cadea4d691 fix top node output format incorrect
#105112

Kubernetes-commit: e838017f11dae4bc1c0a12c9703d0153661bd27d
2021-09-18 09:41:51 +08:00
Kubernetes Publisher d11f42ab70 Merge pull request #104761 from lauchokyip/improveCM
Improve create configmap test

Kubernetes-commit: ff593c89a0c8c46e37fca168e05d4fa09d15f353
2021-09-17 13:56:41 +00:00
Kubernetes Publisher b48b62c33b Merge pull request #104949 from Karthik-K-N/json-iterator-version-update
Updated json-iterator version to 1.1.12 from 1.1.11

Kubernetes-commit: 6a49ed41eab79d745c53723ce7f134222279545e
2021-09-17 13:56:39 +00:00
Patrick Ohly 466b483531 initialize logging after flag parsing
It wasn't documented that InitLogs already uses the log flush frequency, so
some commands have called it before parsing (for example, kubectl in the
original code for logs.go). The flag never had an effect in such commands.

Fixing this turned into a major refactoring of how commands set up flags and
run their Cobra command:

- component-base/logs: implicitely registering flags during package init is an
  anti-pattern that makes it impossible to use the package in commands which
  want full control over their command line. Logging flags must be added
  explicitly now, something that the new cli.Run does automatically.

- component-base/logs: AddFlags would have crashed in kubectl-convert if it
  had been called because it relied on the global pflag.CommandLine. This
  has been fixed and kubectl-convert now has the same --log-flush-frequency
  flag as other commands.

- component-base/logs/testinit: an exception are tests where flag.CommandLine has
  to be used. This new package can be imported to add flags to that
  once per test program.

- Normalization of the klog command line flags was inconsistent. Some commands
  unintentionally didn't normalize to the recommended format with hyphens. This
  gets fixed for sample programs, but not for production programs because
  it would be a breaking change.

This refactoring has the following user-visible effects:

- The validation error for `go run ./cmd/kube-apiserver --logging-format=json
  --add-dir-header` now references `add-dir-header` instead of `add_dir_header`.

- `staging/src/k8s.io/cloud-provider/sample` uses flags with hyphen instead of
  underscore.

- `--log-flush-frequency` is not listed anymore in the --logging-format flag's
  `non-default formats don't honor these flags` usage text because it will also
  work for non-default formats once it is needed.

- `cmd/kubelet`: the description of `--logging-format` uses hyphens instead of
  underscores for the flags, which now matches what the command is using.

- `staging/src/k8s.io/component-base/logs/example/cmd`: added logging flags.

- `apiextensions-apiserver` no longer prints a useless stack trace for `main`
  when command line parsing raises an error.

Kubernetes-commit: 21d1bcd6b8498370832fa76f680d3de56837bc83
2021-09-16 18:18:35 +02:00
Kubernetes Publisher 159a770147 Merge pull request #104711 from claudiubelu/update-pause-3.6
update pause image references to use 3.6

Kubernetes-commit: c79f7c1add652ce7c70205bb0ba2911744ce640b
2021-09-14 04:15:52 +00:00
Harjas 809211b6c8 kubectl: Use fields from event series when computing describe events for a object (#104482)
* take into account new fields for event

* add event with old event fields for test

* fix: remove unnecessary "+1" from event series count

* fix: update the assertion for failing test case

Kubernetes-commit: c6935ad50e0809c1dc2d3ac9000abda0ecb49bcc
2021-09-14 00:18:50 +00:00
Karthik K N bbcee55a4a Updated vendor files and pinned versions
Kubernetes-commit: c5b4e05834d8edceac94ab1a91c3153581534393
2021-09-13 15:42:42 +05:30
Kubernetes Publisher b137e419be Merge pull request #104884 from eddiezane/ez/update-kubectl-run-flags
Remove functionality from deprecated kubectl run flags

Kubernetes-commit: d6acb7ce01cddb611592d6b8e3c218431000d295
2021-09-10 16:45:48 +00:00
Kubernetes Publisher 512e110f9a Merge pull request #104103 from pohly/logr-1.0
klog 2.20.0, logr v1.1.0, zapr v1.1.0

Kubernetes-commit: 5b49d125b76b4d92d5f782630b75b911fee75aaa
2021-09-10 00:11:31 +00:00
Eddie Zaneski 20604e9e21 Remove functionality from deprecated kubectl run flags
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: da8f404ae09823ff5fa214397215263f095e90f2
2021-09-09 15:22:28 -06:00
Chok Yip Lau fad6761bba Improve configmap test
Kubernetes-commit: fa7ad6e4657769f767e3a34407cb6ad327d5259c
2021-09-03 15:54:11 -04:00
Kubernetes Publisher 6e3acf365d Merge pull request #104621 from jaehnri/docs/KUBECTL-1100
Fix typo in kubectl describe pods example

Kubernetes-commit: 033456a2b2c98984a9d6a3eae0445fc15935cdf4
2021-09-02 16:40:14 +00:00
Claudiu Belu 5f3d7dad09 updates pause image references
The pause:3.6 image has been published.

Also updates older / incorrect references.

Kubernetes-commit: 18936d47858b25d7de3bada57f70f1aa22981e75
2021-08-29 13:53:52 -07:00
jaehnri 72b220068c Fix typo in kubectl describe pods example
Signed-off-by: jaehnri <joao.henri.cr@gmail.com>

Kubernetes-commit: bf1b75f165d0afde7fe9bc810425b488b5c1659e
2021-08-26 21:00:18 -03:00
Zovin Khanmohammed 723266d145 Adds the PowerShell completion generation (#103758)
* Adds the powershell completion generation

* Fixes formatting based on verification script

* Changes generation to include descriptions

* Adjusts formatting and Adds startup information

* Fix build

Kubernetes-commit: dec8528abaa58a4c7fc190df2cad8848799f9891
2021-08-25 22:29:23 -05:00
Kubernetes Publisher bb3511a3bf Merge pull request #92989 from WLun001/fish-completion
add kubectl fish shell completion

Kubernetes-commit: cd80d70c3df154e8f6f2df5bfe8f7f8a490b7acc
2021-08-25 20:39:00 +00:00
Kubernetes Publisher 9de7212092 Merge pull request #103692 from justaugustus/go117
[go1.17] Update to go1.17

Kubernetes-commit: c1e69551be1a72f0f8db6778f20658199d3a686d
2021-08-25 04:46:48 +00:00
Stephen Augustus 55e15b6165 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
Stephen Augustus 21f0fb8069 generated: Run hack/lint-dependencies.sh and hack/update-vendor.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 0be115722bf30f42c7a954d5cdd4b48efd70ae77
2021-08-11 18:03:39 -04:00
Stephen Augustus 0fd163365e [go1.17] Bump golang.org/x/... dependencies
hack/pin-dependency.sh golang.org/x/crypto master
hack/pin-dependency.sh golang.org/x/net master
hack/pin-dependency.sh golang.org/x/oauth2 master
hack/pin-dependency.sh golang.org/x/sync master
hack/pin-dependency.sh golang.org/x/sys master
hack/pin-dependency.sh golang.org/x/term master
hack/pin-dependency.sh golang.org/x/time master
hack/pin-dependency.sh golang.org/x/tools master

Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 0e9881a9dc9d06aaf93723b4dfc7f4e1cb92e215
2021-08-11 18:02:07 -04:00
Kubernetes Publisher 379e98aa44 Merge pull request #104232 from lauchokyip/fixSecret
Added support for multiple --from-env flags

Kubernetes-commit: 5f0180ec051ec3f8a605b6ef2194467f5f549bfe
2021-08-24 16:44:30 +00:00
Kubernetes Publisher 764d523af8 Merge pull request #97350 from FabianKramm/master
kubectl proxy: append context host path to request path

Kubernetes-commit: 341d312066bd650e70995cd1a15925035b524a7d
2021-08-20 20:40:47 +00:00
Kubernetes Publisher ef9713bba7 Merge pull request #104466 from stbenjam/bump-utils
vendor: bump k8s.io/util to get fix for LRU cache

Kubernetes-commit: 7fcecc077dae36071901472d12fa26e5af99010c
2021-08-20 04:43:16 +00:00
Stephen Benjamin 26a721c50c vendor: bump k8s.io/util to get fix for LRU cache
This updates the k8s.io/util to pull in the fix for
https://github.com/kubernetes/kubernetes/issues/104452.

Commands run:

  ./hack/pin-dependency.sh k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
  ./hack/update-vendor.sh

Kubernetes-commit: c2532351525c2822daab61303eb4f94942a017e6
2021-08-19 17:11:35 -04:00