Commit Graph

104075 Commits

Author SHA1 Message Date
xing-yang
2833aee8ff Bubble up to pkg/volume/OWNERS file 2021-09-30 14:01:28 +00:00
Madhav Jivrajani
a43fca76ea run hack/{pind-dependency.sh, update-vendor.sh}
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2021-09-30 19:15:43 +05:30
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
Patrick Ohly
00e4a599f6 command lines: always show flags with hyphens
All Kubernetes commands should show flags with hyphens in their help text even
when the flag originally was defined with underscore. Converting a command to
this style is not breaking its command line API because the old-style parameter
with underscore is accepted as alias.

The easiest solution to achieve this is to set normalization shortly before
running the command in the new central cli.Run or the few places where that
function isn't used yet.

There may be some texts which depends on normalization at flag definition time,
like the --logging-format usage warning. Those get generated assuming that
hyphens will be used.
2021-09-30 13:46:49 +02:00
Patrick Ohly
21d1bcd6b8 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.
2021-09-30 13:46:49 +02:00
Kubernetes Prow Robot
38746752af
Merge pull request #104365 from jyz0309/adjust-log-level
[PodSecurity] log nsPolicy evaluation for the request
2021-09-30 01:00:08 -07:00
Umanga Chapagain
e262278772
fix incorrect structured log patterns
proxy/winkernel/proxier.go was using format specifier with
structured logging pattern which is wrong. This commit removes
use of format specifiers to align with the pattern.

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2021-09-30 11:10:13 +05:30
Kubernetes Prow Robot
ed40a89f2e
Merge pull request #104965 from CKchen0726/invalid_nil_check
remove redundant nil check
2021-09-29 19:44:07 -07:00
Kubernetes Prow Robot
dac94e1c9e
Merge pull request #105121 from wujiangfa-xlauncher/master
fix top node output format incorrect
2021-09-29 16:42:08 -07:00
Kubernetes Prow Robot
d551560a78
Merge pull request #105330 from liggitt/importboss-doc
Make package paths referenced by import boss valid
2021-09-29 15:34:56 -07:00
Kubernetes Prow Robot
995a1c5abf
Merge pull request #105117 from cmssczy/fix_useless_error_handling
handle error when parse Quantity
2021-09-29 15:34:44 -07:00
Kubernetes Prow Robot
bac45abf77
Merge pull request #105327 from julianvmodesto/kubectl-dry-run-flag-removals
Remove deprecated kubectl --dry-run values.
2021-09-29 13:31:21 -07:00
Elana Hashman
132fa1cbf3
Revert "Build non-static binaries with PIE buildmode" 2021-09-29 11:36:20 -07:00
Kubernetes Prow Robot
1ad3e14f1f
Merge pull request #105188 from nilo19/bug/cherry-pick-794
fix: consolidate logs for instance not found error
2021-09-29 11:23:21 -07:00
Kubernetes Prow Robot
6f47878926
Merge pull request #105107 from cici37/addFG
Add feature gate CustomResourceValidationExpressions
2021-09-29 08:08:48 -07:00
Kubernetes Prow Robot
bceefb7a86
Merge pull request #101125 from damemi/kcm-wire-contexts
Set up kube-controller-manager functions to accept contexts
2021-09-29 07:02:49 -07:00
Kubernetes Prow Robot
49f9e227e9
Merge pull request #105247 from Jille/patch-1
Fix double formatting on error message
2021-09-29 04:14:48 -07:00
jonyhy
010641c849 test: add benchmark test
Signed-off-by: jonyhy <yun.hao@daocloud.io>
2021-09-29 17:46:11 +08:00
Francesco Romani
077c0aa1be node: graduate CPUManagerPolicyOptions to beta
We graduate the `CPUManagerPolicyOptions` feature to beta
in the 1.23 cycle, and we add new experimental feature gates
to guard new options which are planned in the 1.23 and in the
following cycles.

We introduce additional feature gate called `CPUManagerPolicyAlphaOptions` and
`CPUManagerPolicyBetaOptions`. The basic idea is to avoid the
cumbersome process of adding a feature gate for each option, and to have
feature gates which track the maturity level of _groups_ of options.
Besides this change, the graduation process, and the process in general,
for adding new policy options is still unchanged.

The `full-pcpus-only` option added in the 1.22 cycle is intentionally
moved into the beta policy options

For more details:
- KEP: https://github.com/kubernetes/enhancements/pull/2933
- sig-arch discussion:
  https://groups.google.com/u/1/g/kubernetes-sig-architecture/c/Nxsc7pfe5rw

Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-09-29 11:40:03 +02:00
Kubernetes Prow Robot
fafbe3aa51
Merge pull request #103900 from ash2k/ash2k/cache-mapper-and-client
Cache rest mapper and discovery client
2021-09-29 02:10:49 -07:00
Kubernetes Prow Robot
c9b9c40109
Merge pull request #105315 from wzshiming/test/events-expansion
Add unit test coverage for events expansion
2021-09-29 01:00:48 -07:00
Kubernetes Prow Robot
32fefd5580
Merge pull request #105048 from mauriciopoppe/fix-double-storage-class-setup
Remove a duplicate StorageClass creation call
2021-09-28 23:36:48 -07:00
Kubernetes Prow Robot
598a8829c1
Merge pull request #105267 from llhuii/fix-topology-hint-bug
TopologyAwareHints: fix getHintsByZone bug
2021-09-28 20:54:48 -07:00
llhuii
e7350d126e TopologyAwareHints: add getHintsByZone unit test 2021-09-29 10:39:03 +08:00
Shiming Zhang
13fe94f136 Add unit test coverage for events expansion 2021-09-29 10:11:27 +08:00
jyz0309
f157aa17f2 bump version to 5
Signed-off-by: jyz0309 <45495947@qq.com>
2021-09-29 09:30:16 +08:00
Kubernetes Prow Robot
198c9c70f1
Merge pull request #104925 from prameshj/ilbracefix
Process GCE ILB services with the v1 annotation in the service controller
2021-09-28 18:06:48 -07:00
Qi Ni
0406ba32ea fix: skip not found nodes when reconciling LB backend address pools 2021-09-29 08:00:28 +08:00
“Ibrahim
26ce6df217 Update Windows base images GCE provider 2021-09-28 22:40:04 +00:00
Jordan Liggitt
f6b831aeac Make package paths referenced by import boss valid 2021-09-28 18:05:58 -04:00
Kubernetes Prow Robot
66e1d27a59
Merge pull request #104300 from wojtek-t/converting_informer
Create TransformingInformer
2021-09-28 14:02:34 -07:00
Kubernetes Prow Robot
3b2b23cee7
Merge pull request #105234 from wojtek-t/optimize_indexer
Optimize indexer
2021-09-28 12:50:34 -07:00
Kubernetes Prow Robot
e138afc35d
Merge pull request #105213 from yxxhero/remove_StartedPodsErrorsTotal_metrice_message
Remove StartedPodsErrorsTotal metric message
2021-09-28 10:45:16 -07:00
Julian V. Modesto
e0b7a85ee5 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.
2021-09-28 10:21:04 -04:00
Anago GCB
b290671b1b Merge remote-tracking branch 'origin/master' 2021-09-28 14:20:58 +00:00
Patrick Ohly
c9c4357c03 cli: centralize command execution
Many commands have the same boilerplate code for setting up randomization and
logging. The new k8s.io/component-base/cli.Run method contains that common code
and simplifies the code of commands which are using it.
2021-09-28 15:19:52 +02:00
Anago GCB
7171ff8658 CHANGELOG: Update directory for v1.23.0-alpha.3 release 2021-09-28 12:58:38 +00:00
Kubernetes Prow Robot
80e9eda95f
Merge pull request #105175 from sanposhiho/scheduler/usage-message
cmd/kube-scheduler: add usage message only when parsing flags failed
2021-09-28 05:44:43 -07:00
Kubernetes Prow Robot
bf000e8770
Merge pull request #104770 from pacoxu/dual-stack-ga-kubeadm
cleanup: DualStack GA for kubeadm
2021-09-28 03:42:42 -07:00
Shiming Zhang
f63c135e1f Update comments 2021-09-28 18:07:50 +08:00
Kubernetes Prow Robot
2ba872513d
Merge pull request #105283 from ricky-rav/dev_BZ_1997235
add NET_RAW capability to server container in "should drop INVALID conntrack entries" e2e test
2021-09-28 02:28:42 -07:00
jyz0309
88e35021e6 address comment
Signed-off-by: jyz0309 <45495947@qq.com>
2021-09-28 17:15:44 +08:00
Paco Xu
751ad37a05 kubeadm: cleanup remove some empty feature gate for dual-stack 2021-09-28 15:34:26 +08:00
Kubernetes Prow Robot
9005160245
Merge pull request #105272 from wojtek-t/add_jittering_for_kubelet
Add jittering for Kubelet status computing
2021-09-28 00:20:42 -07:00
Riccardo Ravaioli
d97a1b8d63 add NET_RAW capability to server container in "should drop INVALID conntrack entries" test
The boom-server container forges out-of-order TCP packets and injects them into the network. This requires the container to have the CAP_NET_RAW linux capability, otherwise the test will fail.

Signed-off-by: Riccardo Ravaioli <rravaiol@redhat.com>
2021-09-28 08:50:55 +02:00
wojtekt
75273a0689 Optimize index updating 2021-09-28 08:40:09 +02:00
kerthcet
75a255d2ed remove scheduler component config v1beta1
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-09-28 13:13:17 +08:00
Kubernetes Prow Robot
16fdb2f391
Merge pull request #105196 from yibozhuang/improve-scheduler-pv-not-exist-err
Enhance ErrReasonPVNotExist in volumebinding scheduler plugin
2021-09-27 19:04:42 -07:00
llhuii
528cd30145 TopologyAwareHints: fix getHintsByZone bug
The bug could result in the EndpointSlice controller unnecessarily updating
EndpointSlices associated with a Service that had Topology Aware Hints enabled.
2021-09-28 09:02:24 +08:00
Kubernetes Prow Robot
ce4958d908
Merge pull request #105009 from harjas27/printer_event_count
kubectl: remove extra +1 for printing event count
2021-09-27 16:24:43 -07:00