Commit Graph

9818 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
4c8fca2f06
Merge pull request #112894 from pohly/e2e-framework-test-labels
e2e framework: test labels
2023-10-13 02:40:43 +02:00
Kubernetes Prow Robot
5faebe11b4
Merge pull request #120562 from ArkaSaha30/govulncheck-script
Add govulncheck script to expose go vulnerabilities
2023-10-12 18:50:19 +02:00
John Howard
dc334b953d
dependencies: update otel-go dependencies 2023-10-10 19:16:07 +00:00
Patrick Ohly
535ab74346 e2e framework: track and report internal bugs
If something goes wrong during the test registration phase, the only solution
so far was to panic. This is not user-friendly and only allows to report one
problem at a time.

If initialization can continue, then a better solution is to record a bug,
continue, and then report all bugs together.

This also works when just listing tests. The new verify-e2e-suites.sh uses that
to check all test suites (identified as "packages that call
framework.AfterReadingAllFlags", with some exceptions) as part of
pull-kubernetes-verify.

Example output for a fake

    framework.RecordBug(framework.NewBug("fake bug during SIGDescribe", 0))

in test/e2e/storage/volume_metrics.go:
```
$ hack/verify-e2e-suites.sh
go version go1.21.1 linux/amd64
ERROR: E2E test suite invocation failed for test/e2e.
   ERROR: E2E suite initialization was faulty, these errors must be fixed:
   ERROR: test/e2e/storage/volume_metrics.go:49: fake bug during SIGDescribe
E2E suite test/e2e_kubeadm passed.
E2E suite test/e2e_node passed.
```
2023-10-10 18:15:46 +02:00
Patrick Ohly
f538be659c hack: fix update of golangci-lint verify scripts
b190ea0c9 accidentally enabled verify-golangci-lint-pr-hints.sh (non-blocking!)
in the normal "make verify" (blocking!).
2023-10-10 09:03:20 +02:00
Patrick Ohly
b190ea0c96 hack: update golangci-lint verify scripts
Instead of invoking verify-golangci-lint.sh directly from Prow jobs,
those Prow jobs should use "make verify WHAT=...". The advantage is
that the common code for running verify targets will be used, which
includes producing JUnit files.

Providing simple wrappers for strict linting of PRs (=
verify-golangci-lint-pr.sh) and event stricter linting of PRs with hints
enabled (= verify-golangci-lint-pr-hints.sh) enables those WHAT targets.
2023-10-09 20:14:47 +02:00
Kubernetes Prow Robot
f19b62fc09
Merge pull request #120959 from pohly/e2e-test-whitespace-cleanup
e2e: remove redundant spaces in test names
2023-10-05 00:41:59 +02:00
Kubernetes Prow Robot
f936f69cf9
Merge pull request #120729 from pohly/events-context
k8s.io/client-go/tools/[events|record]: support context
2023-10-04 15:45:16 +02:00
Kubernetes Prow Robot
56f330493c
Merge pull request #120822 from akhilerm/change-from-deprecated-fields
update rules to switch from deprecated dir field
2023-10-04 14:00:38 +02:00
Anish Ramasekar
2f5708833a
[KMSv2] pkcs11 reference implementation using SoftHSM
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2023-09-29 16:57:26 +00:00
Patrick Ohly
0e8a1f1816 e2e: remove redundant spaces in test names
The spaces are redundant because Ginkgo will add them itself when concatenating
the different test name components. Upcoming change in the framework will
enforce that there are no such redundant spaces.
2023-09-29 08:30:57 +02:00
ArkaSaha30
7437ad2617
Add/update prechecks to verify-govulncheck.sh
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
2023-09-27 21:05:17 +05:30
Patrick Ohly
27a68aee3a k8s.io/client-go/tools: support context for event recording
Using StartRecordingToSinkWithContext instead of StartRecordingToSink and
StartLogging instead of StartStructuredLogging has several advantages:

- Spawned goroutines no longer get stuck for extended periods of
  time during shutdown when passing in a context that gets canceled.
- Log output can be directed towards a specific logger instead of the global
  default, for example one which writes to a testing.T instance.
- The new methods return an error when something went wrong instead of
  merely recording the error.

That last point is the reason for deprecating the old methods instead of merely
adding new alternatives.

Setting a context when constructing an EventBroadcaster makes calling Shutdown
optional. It can also be used to specify the logger.

Both EventRecorder interfaces in tools/events and tools/record now have a
WithLogger helper. Using that method is optional, but recommended to support
contextual logging properly. Without it, errors that occur while emitting an
event are not associated with the caller.
2023-09-27 09:06:09 +02:00
Kubernetes Prow Robot
ca1371ebfa
Merge pull request #120423 from saschagrunert/gci-mounter-static
Document `cluster/gce/gci/mounter` as static binary
2023-09-26 06:50:00 -07:00
Akhil Mohan
2ce4f85a46
update verify script to check deprecated fields
Signed-off-by: Akhil Mohan <makhil@vmware.com>
2023-09-25 21:37:40 +05:30
Joseph Anttila Hall
1b602ffd9a
Bump Konnectivity to 0.28.0 2023-09-22 13:10:24 -07:00
Arka Saha
9e34aa306c
Update hack/verify-govulncheck.sh
Co-authored-by: LX <hwdefcom@outlook.com>
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
2023-09-13 12:58:33 +05:30
Kubernetes Prow Robot
921fd1b6fa
Merge pull request #120312 from HirazawaUi/cni-auto-arch-select
Add automatic arch and os selection for the deploy cni plugin
2023-09-12 07:48:13 -07:00
Kubernetes Prow Robot
14ed7e8609
Merge pull request #120579 from BenTheElder/cleanup
remove unnecessary kube::golang::verify_go_version calls
2023-09-11 22:16:15 -07:00
Kubernetes Prow Robot
95c6295636
Merge pull request #120279 from BenTheElder/gotoolchain
handle GOTOOLCHAIN in kube::golang::verify_go_version
2023-09-11 17:04:10 -07:00
Benjamin Elder
7ad0e451ac remove unnecessary kube::golang::verify_go_version calls
These scripts don't use go, GOPATH, etc.

They only need to cd to KUBE_ROOT and run git/grep. verify_go_version is wasting time.
2023-09-11 14:06:28 -07:00
Benjamin Elder
d1b5a9953a handle GOTOOLCHAIN in kube::golang::verify_go_version
for now:
- shim FORCE_HOST_GO to GOTOOLCHAIN=local
- treat GOTOOLCHAIN set and !=auto like FORCE_HOST_GO
- otherwise set GOTOOLCHAIN=go${GO_VERSION} and fallback to gimme if necessary

TODO: set toolchain statements in go.mod files and keep them in sync
2023-09-11 12:04:45 -07:00
ArkaSaha30
190f9d0d4b
Add govulncheck script to expose go vulnerabilities
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
2023-09-11 16:34:50 +05:30
HirazawaUi
c1a0aa08e3 Add cni plugin auto Arch and OS selection 2023-09-09 20:33:12 +08:00
Kubernetes Prow Robot
9068bec08e
Merge pull request #120454 from pohly/golangci-lint-hint-deprecated
golangci-lint: warn about deprecated APIs only as hints
2023-09-08 00:32:25 -07:00
SataQiu
dbd3eb5419 remove logcheck.yaml 2023-09-07 18:24:13 +08:00
Jordan Liggitt
6cd446a206
Add cloud library to unwanted deps 2023-09-06 21:48:30 -04:00
Jordan Liggitt
9f76d8d45a
Track vendor status of unwanted deps 2023-09-06 21:48:30 -04:00
Patrick Ohly
c4dd16a1f8 golangci-lint: warn about deprecated APIs only as hints
This particualar warning didn't make it into
https://github.com/kubernetes/kubernetes/issues/117288.  Discussion on Slack
concluded that "it's hard to have a universal policy for all functions marked
deprecated" and thus this can only be a hint which must be considered on a
case-by-case basis.

For example, APIs like sets.String are very unlikely to ever go away, therefore
it is entirely up to developers whether they switch to sets.Set even though
sets.String is marked as deprecated.

Ideally, the deprecation message should explain this. It doesn't for sets ("use
generic Set instead"), so a better message in that case would have been
"consider using generic Set instead".
2023-09-06 13:30:51 +02:00
cpanato
67858e1ff0
Bump images, dependencies and versions to go 1.21.0
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-09-06 12:06:51 +02:00
Sean Sullivan
a0d6a815fc WebSocket Client and V5 RemoteCommand Subprotocol 2023-09-05 11:37:18 -07:00
Sascha Grunert
e190e179b3
Document cluster/gce/gci/mounter as static binary
The binary is already statically linked so we should mark it correctly
as-is.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-09-05 13:37:50 +02:00
Jordan Liggitt
3e252857c1
Add unwanted cloud deps to track 2023-09-01 08:58:21 -04:00
Kubernetes Prow Robot
8dc002532b
Merge pull request #120284 from vbatts/add_unwanted_modules
Add unwanted modules
2023-08-31 20:52:41 -07:00
Vincent Batts
f22d854072
unwanted-dependendencies: updating references, and jq
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2023-08-31 08:22:27 -04:00
Vincent Batts
3bc6ee6fef
unwanted-dependencies: sort this list
Seperated this commit from the prior, to keep it clear the additions.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2023-08-30 21:50:31 -04:00
Vincent Batts
eb5695b0c5
unwanted-dependencies: adding archived repos
Ref: #120276

This is a first step, and then we'll work to clean the code next.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2023-08-30 21:49:17 -04:00
SataQiu
2825519da2 apf: remove v1alpha1 API 2023-08-30 20:48:42 +08:00
Kevin Hannon
5dbec5c715 local debugging should utilize the same defaults as prod 2023-08-29 16:38:24 -04:00
Kubernetes Prow Robot
10c622e99a
Merge pull request #119994 from SataQiu/remove-scheduler-v1beta3
scheduler: remove deprecated v1beta3 KubeSchedulerConfiguration component config
2023-08-24 15:31:17 -07:00
Kubernetes Prow Robot
232d343d58
Merge pull request #119969 from saschagrunert/cni-plugins
Update CNI plugins to v1.3.0
2023-08-23 12:41:57 -07:00
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
Patrick Ohly
6a16c076e7 hack: move common "verify generated" shell code into function
Several verify scripts used the same pattern of "check for clean working tree,
generated files, check for diffs". The code for that is now in
kube::verify::generated, defined in hack/lib/verify-generated.sh, and those
scripts just source that.
2023-08-22 20:39:23 +02:00
Davanum Srinivas
3e9a4c15a8
Restrict what imports get into code within test/e2e_node
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-08-21 15:04:23 -04:00
Madhav Jivrajani
a422d11c77 prep for go1.21: use -e in go list
For some reason, in go1.21, go list does not allow
importing main packages anymore, even if it is for
the sake of tracking dependencies (which is a valid
use case).

A suggestion to work around this is to use -e flag to
permit processing of erroneous packages. However, this
doesn't seem prudent.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2023-08-17 17:46:30 +05:30
Kubernetes Prow Robot
f563910656
Merge pull request #119728 from pohly/ssa-forbid-extract-calls
SSA: prevent usage of Extract calls via forbidigo
2023-08-17 03:25:33 -07:00
Sascha Grunert
7933368460
Update CNI plugins to v1.3.0
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-08-17 09:50:53 +02:00
SataQiu
427b703c37 scheduler: remove deprecated v1beta2 KubeSchedulerConfiguration 2023-08-17 13:27:21 +08:00
Kubernetes Prow Robot
aef70da210
Merge pull request #119860 from pohly/golangci-lint-update
golangci-lint update and support for Go 1.21
2023-08-16 11:37:01 -07:00
Kubernetes Prow Robot
63351cce1c
Merge pull request #119977 from liggitt/optional-gomaxprocs
Make gomaxprocs install optional, limit to tests
2023-08-16 08:24:26 -07:00