Commit Graph

22 Commits

Author SHA1 Message Date
Arda Güçlü
a5698efff2 Ignore api-resources not found error until it's ready 2022-12-21 10:34:53 +03:00
Oscar Utbult
61cd37b806 Update shellcheck version (0.7.2 -> 0.8.0) and fix findings 2022-11-08 11:53:57 +01:00
Shyam Jeedigunta
b31301fa24 Integration test for kubectl --disable-compression flag 2022-09-20 16:09:52 -07:00
Jordan Liggitt
fba69f7eb9 Change test/cmd to test deprecations using a CRD 2022-05-04 16:00:57 -04:00
Yuvaraj Kakaraparthi
a5aa858d44 kubectl: add --support to get, patch, edit and replace commands
Co-authored-by: Nikhita Raghunath <nikitaraghunath@gmail.com>
2022-03-24 09:49:12 +05:30
Patrick Ohly
a5d2d6fec3 cli: let kubectl handle error printing
cli.Run was an attempt to elliminate error handling in Kubernetes
commands. However, it had to rely on heuristics that are not necessarily right
for all commands.

kubectl is one example which has its own error printing code that should be
used in all cases after a command failure. It now gets used also for
`--warnings-as-errors`. Previously, that caused the following message to be
logged at the end:

  E0110 16:56:01.987555  202060 run.go:120] "command failed" err="1 warning received"

Now it ends with:

 error: 1 warning received
2022-01-10 17:09:30 +01:00
wangyysde
d2abddd909 rename v2beta2 to v2
Signed-off-by: wangyysde <net_use@bzhy.com>

Generation swagger.json.

Use v2 path for hpa_cpu_field.

run update-codegen.sh

Signed-off-by: wangyysde <net_use@bzhy.com>
2021-11-09 10:34:54 +08:00
Patrick Ohly
1957fb6508 command lines: harmonize command line parse error handling
The recommendation from #sig-cli was to print usage, then the error. Extra care
is taken to only print the usage instruction when the error really was about
flag parsing.

Taking kube-scheduler as example:

  $ _output/bin/kube-scheduler
  I0929 09:42:42.289039  149029 serving.go:348] Generated self-signed cert in-memory
  ...
  W0929 09:42:42.489255  149029 client_config.go:620] error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
  E0929 09:42:42.489366  149029 run.go:98] "command failed" err="invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable"

  $ _output/bin/kube-scheduler --xxx
  Usage:
    kube-scheduler [flags]

  ...
       --vmodule moduleSpec
                  comma-separated list of pattern=N settings for file-filtered logging

  Error: unknown flag: --xxx

The kubectl behavior doesn't change:

  $ _output/bin/kubectl get nodes
  Unable to connect to the server: dial tcp: lookup xxxx: No address associated with hostname

  $ _output/bin/kubectl --xxx
  Error: unknown flag: --xxx
  See 'kubectl --help' for usage.
2021-09-30 13:46:49 +02:00
Chok Yip Lau
e43e9696cc Fixed sort-by not sorting Resources as expected 2021-05-25 21:37:52 -04:00
David Eads
2fb8420756 update test-cmd to avoid removed beta APIs 2021-04-19 10:06:37 -04:00
Shihang Zhang
d40f0c43c4 separate RootCAConfigMap from BoundServiceAccountTokenVolume 2020-11-04 17:10:39 -08:00
Jordan Liggitt
59dfac587f Fix assert methods 2019-11-07 02:26:45 -05:00
Xiangyang Chu
eee32a6a88 Fix shellcheck failures in test/cmd/g.*sh 2019-05-17 15:40:14 +08:00
Jordan Liggitt
e5778f05b9 Fix unstructured list interface compatibility, fix kubectl paging 2019-05-08 02:00:18 -04:00
Jingfang Liu
beacc87ebf add cmdline tests for -k 2019-02-25 16:31:03 -08:00
Maciej Szulik
885bed15da Introduce -A as a shorthand for --all-namespaces in kubectl 2018-12-19 14:37:43 +01:00
k8s-ci-robot
3f5db92840
Merge pull request #68812 from WanLinghao/token_projection_ca_secret_create
Create Ca-certificate configmap  used by token projected volume
2018-11-08 10:57:25 -08:00
WanLinghao
efac533f92 To inject ca.crt into container when projected volume was specified, configmap should be created in each namespace.
This patch add a controller called "root-ca-cert-publisher" to complete above job as well as some bootstrap rbac policies.
2018-11-08 11:33:47 +08:00
Ibrahim Mbaziira
7480650e05
Remove error output from stdout to stderr 2018-10-19 00:28:36 +03:00
juanvallejo
c32d10f3cf
add prototype sorting for table rows 2018-08-30 16:09:05 -04:00
juanvallejo
df0077f362
prevent "No resources found" output on forbidden error 2018-08-15 13:54:23 -04:00
David Eads
aa8110044d straight split of test-cmd 2018-07-05 11:38:26 -04:00