Skip to content

Commit

Permalink
chore: move to go 1.18 and other library updates and minor fixes (#167)
Browse files Browse the repository at this point in the history
* chore: move to go 1.18
- upgarde secrets-store-csi-driver to v1.1.1
- update to k8s version v0.23.5
- move flag.Parse() before the logger
- changes to the klog Json Logger

Signed-off-by: ajayk <[email protected]>

* chore: update the tools used for builds

* fix: replace grpc.WithInsecure grpc.WithTransportCredential

* fmt fix
  • Loading branch information
ajayk authored Apr 16, 2022
1 parent d203a13 commit d28865b
Show file tree
Hide file tree
Showing 12 changed files with 1,066 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.17"
go-version: "1.18"
- name: Get dependencies
run: go get -t ./...
- name: Lint
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17 as build-env
FROM golang:1.18 as build-env

ARG VERSION=dev

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ licensessave:
.PHONY: licensessave

gosec:
@command -v gosec > /dev/null 2>&1 || (cd tools && go install github.com/securego/gosec/cmd/gosec && cd ..)
@command -v gosec > /dev/null 2>&1 || (cd tools && go install github.com/securego/gosec/v2/cmd/gosec && cd ..)
@gosec ./...
.PHONY: gosec

Expand Down
15 changes: 11 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ import (
"k8s.io/klog/v2"
)

const (
attributePodName = "csi.storage.k8s.io/pod.name"
attributePodNamespace = "csi.storage.k8s.io/pod.namespace"
attributePodUID = "csi.storage.k8s.io/pod.uid"
attributeServiceAccountName = "csi.storage.k8s.io/serviceAccount.name"
)

// Secret holds the parameters of the SecretProviderClass CRD. Links the GCP
// secret resource name to a path in the filesystem.
type Secret struct {
Expand Down Expand Up @@ -103,10 +110,10 @@ func Parse(in *MountParams) (*MountConfig, error) {
}

out.PodInfo = &PodInfo{
Namespace: attrib["csi.storage.k8s.io/pod.namespace"],
Name: attrib["csi.storage.k8s.io/pod.name"],
UID: types.UID(attrib["csi.storage.k8s.io/pod.uid"]),
ServiceAccount: attrib["csi.storage.k8s.io/serviceAccount.name"],
Namespace: attrib[attributePodNamespace],
Name: attrib[attributePodName],
UID: types.UID(attrib[attributePodUID]),
ServiceAccount: attrib[attributeServiceAccountName],
}

podInfo := klog.ObjectRef{Namespace: out.PodInfo.Namespace, Name: out.PodInfo.Name}
Expand Down
61 changes: 33 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,50 @@

module github.com/GoogleCloudPlatform/secrets-store-csi-driver-provider-gcp

go 1.17
go 1.18

require (
cloud.google.com/go v0.94.1
cloud.google.com/go/secretmanager v0.1.0
github.com/google/go-cmp v0.5.6
github.com/googleapis/gax-go/v2 v2.1.0
cloud.google.com/go/compute v1.5.0
cloud.google.com/go/iam v0.3.0
cloud.google.com/go/secretmanager v1.4.0
github.com/google/go-cmp v0.5.7
github.com/googleapis/gax-go/v2 v2.2.0
go.opentelemetry.io/contrib/instrumentation/runtime v0.20.0
go.opentelemetry.io/otel/exporters/metric/prometheus v0.20.0
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
google.golang.org/api v0.56.0
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af
google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a
google.golang.org/api v0.74.0
google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.22.0
k8s.io/apimachinery v0.22.0
k8s.io/client-go v0.22.0
k8s.io/component-base v0.22.0
k8s.io/klog/v2 v2.9.0
sigs.k8s.io/secrets-store-csi-driver v0.3.0
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
k8s.io/client-go v0.23.5
k8s.io/component-base v0.23.5
k8s.io/klog/v2 v2.30.0
sigs.k8s.io/secrets-store-csi-driver v1.1.1
)

require (
cloud.google.com/go v0.100.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/common v0.28.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opencensus.io v0.23.0 // indirect
Expand All @@ -67,17 +70,19 @@ require (
go.opentelemetry.io/otel/trace v0.20.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/net v0.0.0-20220325170049-de3da57026de // indirect
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit d28865b

Please sign in to comment.