Commit Graph

9869 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
be62153915
Merge pull request #122416 from pohly/e2e-gomega-be-true-or-false
e2e: forbid usage of gomega.BeTrue/False
2024-01-02 16:46:57 +01:00
Kubernetes Prow Robot
9680c84b9c
Merge pull request #121836 from skitt/verify-no-vendor-cycles-go
verify-no-vendor-cycles: set up Go environment
2024-01-02 16:46:39 +01:00
Kubernetes Prow Robot
58d023e178
Merge pull request #121894 from thockin/build_trimpath
build: use -trimpath in non-DBG mode
2023-12-29 04:38:51 +01:00
Tim Hockin
e3686246ea
Fix update-openapi-spec to not change caller CWD 2023-12-25 13:59:10 -08:00
Kubernetes Prow Robot
40c729c680
Merge pull request #122436 from pohly/log-warn-context
hack/tools: bump logtools to v0.8.0
2023-12-22 14:32:38 +01:00
Patrick Ohly
51f3b705c6 hack/tools: bump logtools to v0.8.0
This adds support for marking functions and methods as "don't use in code which
supports contextual logging".
2023-12-21 15:12:40 +01:00
Mohamed Omar Zaian
c8a2d5684d etcd: Update to version 3.5.11 2023-12-20 11:18:35 +01:00
Patrick Ohly
36cceff0a3 e2e: forbid usage of gomega.BeTrue/False
`BeTrue` without explanation in `Should` just prints "false is not true", which
isn't a useful failure message. Even with an explanation that message is still
printed, which is just noise. The new BeTrue/FalseBecause avoid that by
requiring that an explanation is provided and using that instead of "false is
not true".

In Kubernetes, we can enforce the usage of those better alternatives or the
if+Fail combination via forbidigo. Because we have existing code which still
needs to be updated, this can only be a hint for now.

Some examples found with this:

ERROR: test/e2e/apimachinery/protocol.go:75:20: use of `o.BeTrue` forbidden because "it does not produce a good failure message, use BeTrueBecause with an explicit printf-style failure message instead or plain Go: if ... { ginkgo.Fail(...) }" (forbidigo)
ERROR: 			o.Expect(ok).To(o.BeTrue())
ERROR: 			                ^

ERROR: test/e2e_node/unknown_pods_test.go:163:52: use of `gomega.BeTrue` forbidden because "it does not produce a good failure message, use BeTrueBecause with an explicit printf-style failure message instead or plain Go: if ... { ginkgo.Fail(...) }" (forbidigo)
ERROR: 			}, f.Timeouts.PodStart, f.Timeouts.Poll).Should(gomega.BeTrue())
ERROR: 			                                                ^

The solution might also be to write a custom matcher, but that is a bit hard to
explain in the forbidigo message.
2023-12-20 10:11:56 +01:00
James Blair
b6c1f8ef08
Fix etcd repository path to prevent redirects.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-12-16 19:50:02 +13:00
Kubernetes Prow Robot
d19420f3ec
Merge pull request #122210 from dims/trying-to-fix-local-up-cluster
Explicitly stop/start docker to fix local-up-cluster.sh
2023-12-15 09:45:49 +01:00
Patrick Ohly
ced99383d5 logcheck: remove redundant entry for pkg/scheduler
Contextual implies structured, so listing pkg/scheduler as contextual is
enough.
2023-12-14 20:22:04 +01:00
Patrick Ohly
b450224c12 golangci-lint: inline logcheck configuration
This has the advantage that the golangci-lint cache gets invalidated
automatically each time the logcheck config changes.
2023-12-14 20:21:58 +01:00
Patrick Ohly
49084fe577 golangci-lint: logcheck v0.7.0, golangci-lint v1.55.2
This adds support for the new golangci-lint plugin interface and settings
mechanism.
2023-12-14 20:21:19 +01:00
Kubernetes Prow Robot
e12d4b63d6
Merge pull request #121773 from pohly/zapr-update
dependencies: zapr v1.3.0, zap v1.26.0
2023-12-14 18:14:22 +01:00
Kubernetes Prow Robot
485e57c395
Merge pull request #122250 from thockin/fix_verify-licenses
Fix verify-licenses.sh
2023-12-14 07:27:39 +01:00
Kubernetes Prow Robot
407c2c3015
Merge pull request #122230 from thockin/update-vendor_cleanups
Small update-vendor cleanup
2023-12-14 07:27:12 +01:00
Kubernetes Prow Robot
abb336b9c9
Merge pull request #122228 from thockin/cleaner_make_clean
Simpler and less noisy make-clean
2023-12-14 07:26:54 +01:00
Ricardo Lopes
86ab185fa1
Migrate client-go/metadata to contextual logging (#122225)
* client-go: migrate metadata to contextual logging

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

* client-go: test for metadata contextual logs

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

* refactor: extract context for table driven testing

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

* refactor: pass context as first parameter

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

---------

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2023-12-14 07:26:45 +01:00
Kubernetes Prow Robot
909ad7e232
Merge pull request #121722 from danwinship/fix-typecheck
Make verify-typecheck.sh only check valid targets for a platform
2023-12-13 22:35:18 +01:00
Kubernetes Prow Robot
6d58ef4a7b
Merge pull request #121493 from BenTheElder/etcd-current
automatically setup etcd when running {verify,update}-openapi-spec.sh
2023-12-13 21:26:54 +01:00
Kubernetes Prow Robot
e8c265169b
Merge pull request #121478 from pohly/golangci-lint-message
verify-golangci-lint.sh: clarify intended usage of warnings
2023-12-13 21:26:45 +01:00
Tim Hockin
87c6b0d69f
Smallish update-vendor cleanup 2023-12-11 13:29:47 -08:00
Tim Hockin
7dfe3d866b
Fix verify-licenses.sh
This still feels like a hack, but less horrible now.  Running this pases
without error.
2023-12-09 17:48:48 -08:00
Tim Hockin
b9ff6b25f2
Simpler and less noisy make-clean 2023-12-08 09:20:44 -08:00
Davanum Srinivas
48671a3a20
explicitly stop/start docker to fix up local-up-cluster.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-12-06 20:54:08 -05:00
Tim Hockin
37b7ae6b93
build: use -trimpath in non-DBG mode 2023-11-27 09:12:45 -08:00
Stephen Kitt
f040d9012c
verify-no-vendor-cycles: set up Go environment
This script relies on Go but doesn't set up the private Go environment
(which ensures that the go command meets k/k's requirements). This
fixes that.

As a drive-by improvement, drop two unnecessary backslashes from
regexes (before / which doesn't need to be escaped).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-11-10 10:58:53 +01:00
Jordan Liggitt
819d1903a2
Add support for authorization-config to local-up-cluster 2023-11-08 14:36:05 -06:00
Patrick Ohly
166b71757b dependencies: zapr v1.3.0, zap v1.26.0
The new zapr adds support for slog. The new zap has various improvements. It no
longer depends on go.uber.org/atomic which enables dropping it from the
Kubernetes dependencies. github.com/pkg/errors is also no longer needed.
2023-11-07 20:24:28 +01:00
Dan Winship
e48aa09340 Make verify-typecheck.sh only check valid targets for a platform
e.g., don't try to compile kube-proxy on darwin, since we don't build
it there anyway.
2023-11-04 10:24:19 -04:00
Mohamed Omar Zaian
3c268b7524 etcd: Update to version 3.5.10 2023-11-02 10:30:41 +01:00
Kubernetes Prow Robot
9e84a02950
Merge pull request #121672 from pohly/golangci-lint-comment-check-fix
golangci-lint: tone down comment checking
2023-11-01 17:47:45 +01:00
Patrick Ohly
248100ce6d golangci-lint: tone down comment checking
39df946c06 was meant to enable stricter comment checking only for cmd/kubeadm
because the maintainers of that want that. However, the exclude rule didn't
capture all possible error texts and therefore some checks were enabled across
the entire code base.

The extended pattern is now based on the golangci-lint source code.

Also, the hint config didn't suppress any of these checks.
2023-11-01 14:59:28 +01:00
guangli.bao
bc1df9e7da bump to newest etcd: v3.5.10
Signed-off-by: guangli.bao <guangli.bao@daocloud.io>
2023-11-01 11:59:31 +08:00
Davanum Srinivas
bd233a2aa5
typo/api change in cadvisor / updated unwanted-dependencies.json
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-10-31 14:30:57 -04:00
Kubernetes Prow Robot
84fb7b5ce0
Merge pull request #121504 from pohly/golangci-lint-godoc
golangci-lint: enable doc comment checking for cmd/kubeadm
2023-10-31 12:09:17 +01:00
Abu Kashem
b24dd44904
apiserver: enable apf v1 API 2023-10-30 07:48:22 -04:00
Kubernetes Prow Robot
de4aa52171
Merge pull request #121476 from pohly/golangci-lint-update
golangci-lint v1.55.1
2023-10-27 17:43:21 +02:00
Kubernetes Prow Robot
a5ac4be4d0
Merge pull request #121549 from pohly/verify-file-sizes
verify-file-sizes.sh: ensure that no large binary files get added
2023-10-27 16:05:41 +02:00
Kubernetes Prow Robot
fd5c406112
Merge pull request #120933 from mengjiao-liu/contextual-logging-scheduler-remaining-part
kube-scheduler: convert the remaining part to use contextual logging
2023-10-27 10:30:58 +02:00
Patrick Ohly
b6afba18fb verify-file-sizes.sh: ensure that no large binary files get added
We recently had an accident were a 64MB executable got included in a PR and
wasn't caught during the manual review. This new verify script would have
caught that file.

The maximum file size is 10MB. This is intentionally low. If some legitimate
file needs to be added that is larger, then an entry in a .ignorefilesize file
in the directory of the large file can exclude that file from the check.
2023-10-26 20:08:09 +02:00
Patrick Ohly
27f6fb2fa7 hack/tools: golangci-lint v1.55.1
No particular reason for updating to it besides staying up-to-date. The new
checks in the updated ginkgolinter found issues.
2023-10-26 15:32:43 +02:00
Kubernetes Prow Robot
d0084356b3
Merge pull request #121338 from dims/working-otel-bump
Bump otel and other dependencies for CVE-2023-45142
2023-10-26 08:34:47 +02:00
Davanum Srinivas
702d911e22
working-config-otel
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-10-25 16:31:21 -04:00
Benjamin Elder
3c530eea2d automatically setup etcd when running verify/update openapi-spec.sh
1. automatically add etcd to current PATH when calling kube::etcd::install

2. call kube::etcd::install from update-openapi-spec

3. don't call kube::golang::setup_env twice
2023-10-25 11:22:45 -07:00
Patrick Ohly
39df946c06 golangci-lint: enable doc comment checking for cmd/kubeadm
Some code owners might want this for specific packages, like cmd/kubeadm.

This cannot be enabled for everything because:
- a lot of existing code doesn't pass (-> can't be in base config)
- a lot of packages don't need it (-> shouldn't even be a hint)
2023-10-25 12:30:28 +02:00
Patrick Ohly
d20edf697a verify-golangci-lint.sh: support arbitrary GOBIN
The in-tree configs use a relative path to find logcheck.so. This is useful
because then the invocation of golangci-lint also works outside of the script.
But when running with a containerized build, GOBIN points somewhere else. For
that case, a temporary copy of the configuration has to be created with an
absolute path.
2023-10-25 09:25:53 +02:00
Patrick Ohly
ae5bf8e4c6 verify-golangci-lint.sh: clarify intended usage of warnings
Contributors have created PRs because the linter found them. That is often not
necessary and should be discussed before working on a PR.

While at it, output formatting gets updated a bit (extra blank lines, wording).
2023-10-24 14:42:14 +02:00
Mengjiao Liu
2cea51221a hack/logcheck.conf: enable contextual logging in kube-scheduler 2023-10-24 17:56:59 +08:00
Jonathan Gonzalez V
a7adde53be
bump golang.org/grpc to v1.56.3
Bumping golang.org/grpc in light of CVE-2023-44487.

Signed-off-by: Jonathan Gonzalez V <jonathan.abdiel@gmail.com>
2023-10-19 15:20:07 -03:00