Skip to content

Commit

Permalink
Upgrade golang to 1.22.2 and update changelog (#181)
Browse files Browse the repository at this point in the history
* Upgrade golang to 1.22.2
* Upgrade golangci lint to 1.57.2
* Update CHANGELOG for 0.2.6
* Upgrade version
 
Signed-off-by: Marcos Yacob <marcos.yacob@hpe.com>
  • Loading branch information
MarcosDY committed Apr 10, 2024
1 parent ad38372 commit f4db454
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 1.20.1
go-version: 1.22.2
- name: Lint
run: make lint
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 1.20.1
go-version: 1.22.2
- name: Lint
run: make lint
- name: Test
Expand Down
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ run:
linters:
enable:
- bodyclose
- depguard
- durationcheck
- errorlint
- goimports
- revive
- gosec
- nakedret
- misspell
- nolintlint
- nakedret
- unconvert
- unparam
- whitespace
- gocritic
- nolintlint

linters-settings:
revive:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.2.6] - 2024-04-10

### Security

- Updated Golang to 1.22.2 and google.golang.org/grpc to v1.63.2 in order to address CVE-2023-45288 (#181)

## [0.2.5] - 2024-01-23

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the SPIFFE CSI Driver binary
FROM --platform=${BUILDPLATFORM} golang:1.21.6-alpine AS base
FROM --platform=${BUILDPLATFORM} golang:1.22.2-alpine AS base
ARG GIT_TAG
ARG GIT_COMMIT
ARG GIT_DIRTY
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PLATFORMS ?= linux/amd64,linux/arm64

build_dir := $(DIR)/.build/$(os1)-$(arch1)

golangci_lint_version = v1.51.2
golangci_lint_version = v1.57.2
golangci_lint_dir = $(build_dir)/golangci_lint/$(golangci_lint_version)
golangci_lint_bin = $(golangci_lint_dir)/golangci-lint
golangci_lint_cache = $(golangci_lint_dir)/cache
Expand Down
2 changes: 1 addition & 1 deletion example/config/spiffe-csi-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
containers:
# This is the container which runs the SPIFFE CSI driver.
- name: spiffe-csi-driver
image: ghcr.io/spiffe/spiffe-csi-driver:0.2.5
image: ghcr.io/spiffe/spiffe-csi-driver:0.2.6
imagePullPolicy: IfNotPresent
args: [
"-workload-api-socket-dir", "/spire-agent-socket",
Expand Down
2 changes: 1 addition & 1 deletion example/workload/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine
FROM golang:1.22-alpine

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion example/workload/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module workload

go 1.21
go 1.22

require github.com/spiffe/go-spiffe/v2 v2.1.7

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/spiffe/spiffe-csi

go 1.21
go 1.22

require (
github.com/container-storage-interface/spec v1.9.0
Expand Down
2 changes: 1 addition & 1 deletion internal/version/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.5
0.2.6
16 changes: 8 additions & 8 deletions pkg/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ func New(config Config) (*Driver, error) {
// Identity Server
/////////////////////////////////////////////////////////////////////////////

func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
func (d *Driver) GetPluginInfo(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
return &csi.GetPluginInfoResponse{
Name: d.pluginName,
VendorVersion: version.Version(),
}, nil
}

func (d *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
func (d *Driver) GetPluginCapabilities(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
// Only the Node server is implemented. No other capabilities are available.
return &csi.GetPluginCapabilitiesResponse{}, nil
}

func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error) {
func (d *Driver) Probe(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error) {
return &csi.ProbeResponse{}, nil
}

/////////////////////////////////////////////////////////////////////////////
// Node Server implementation
/////////////////////////////////////////////////////////////////////////////

func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (_ *csi.NodePublishVolumeResponse, err error) {
func (d *Driver) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (_ *csi.NodePublishVolumeResponse, err error) {
ephemeralMode := req.GetVolumeContext()["csi.storage.k8s.io/ephemeral"]

log := d.log.WithValues(
Expand Down Expand Up @@ -139,7 +139,7 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
return &csi.NodePublishVolumeResponse{}, nil
}

func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (_ *csi.NodeUnpublishVolumeResponse, err error) {
func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (_ *csi.NodeUnpublishVolumeResponse, err error) {
log := d.log.WithValues(
logkeys.VolumeID, req.VolumeId,
logkeys.TargetPath, req.TargetPath,
Expand Down Expand Up @@ -178,7 +178,7 @@ func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublish
return &csi.NodeUnpublishVolumeResponse{}, nil
}

func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
func (d *Driver) NodeGetCapabilities(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
return &csi.NodeGetCapabilitiesResponse{
Capabilities: []*csi.NodeServiceCapability{
{
Expand All @@ -199,14 +199,14 @@ func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabi
}, nil
}

func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
func (d *Driver) NodeGetInfo(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
return &csi.NodeGetInfoResponse{
NodeId: d.nodeID,
MaxVolumesPerNode: 0,
}, nil
}

func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
log := d.log.WithValues(
logkeys.VolumeID, req.VolumeId,
logkeys.VolumePath, req.VolumePath,
Expand Down
4 changes: 2 additions & 2 deletions pkg/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func init() {
unmount = func(dst string) error {
return os.Remove(metaPath(dst))
}
isMountPoint = func(dst string) (bool, error) {
isMountPoint = func(string) (bool, error) {
if testDescription == unmountFailureTest {
return true, nil
}
Expand Down Expand Up @@ -512,7 +512,7 @@ func metaPath(targetPath string) string {
func dumpIt(t *testing.T, when, dir string) {
t.Logf(">>>>>>>>>> DUMPING %s %s", when, dir)
assert.NoError(t, filepath.Walk(dir, filepath.WalkFunc(
func(path string, info fs.FileInfo, err error) error {
func(path string, info fs.FileInfo, _ error) error {
t.Logf("%s: %o", path, info.Mode())
return nil
})))
Expand Down
10 changes: 3 additions & 7 deletions pkg/mount/mount_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ import (
"errors"
)

func bindMountRO(src, dst string) error {
func bindMountRW(string, string) error {
return errors.New("unsupported on this platform")
}

func bindMountRW(src, dst string) error {
func unmount(string) error {
return errors.New("unsupported on this platform")
}

func unmount(path string) error {
return errors.New("unsupported on this platform")
}

func isMountPoint(mountPoint string) (bool, error) {
func isMountPoint(string) (bool, error) {
return false, errors.New("unsupported on this platform")
}
2 changes: 1 addition & 1 deletion test/workload/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine
FROM golang:1.22-alpine

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion test/workload/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module workload

go 1.21
go 1.22

require github.com/spiffe/go-spiffe/v2 v2.1.7

Expand Down

0 comments on commit f4db454

Please sign in to comment.