Skip to content

Commit d7417cb

Browse files
migrate to golang-ci v2 (#183)
* migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2 * migrate golangci-lint to v2
1 parent 1e42ac1 commit d7417cb

File tree

19 files changed

+349
-375
lines changed

19 files changed

+349
-375
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: go
22
go:
3-
- 1.24.2
3+
- 1.24.5
44

55
group: bluezone
66
dist: focal

OPENSOURCE

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1 @@
1-
github.com/BurntSushi/toml,v1.4.0,direct
2-
github.com/IBM/go-sdk-core/v5,v5.20.1,direct
3-
github.com/IBM/ibm-cos-sdk-go,v1.12.2,direct
4-
github.com/IBM/ibm-cos-sdk-go-config/v2,v2.3.0,direct
5-
github.com/gofrs/uuid,v4.4.0+incompatible,direct
6-
github.com/golang/protobuf,v1.5.4,direct
7-
github.com/jessevdk/go-flags,v1.6.1,direct
8-
github.com/stretchr/testify,v1.10.0,direct
9-
go.uber.org/zap,v1.27.0,direct
10-
google.golang.org/grpc,v1.69.4,direct
11-
google.golang.org/protobuf,v1.36.3,direct
12-
gopkg.in/natefinch/lumberjack.v2,v2.2.1,direct
13-
k8s.io/api,v0.32.1,direct
14-
k8s.io/apimachinery,v0.32.1,direct
15-
k8s.io/client-go,v0.32.1,direct
16-
sigs.k8s.io/sig-storage-lib-external-provisioner/v6,v6.3.0,direct
17-
github.com/asaskevich/govalidator,v0.0.0-20230301143203-a9d515a09cc2,indirect
18-
github.com/beorn7/perks,v1.0.1,indirect
19-
github.com/cespare/xxhash/v2,v2.3.0,indirect
20-
github.com/davecgh/go-spew,v1.1.2-0.20180830191138-d8f796af33cc,indirect
21-
github.com/emicklei/go-restful/v3,v3.12.1,indirect
22-
github.com/fxamacker/cbor/v2,v2.7.0,indirect
23-
github.com/gabriel-vasile/mimetype,v1.4.8,indirect
24-
github.com/go-logr/logr,v1.4.2,indirect
25-
github.com/go-openapi/errors,v0.22.0,indirect
26-
github.com/go-openapi/jsonpointer,v0.21.0,indirect
27-
github.com/go-openapi/jsonreference,v0.21.0,indirect
28-
github.com/go-openapi/strfmt,v0.23.0,indirect
29-
github.com/go-openapi/swag,v0.23.0,indirect
30-
github.com/go-playground/locales,v0.14.1,indirect
31-
github.com/go-playground/universal-translator,v0.18.1,indirect
32-
github.com/go-playground/validator/v10,v10.26.0,indirect
33-
github.com/gogo/protobuf,v1.3.2,indirect
34-
github.com/google/gnostic-models,v0.6.9,indirect
35-
github.com/google/go-cmp,v0.7.0,indirect
36-
github.com/google/gofuzz,v1.2.0,indirect
37-
github.com/google/uuid,v1.6.0,indirect
38-
github.com/hashicorp/go-cleanhttp,v0.5.2,indirect
39-
github.com/hashicorp/go-retryablehttp,v0.7.7,indirect
40-
github.com/jmespath/go-jmespath,v0.4.0,indirect
41-
github.com/josharian/intern,v1.0.0,indirect
42-
github.com/json-iterator/go,v1.1.12,indirect
43-
github.com/klauspost/compress,v1.17.11,indirect
44-
github.com/leodido/go-urn,v1.4.0,indirect
45-
github.com/mailru/easyjson,v0.9.0,indirect
46-
github.com/miekg/dns,v1.1.62,indirect
47-
github.com/mitchellh/mapstructure,v1.5.0,indirect
48-
github.com/modern-go/concurrent,v0.0.0-20180306012644-bacd9c7ef1dd,indirect
49-
github.com/modern-go/reflect2,v1.0.2,indirect
50-
github.com/munnerz/goautoneg,v0.0.0-20191010083416-a7dc8b61c822,indirect
51-
github.com/oklog/ulid,v1.3.1,indirect
52-
github.com/pkg/errors,v0.9.1,indirect
53-
github.com/pmezard/go-difflib,v1.0.1-0.20181226105442-5d4384ee4fb2,indirect
54-
github.com/prometheus/client_golang,v1.20.5,indirect
55-
github.com/prometheus/client_model,v0.6.1,indirect
56-
github.com/prometheus/common,v0.62.0,indirect
57-
github.com/prometheus/procfs,v0.15.1,indirect
58-
github.com/spf13/pflag,v1.0.5,indirect
59-
github.com/x448/float16,v0.8.4,indirect
60-
go.mongodb.org/mongo-driver,v1.17.2,indirect
61-
go.uber.org/multierr,v1.11.0,indirect
62-
golang.org/x/crypto,v0.38.0,indirect
63-
golang.org/x/mod,v0.22.0,indirect
64-
golang.org/x/net,v0.38.0,indirect
65-
golang.org/x/oauth2,v0.25.0,indirect
66-
golang.org/x/sync,v0.14.0,indirect
67-
golang.org/x/sys,v0.33.0,indirect
68-
golang.org/x/term,v0.32.0,indirect
69-
golang.org/x/text,v0.25.0,indirect
70-
golang.org/x/time,v0.9.0,indirect
71-
golang.org/x/tools,v0.29.0,indirect
72-
google.golang.org/genproto/googleapis/rpc,v0.0.0-20250115164207-1a7da9e5054f,indirect
73-
gopkg.in/evanphx/json-patch.v4,v4.12.0,indirect
74-
gopkg.in/inf.v0,v0.9.1,indirect
75-
gopkg.in/yaml.v3,v3.0.1,indirect
76-
k8s.io/klog/v2,v2.130.1,indirect
77-
k8s.io/kube-openapi,v0.0.0-20241212222426-2c72e554b1e7,indirect
78-
k8s.io/utils,v0.0.0-20241210054802-24370beab758,indirect
79-
sigs.k8s.io/json,v0.0.0-20241014173422-cfa47c3a1cc8,indirect
80-
sigs.k8s.io/structured-merge-diff/v4,v4.5.0,indirect
81-
sigs.k8s.io/yaml,v1.4.0,indirect
1+

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Before installing IBM Cloud Object Storage plug-in in a Kubernetes cluster, ensu
88
2. [S3FS-FUSE](https://github.com/s3fs-fuse/s3fs-fuse#installation) should be installed on every worker node in the cluster.
99

1010
## Build the `provisioner` image and `driver` binary
11-
For building the **provisioner** image and the **driver** binary, `docker`, `GO` and `glide` should be installed on your local system.<br>
12-
1. On your local machine, install [`docker`](https://docs.docker.com/install/), [`Go`](https://golang.org/doc/install), and [`glide`](https://glide.sh/).
11+
For building the **provisioner** image and the **driver** binary, `docker`and `GO` should be installed on your local system.<br>
12+
1. On your local machine, install [`docker`](https://docs.docker.com/install/), [`Go`](https://golang.org/doc/install).
1313
2. Set the [`GOPATH` environment variable](https://github.com/golang/go/wiki/SettingGOPATH).
1414
3. Build the provisioner container image and the driver binary<br>
1515
clone the repo or your forked repo
@@ -22,7 +22,7 @@ For building the **provisioner** image and the **driver** binary, `docker`, `GO`
2222
```
2323
build project and runs testcases
2424
```
25-
$ make
25+
$ make all
2626
```
2727
build container image for the provisioner
2828
```
@@ -48,7 +48,7 @@ Push the provisioner container image from the build system to your image reposit
4848
$ sudo systemctl restart kubelet
4949
```
5050
3. Create the provisioner.<br>
51-
Before executing following command update `image` details as per your repository in `deploy/provisioner.yaml`. Currently, it is `image: ibmcloud-object-storage-plugin:latest`, which expects image to be in public docker hub
51+
Before executing following command update `image` details as per your repository in `deploy/provisioner.yaml`.
5252
```
5353
$ kubectl create -f deploy/provisioner-sa.yaml
5454
$ kubectl create -f deploy/provisioner.yaml
@@ -88,7 +88,7 @@ data:
8888
access-key: <access key encoded in base64 (when not using IAM OAuth)>
8989
secret-key: <secret key encoded in base64 (when not using IAM OAuth)>
9090
api-key: <api key encoded in base64 (for IAM OAuth)>
91-
service-instance-id: <service-instance-id encoded in base64 (for IAM OAuth + bucket creation)>
91+
service-instance-id: <resource_instance_id encoded in base64 (for IAM OAuth + bucket creation)>
9292
EOF
9393
```
9494
**Note**: Replace **<NAMESPACE_NAME>** with your namespace (for example: default).<br>

cmd/driver/main.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* IBM Confidential
33
* OCO Source Materials
44
* IBM Cloud Kubernetes Service, 5737-D43
5-
* (C) Copyright IBM Corp. 2017, 2023 All Rights Reserved.
5+
* (C) Copyright IBM Corp. 2017, 2025 All Rights Reserved.
66
* The source code for this program is not published or otherwise divested of
77
* its trade secrets, irrespective of what has been deposited with
88
* the U.S. Copyright Office.
@@ -21,7 +21,7 @@ import (
2121
"go.uber.org/zap"
2222
"go.uber.org/zap/zapcore"
2323
"gopkg.in/natefinch/lumberjack.v2"
24-
"io/ioutil"
24+
"io"
2525
"log"
2626
"os"
2727
"strings"
@@ -60,7 +60,9 @@ func NewS3fsPlugin(logger *zap.Logger) *driver.S3fsPlugin {
6060
type versionCommand struct{}
6161

6262
func (v *versionCommand) Execute(args []string) error {
63-
fmt.Fprintf(stdout, "Version:%s, Build:%s\n", Version, Build)
63+
if _, err := fmt.Fprintf(stdout, "Version:%s, Build:%s\n", Version, Build); err != nil {
64+
return err
65+
}
6466
return nil
6567
}
6668

@@ -108,7 +110,7 @@ func (m *mountCommand) Execute(args []string) error {
108110
filelogger.Info(":MountCommand start:" + hostname)
109111

110112
mountOpts := make(map[string]string)
111-
mountOptsLogs := make(map[string]string) // nolint:ineffassign
113+
//mountOptsLogs := make(map[string]string) // nolint:ineffassign
112114

113115
switch len(args) {
114116
case 2:
@@ -208,7 +210,7 @@ func main() {
208210
// disable the console logging (if anywhere else being done by softlayer or any other pkg)
209211
// presently softlayer logs few warning message, which makes the flexdriver unmarshall failure
210212
log.SetFlags(0)
211-
log.SetOutput(ioutil.Discard)
213+
log.SetOutput(io.Discard)
212214

213215
// Divert all loggers outputs and fmt.printf loggings (this will create issues with flex response)
214216
NullDevice, _ := os.Open(os.DevNull)
@@ -294,7 +296,9 @@ func printResponse(f interfaces.FlexVolumeResponse) error {
294296
filelogger.Info(":FlexVolumeResponse", zap.String("output", output))
295297

296298
// write it to stdout, so that flexdriver will read it
297-
fmt.Fprintf(stdout, "%s", output)
299+
if _, err := fmt.Fprintf(stdout, "%s", output); err != nil {
300+
return err
301+
}
298302
return nil
299303
}
300304

0 commit comments

Comments
 (0)