kubernetes-csi / csi-release-tools

shared build and test files used by kubernetes-csi projects
Apache License 2.0
21 stars 71 forks source link

Update go to 1.22.3 #252

Closed bells17 closed 1 month ago

bells17 commented 1 month ago

Bump Go version to 1.22.3 due to vulnerabilities in Go 1.22.2 identified by the Trivy vulnerability scanner.

https://github.com/kubernetes-csi/livenessprobe/pull/262 https://github.com/kubernetes-csi/livenessprobe/actions/runs/9034677921/job/24827762006?pr=262

Go updated to 1.22.3
bells17 commented 1 month ago

/retitle Update go to 1.22.3

bells17 commented 1 month ago

/cc @jsafrane

bells17 commented 1 month ago

It appears that pull-kubernetes-csi-release-tools-external-snapshotter test is in a state where running go mod tidy in response to the Go version upgrade results in changes to the go modules. Therefore, after merging this PR, it seems that updating the go modules version will be necessary on the external-snapshotter side.

https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-csi_csi-release-tools/252/pull-kubernetes-csi-release-tools-external-snapshotter/1788961194170650624

bells17 commented 1 month ago

/cc @xing-yang

xing-yang commented 1 month ago

I wonder why it failed due to recently added API validation rules:

diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumegroupsnapshot/v1alpha1/types.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumegroupsnapshot/v1alpha1/types.go
index b8de6494..4110c292 100644
--- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumegroupsnapshot/v1alpha1/types.go
+++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumegroupsnapshot/v1alpha1/types.go
@@ -36,6 +36,7 @@ type VolumeGroupSnapshotSpec struct {
    // class will be used.
    // Empty string is not allowed for this field.
    // +optional
+   // +kubebuilder:validation:XValidation:rule="size(self) > 0",message="volumeGroupSnapshotClassName must not be the empty string when set"
    VolumeGroupSnapshotClassName *string `json:"volumeGroupSnapshotClassName,omitempty" protobuf:"bytes,2,opt,name=volumeGroupSnapshotClassName"`
 }
bells17 commented 1 month ago

Apologies, it seems that there were differences unrelated to the Go version, causing make test-vendor to fail. I have created a PR to fix this issue at the following link: https://github.com/kubernetes-csi/external-snapshotter/pull/1084

bells17 commented 1 month ago

Based on the output below, it appears that make test-vendor is being skipped.

### test-vendor:
Repo uses 'go mod'.
Skipping vendor check because the Prow pre-submit job does not affect dependencies.

https://github.com/kubernetes-csi/external-snapshotter/pull/1073 https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-csi_external-snapshotter/1073/pull-kubernetes-csi-external-snapshotter-unit/1787547224096378880

bells17 commented 1 month ago

It seems that the process is skipped under the following conditions:

https://github.com/kubernetes-csi/csi-release-tools/blob/b82ee38887c684a306b57dbfaba9c0f5d3fa7921/verify-vendor.sh#L32-L37

bells17 commented 1 month ago

/retest

bells17 commented 1 month ago

@xing-yang The pull-kubernetes-csi-release-tools-external-provisioner test has passed as a result of merging the following PR: Would you please review this PR again when you have a moment?

https://github.com/kubernetes-csi/external-snapshotter/pull/1084

xing-yang commented 1 month ago

/lgtm /approve

k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bells17, xing-yang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-csi/csi-release-tools/blob/master/OWNERS)~~ [xing-yang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment