Commit Graph

11704 Commits

Author SHA1 Message Date
Patrick Ohly
ce9e668a93 golangci-lint: suppress one issue, demote others to "hints"
The voting in https://github.com/kubernetes/kubernetes/issues/117288 led to
one check that got rejected ("ifElseChain: rewrite if-else to switch
statement") and several that are "nice to know".

golangci-lint's support for issue "severity" is too limited to identify "nice
to know" issues in the output (filtering is only by linter without considering
the issue text; not part of text output). Therefore a third configuration gets
added which emits all issues (must fix and nits). The intention is to use
the "strict" configuration in pull-kubernetes-verify and the "hints"
configuration in a new non-blocking pull-kubernetes-linter-hints.

That way, "must fix" issues will block merging while issues that may be useful
will show up in a failed optional job. However, that job then also contains
"must fix" issues, partly because filtering out those would make the
configuration a lot larger and is likely to be unreliably (all "must fix"
issues would need to be identified and listed), partly because it may be useful
to have all issues in one place.

The previous approach of manually keeping two configs in sync with special
comments didn't scale to three configs. Now a single golangci.yaml.in with
text/template constructs contains the source for all three configs. A new
simple CLI frontend for text/template (cmd/gotemplate) is used by
hack/update-golangci-lint-config.sh to generate the three flavors.
2023-08-22 20:39:23 +02:00
Kubernetes Prow Robot
e043bc08d4 Merge pull request #119156 from neolit123/1.28-add-support-for-dup-extraargs
kubeadm add support for structured ExtraArgs
2023-08-21 02:49:22 -07:00
Kubernetes Prow Robot
a1fdef7d01 Merge pull request #120072 from SataQiu/fix-kubeadm-20230820
kubeadm: fix the bug that `--image-repository` flag is missing for some init phase sub-commands
2023-08-21 01:27:22 -07:00
SataQiu
093093593c kubeadm: fix the field path for JoinControlPlane.CertificateKey validation 2023-08-20 17:35:18 +08:00
SataQiu
700b55b3b2 kubeadm: fix the bug that --image-repository flag is missing for some init phase sub-commands 2023-08-20 17:18:00 +08:00
Kubernetes Prow Robot
5b2167482d Merge pull request #120064 from SataQiu/feat-kubeadm-20230819
kubeadm: add validation to verify that the CertificateKey is a valid hex encoded AES key
2023-08-19 23:59:21 -07:00
SataQiu
75a80d5aba kubeadm: add validation to verify that the CertificateKey is a valid hex encoded AES key 2023-08-20 12:47:02 +08:00
Kubernetes Prow Robot
8377e0f538 Merge pull request #120042 from chendave/typo_namespaces
kubeadm: Fix typo where API group is not correct
2023-08-19 05:53:21 -07:00
Kubernetes Prow Robot
595a57940a Merge pull request #120039 from chendave/move_testcases
kubeadm: Move the method used only in the test to `postupgrade_test.go`
2023-08-18 07:12:39 -07:00
Kubernetes Prow Robot
e2afa175e4 Merge pull request #120040 from chendave/unused_args
kubeadm: Cleanup the unused input parameters
2023-08-18 05:38:30 -07:00
Dave Chen
f407b31d42 kubeadm: Fix typo where API group is not correct
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-08-18 17:26:39 +08:00
Dave Chen
72af21e1a1 kubeadm: Cleanup the unused input parameters
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-08-18 17:20:22 +08:00
Dave Chen
1eb6282016 kubeadm: Move the method used only in the test to postupgrade_test.go
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-08-18 16:59:08 +08:00
xin.li
fd3f82531f kubeadm: increase ut coverage fo util/kubeconfig
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-08-18 14:49:59 +08:00
Kubernetes Prow Robot
4f874a224a Merge pull request #119562 from my-git9/proxyut
kubeadm: increase ut for cmd/kubeadm/app/phases/addons/proxy
2023-08-16 19:44:21 -07:00
git-jxj
a5b3a4b738 cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions
2023-08-16 09:33:01 -07:00
Lubomir I. Ivanov
7a6e056bbd kubeadm: add TODO for NewMapStringString() and CLI extra-args 2023-08-16 13:27:05 +03:00
Lubomir I. Ivanov
f3da0d4ed3 kubeadm: update the rest of the code base for structured ExtraArgs
In all places map[string]string compounds were used directly
for extra args. Modify said locations to use []Arg
and the new utilities Get/SetArgValue(), ArgumentsTo/FromCommand().
2023-08-16 13:27:05 +03:00
Lubomir I. Ivanov
a505c7160e kubeadm: adapt the validation and utils for structured ExtraArgs
Use []kubeadm.Arg instead of map[string]string when
validating ExtraArgs in the API.

Add new GetArgValue() and SetArgValue() utilities
and tests in apis/kubeadm.

Add new utils for constucting commands from and to
a []kubeadm.Arg slice.
2023-08-16 13:27:05 +03:00
Lubomir I. Ivanov
bc6fcb72a8 kubeadm: add structured ExtraArgs in v1beta4
Add a new type Arg that holds a dedicated Name and Value.
Instead of using map[string]string for ExtraArgs in the
API use []Arg.

Adapt v1beta3 conversion to convert to/from the
legacy map[string]string.
2023-08-16 13:27:05 +03:00
Kubernetes Prow Robot
b51ad13bf7 Merge pull request #119938 from my-git9/certlist-ut
kubeadm: increase ut for certs/certlist
2023-08-16 01:22:37 -07:00
Kubernetes Prow Robot
85e018634c Merge pull request #119859 from SataQiu/fix-healthcheck-client-cert-20230809
kubeadm: remove 'system:masters' organization from etcd/healthcheck-client certificate
2023-08-16 01:22:26 -07:00
Kubernetes Prow Robot
0491866c64 Merge pull request #119753 from pacoxu/kubeadm-reset-nil
kubeadm: fix nil pointer when etcd member is already removed
2023-08-15 23:12:26 -07:00
Kubernetes Prow Robot
ad15077193 Merge pull request #119742 from liggitt/unwanted-deps
Catch direct references to unwanted dependencies in kubernetes modules
2023-08-15 21:04:27 -07:00
Kubernetes Prow Robot
b406e49123 Merge pull request #119515 from haojue/dev/postupgradecomment
adjust order and fix typo for kube upgrade
2023-08-15 19:42:50 -07:00
xin.li
4950521ad8 kubeadm: increase ut for certs/certlist
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-08-16 10:04:03 +08:00
Kubernetes Prow Robot
5054f2954d Merge pull request #119279 from chendave/dryrun_init
kubeadm: Make dry-run is configurable in initConfiguration and joinConfiguration
2023-08-15 15:18:03 -07:00
Kubernetes Prow Robot
1acd489dca Merge pull request #118455 from linxiulei/managedFields
Trim managedFields in controller-manager
2023-08-15 15:17:12 -07:00
Kubernetes Prow Robot
322acc0f88 Merge pull request #117977 from liggitt/available-resources
Drop AvailableResources from controller context
2023-08-15 15:16:39 -07:00
Patrick Ohly
6ddcdef29a kube-proxy: fix combination of --config and logging command line flags
When parsing a config file, all settings derived from command line flags are
discarded because only the config settings are used. That has been the
traditional behavior for non-logging flags.

But `--config ... -v=4` used to work until
71ef0dafa7 added logging to the configuration.
To restore the original behavior, kube-proxy now:
- parses flags
- reads the config file
- applies logging settings from the flags to the config loaded from file
- uses that merged config
2023-08-10 11:14:04 +02:00
SataQiu
5fb543a411 kubeadm: remove 'system:masters' organization from etcd/healthcheck-client certificate 2023-08-09 19:23:06 +08:00
Paco Xu
3a2c4d6f09 kubeadm: fix nil pointer when etcd member is already removed 2023-08-04 11:37:00 +08:00
Jordan Liggitt
a5fff9a5d0 Catch direct references to unwanted dependencies in kubernetes modules 2023-08-02 15:44:25 -04:00
Jordan Liggitt
b6ae858e01 Drop AvailableResources from controller context 2023-08-01 14:52:45 -04:00
xin.li
1b8fb69d9e kubeadm: increase ut for cmd/kubeadm/app/phases/addons/proxy
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-07-26 16:28:07 +08:00
haojue
6d244728b9 adjust order and fix typo for kube upgrade 2023-07-22 00:03:41 -04:00
Alexander Zielenski
ef8670c946 refactor: replace usage of v1alpha1 with v1beta1
v1alpha -> v1beta

fill in DenyAction where there is no ParameterNotFoundAction
2023-07-21 13:41:24 -07:00
Alexander Zielenski
88becfc0ba api: add v1beta1 ValidatingAdmissionPolicy/Binding types and storage 2023-07-20 13:24:09 -07:00
Kubernetes Prow Robot
8c1dc65da9 Merge pull request #119390 from sohankunkerkar/add-dropin
cmd/kubelet: implement drop-in configuration directory for kubelet
2023-07-18 19:44:02 -07:00
Sohan Kunkerkar
06a81d1395 cmd/kubelet: implement drop-in configuration directory for kubelet
This implements a drop-in configuration directory for the kubelet
by introducing a "--config-dir" flag. Users can provide individual
kubelet config snippets in separate files, formatted similarly to
kubelet.conf. The kubelet will process the files in alphanumeric order,
appending configurations if subfield(s) doesn't exist, overwriting them if
they do, and handling lists by overwriting instead of merging.

Co-authored-by: Yu Qi Zhang <jerzhang@redhat.com>
2023-07-18 21:41:14 -04:00
Richa Banker
c1aef65640 Add integration test 2023-07-18 17:36:30 -07:00
Richa Banker
cd5f3d9f9d Add impl for uvip 2023-07-18 17:36:22 -07:00
Eric Lin
173b5a75b9 Trim managedFields in controller-manager
Signed-off-by: Eric Lin <exlin@google.com>
2023-07-18 18:31:26 +00:00
Kubernetes Prow Robot
ff90c1cc73 Merge pull request #119374 from danwinship/kep-3178-ga
move KEP-3178 IPTablesOwnershipCleanup to GA
2023-07-17 15:53:47 -07:00
Dan Winship
f1e7386fbc Deprecate now-unused kubelet iptables flags 2023-07-17 16:51:47 -04:00
Peter Hunt
bfa62e0009 kubelet: retry RuntimeConfig call and prep for nil values from GetLinux
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2023-07-17 13:05:30 -04:00
Markus Lehtonen
d7797fbc61 kubelet: get cgroup driver config from CRI
This patch modifies kubelet to get the cgroup driver setting from the
CRI runtime using the newly added RuntimeConfig rpc. The new code path
only takes place if the KubeletCgroupDriverFromCRI feature gate is
enabled. If the runtime returns a not-implemented error kubelet falls
back to using the cgroupDriver configuration option, with a log message
instructing the user to upgrade to w newer container runtime. Other rpc
errors cause kubelet to exit as is the case if the runtime returns an
unknown cgroup driver.
2023-07-17 12:27:05 -04:00
Markus Lehtonen
fd434003f3 kubelet: initialization of runtime service earlier in the startup
This patch refactors the kubelet startup code to initialize the runtime
service earlier in the startup sequence. We want this to be able to
query the cgroup driver setting from the CRI befure initializing the
cgroup manager.
2023-07-17 12:27:05 -04:00
Dave Chen
2ce07981af kubeadm: Make dry-run is configurable in joinConfiguration
Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-17 17:37:50 +08:00
Dave Chen
f5a6797e56 kubeadm: Make dry-run is configurable in initConfiguration
The `dry-run` flag was able to use with the config file, since it was not
configurable in the config file.

Make it configurable in v1beta4, so that eventually, kubeadm could deprecate
the flag and suggest to use the config file instead.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2023-07-17 17:37:45 +08:00