Skip to content

Commit

Permalink
Merge pull request #76 from rhrmo/rebase-2.12.0
Browse files Browse the repository at this point in the history
STOR-2018: Rebase node-driver-registrat to v2.12.0 for OCP 4.18
  • Loading branch information
openshift-merge-bot[bot] authored Oct 8, 2024
2 parents 033fa9e + c286050 commit c21f5d0
Show file tree
Hide file tree
Showing 990 changed files with 143,795 additions and 17,843 deletions.
92 changes: 92 additions & 0 deletions CHANGELOG/CHANGELOG-2.11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Release notes for v2.11.0

[Documentation](https://kubernetes-csi.github.io)

# Changelog since v2.10.0

## Changes by Kind

### Feature

- Added support for contextual logging. ([#410](https://github.com/kubernetes-csi/node-driver-registrar/pull/410), [@bells17](https://github.com/bells17))
- Added support for structured logging (the log messages have been changed due to the activation of structured logging) ([#349](https://github.com/kubernetes-csi/node-driver-registrar/pull/349), [@rlia](https://github.com/rlia))
- Updated Kubernetes deps to v1.30 ([#406](https://github.com/kubernetes-csi/node-driver-registrar/pull/406), [@jsafrane](https://github.com/jsafrane))

### Uncategorized

- Update google.golang.org/protobuf to v1.33.0 to resolve CVE-2024-24786 ([#387](https://github.com/kubernetes-csi/node-driver-registrar/pull/387), [@dobsonj](https://github.com/dobsonj))

## Dependencies

### Added
- github.com/cpuguy83/go-md2man/v2: [v2.0.2](https://github.com/cpuguy83/go-md2man/v2/tree/v2.0.2)
- github.com/fxamacker/cbor/v2: [v2.6.0](https://github.com/fxamacker/cbor/v2/tree/v2.6.0)
- github.com/go-task/slim-sprig/v3: [v3.0.0](https://github.com/go-task/slim-sprig/v3/tree/v3.0.0)
- github.com/russross/blackfriday/v2: [v2.1.0](https://github.com/russross/blackfriday/v2/tree/v2.1.0)
- github.com/x448/float16: [v0.8.4](https://github.com/x448/float16/tree/v0.8.4)
- go.uber.org/goleak: v1.3.0
- k8s.io/gengo/v2: 51d4e06

### Changed
- cloud.google.com/go/compute: v1.23.0 → v1.24.0
- github.com/alecthomas/kingpin/v2: [v2.3.2 → v2.4.0](https://github.com/alecthomas/kingpin/v2/compare/v2.3.2...v2.4.0)
- github.com/cespare/xxhash/v2: [v2.2.0 → v2.3.0](https://github.com/cespare/xxhash/v2/compare/v2.2.0...v2.3.0)
- github.com/cncf/xds/go: [e9ce688 → 0fa0005](https://github.com/cncf/xds/go/compare/e9ce688...0fa0005)
- github.com/emicklei/go-restful/v3: [v3.11.0 → v3.12.0](https://github.com/emicklei/go-restful/v3/compare/v3.11.0...v3.12.0)
- github.com/envoyproxy/go-control-plane: [v0.11.1 → v0.12.0](https://github.com/envoyproxy/go-control-plane/compare/v0.11.1...v0.12.0)
- github.com/envoyproxy/protoc-gen-validate: [v1.0.2 → v1.0.4](https://github.com/envoyproxy/protoc-gen-validate/compare/v1.0.2...v1.0.4)
- github.com/go-logr/logr: [v1.3.0 → v1.4.1](https://github.com/go-logr/logr/compare/v1.3.0...v1.4.1)
- github.com/go-logr/zapr: [v1.2.3 → v1.3.0](https://github.com/go-logr/zapr/compare/v1.2.3...v1.3.0)
- github.com/go-openapi/jsonpointer: [v0.19.6 → v0.21.0](https://github.com/go-openapi/jsonpointer/compare/v0.19.6...v0.21.0)
- github.com/go-openapi/jsonreference: [v0.20.2 → v0.21.0](https://github.com/go-openapi/jsonreference/compare/v0.20.2...v0.21.0)
- github.com/go-openapi/swag: [v0.22.3 → v0.23.0](https://github.com/go-openapi/swag/compare/v0.22.3...v0.23.0)
- github.com/golang/glog: [v1.1.2 → v1.2.0](https://github.com/golang/glog/compare/v1.1.2...v1.2.0)
- github.com/golang/protobuf: [v1.5.3 → v1.5.4](https://github.com/golang/protobuf/compare/v1.5.3...v1.5.4)
- github.com/google/pprof: [4bb14d4 → a892ee0](https://github.com/google/pprof/compare/4bb14d4...a892ee0)
- github.com/google/uuid: [v1.3.1 → v1.6.0](https://github.com/google/uuid/compare/v1.3.1...v1.6.0)
- github.com/kubernetes-csi/csi-lib-utils: [v0.17.0 → v0.18.0](https://github.com/kubernetes-csi/csi-lib-utils/compare/v0.17.0...v0.18.0)
- github.com/onsi/ginkgo/v2: [v2.13.0 → v2.17.2](https://github.com/onsi/ginkgo/v2/compare/v2.13.0...v2.17.2)
- github.com/onsi/gomega: [v1.29.0 → v1.33.1](https://github.com/onsi/gomega/compare/v1.29.0...v1.33.1)
- github.com/prometheus/client_golang: [v1.16.0 → v1.19.1](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.19.1)
- github.com/prometheus/client_model: [v0.4.0 → v0.6.1](https://github.com/prometheus/client_model/compare/v0.4.0...v0.6.1)
- github.com/prometheus/common: [v0.44.0 → v0.53.0](https://github.com/prometheus/common/compare/v0.44.0...v0.53.0)
- github.com/prometheus/procfs: [v0.10.1 → v0.14.0](https://github.com/prometheus/procfs/compare/v0.10.1...v0.14.0)
- github.com/rogpeppe/go-internal: [v1.10.0 → v1.11.0](https://github.com/rogpeppe/go-internal/compare/v1.10.0...v1.11.0)
- github.com/stretchr/objx: [v0.5.0 → v0.1.0](https://github.com/stretchr/objx/compare/v0.5.0...v0.1.0)
- github.com/stretchr/testify: [v1.8.4 → v1.9.0](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0)
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc: v0.46.0 → v0.51.0
- go.opentelemetry.io/otel/metric: v1.20.0 → v1.26.0
- go.opentelemetry.io/otel/trace: v1.20.0 → v1.26.0
- go.opentelemetry.io/otel: v1.20.0 → v1.26.0
- go.uber.org/zap: v1.19.0 → v1.26.0
- golang.org/x/crypto: v0.15.0 → v0.23.0
- golang.org/x/mod: v0.8.0 → v0.17.0
- golang.org/x/net: v0.18.0 → v0.25.0
- golang.org/x/oauth2: v0.13.0 → v0.18.0
- golang.org/x/sync: v0.4.0 → v0.7.0
- golang.org/x/sys: v0.15.0 → v0.20.0
- golang.org/x/term: v0.14.0 → v0.20.0
- golang.org/x/text: v0.14.0 → v0.15.0
- golang.org/x/tools: v0.12.0 → v0.20.0
- golang.org/x/xerrors: 04be3eb → 5ec99f8
- google.golang.org/genproto/googleapis/api: d307bd8 → 6ceb2ff
- google.golang.org/genproto/googleapis/rpc: bbf56f3 → 6275950
- google.golang.org/genproto: d783a09 → 6ceb2ff
- google.golang.org/grpc: v1.60.1 → v1.63.2
- google.golang.org/protobuf: v1.31.0 → v1.34.1
- k8s.io/api: v0.29.0 → v0.30.0
- k8s.io/apimachinery: v0.29.0 → v0.30.0
- k8s.io/apiserver: v0.29.0 → v0.30.0
- k8s.io/client-go: v0.29.0 → v0.30.0
- k8s.io/component-base: v0.29.0 → v0.30.0
- k8s.io/cri-api: v0.29.0 → v0.30.0
- k8s.io/klog/v2: v2.110.1 → v2.120.1
- k8s.io/kube-openapi: 2dd684a → f0e62f9
- k8s.io/kubelet: v0.29.0 → v0.30.0

### Removed
- github.com/cncf/udpa/go: [c52dc94](https://github.com/cncf/udpa/go/tree/c52dc94)
- github.com/creack/pty: [v1.1.9](https://github.com/creack/pty/tree/v1.1.9)
- github.com/kr/pty: [v1.1.1](https://github.com/kr/pty/tree/v1.1.1)
- go.uber.org/atomic: v1.10.0
- k8s.io/gengo: 9cce18d
93 changes: 93 additions & 0 deletions CHANGELOG/CHANGELOG-2.12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Release notes for v2.12.0

[Documentation](https://kubernetes-csi.github.io)

# Changelog since v2.11.0

## Changes by Kind

### Bug or Regression

- Fixed node-driver-registrar exiting after 1 second. ([#426](https://github.com/kubernetes-csi/node-driver-registrar/pull/426), [@jsafrane](https://github.com/jsafrane))

### Other (Cleanup or Flake)

- Updates Kubernetes dependencies to 1.31.0-rc.0 ([#435](https://github.com/kubernetes-csi/node-driver-registrar/pull/435), [@dfajmon](https://github.com/dfajmon))
- Updates Kubernetes dependencies to v1.31.0 ([#440](https://github.com/kubernetes-csi/node-driver-registrar/pull/440), [@dfajmon](https://github.com/dfajmon))

### Uncategorized

- Updated go to 1.22.5 to resolve CVE-2024-24790 ([#434](https://github.com/kubernetes-csi/node-driver-registrar/pull/434), [@sdx-jkataja](https://github.com/sdx-jkataja))

## Dependencies

### Added
- cel.dev/expr: v0.15.0
- github.com/klauspost/compress: [v1.17.9](https://github.com/klauspost/compress/tree/v1.17.9)
- github.com/kylelemons/godebug: [v1.1.0](https://github.com/kylelemons/godebug/tree/v1.1.0)
- gopkg.in/evanphx/json-patch.v4: v4.12.0

### Changed
- cloud.google.com/go/compute/metadata: v0.2.3 → v0.3.0
- github.com/cenkalti/backoff/v4: [v4.2.1 → v4.3.0](https://github.com/cenkalti/backoff/compare/v4.2.1...v4.3.0)
- github.com/cncf/xds/go: [0fa0005 → 555b57e](https://github.com/cncf/xds/compare/0fa0005...555b57e)
- github.com/container-storage-interface/spec: [v1.9.0 → v1.10.0](https://github.com/container-storage-interface/spec/compare/v1.9.0...v1.10.0)
- github.com/cpuguy83/go-md2man/v2: [v2.0.2 → v2.0.4](https://github.com/cpuguy83/go-md2man/compare/v2.0.2...v2.0.4)
- github.com/davecgh/go-spew: [v1.1.1 → d8f796a](https://github.com/davecgh/go-spew/compare/v1.1.1...d8f796a)
- github.com/emicklei/go-restful/v3: [v3.12.0 → v3.12.1](https://github.com/emicklei/go-restful/compare/v3.12.0...v3.12.1)
- github.com/felixge/httpsnoop: [v1.0.3 → v1.0.4](https://github.com/felixge/httpsnoop/compare/v1.0.3...v1.0.4)
- github.com/fxamacker/cbor/v2: [v2.6.0 → v2.7.0](https://github.com/fxamacker/cbor/compare/v2.6.0...v2.7.0)
- github.com/go-logr/logr: [v1.4.1 → v1.4.2](https://github.com/go-logr/logr/compare/v1.4.1...v1.4.2)
- github.com/golang/glog: [v1.2.0 → v1.2.1](https://github.com/golang/glog/compare/v1.2.0...v1.2.1)
- github.com/google/pprof: [a892ee0 → 4bfdf5a](https://github.com/google/pprof/compare/a892ee0...4bfdf5a)
- github.com/grpc-ecosystem/grpc-gateway/v2: [v2.16.0 → v2.20.0](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.16.0...v2.20.0)
- github.com/kubernetes-csi/csi-lib-utils: [v0.18.0 → v0.19.0](https://github.com/kubernetes-csi/csi-lib-utils/compare/v0.18.0...v0.19.0)
- github.com/moby/spdystream: [v0.2.0 → v0.4.0](https://github.com/moby/spdystream/compare/v0.2.0...v0.4.0)
- github.com/moby/term: [1aeaba8 → v0.5.0](https://github.com/moby/term/compare/1aeaba8...v0.5.0)
- github.com/onsi/ginkgo/v2: [v2.17.2 → v2.19.0](https://github.com/onsi/ginkgo/compare/v2.17.2...v2.19.0)
- github.com/pmezard/go-difflib: [v1.0.0 → 5d4384e](https://github.com/pmezard/go-difflib/compare/v1.0.0...5d4384e)
- github.com/prometheus/client_golang: [v1.19.1 → v1.20.0](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.20.0)
- github.com/prometheus/common: [v0.53.0 → v0.55.0](https://github.com/prometheus/common/compare/v0.53.0...v0.55.0)
- github.com/prometheus/procfs: [v0.14.0 → v0.15.1](https://github.com/prometheus/procfs/compare/v0.14.0...v0.15.1)
- github.com/rogpeppe/go-internal: [v1.11.0 → v1.12.0](https://github.com/rogpeppe/go-internal/compare/v1.11.0...v1.12.0)
- github.com/spf13/cobra: [v1.7.0 → v1.8.1](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.1)
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc: v0.51.0 → v0.53.0
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.44.0 → v0.53.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.19.0 → v1.27.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.19.0 → v1.28.0
- go.opentelemetry.io/otel/metric: v1.26.0 → v1.28.0
- go.opentelemetry.io/otel/sdk: v1.19.0 → v1.28.0
- go.opentelemetry.io/otel/trace: v1.26.0 → v1.28.0
- go.opentelemetry.io/otel: v1.26.0 → v1.28.0
- go.opentelemetry.io/proto/otlp: v1.0.0 → v1.3.1
- go.uber.org/zap: v1.26.0 → v1.27.0
- golang.org/x/crypto: v0.23.0 → v0.26.0
- golang.org/x/net: v0.25.0 → v0.28.0
- golang.org/x/oauth2: v0.18.0 → v0.21.0
- golang.org/x/sync: v0.7.0 → v0.8.0
- golang.org/x/sys: v0.20.0 → v0.24.0
- golang.org/x/term: v0.20.0 → v0.23.0
- golang.org/x/text: v0.15.0 → v0.17.0
- golang.org/x/tools: v0.20.0 → e35e4cc
- google.golang.org/genproto/googleapis/api: 6ceb2ff → 5315273
- google.golang.org/genproto/googleapis/rpc: 6275950 → f6361c8
- google.golang.org/grpc: v1.63.2 → v1.65.0
- google.golang.org/protobuf: v1.34.1 → v1.34.2
- k8s.io/api: v0.30.0 → v0.31.0
- k8s.io/apimachinery: v0.30.0 → v0.31.0
- k8s.io/apiserver: v0.30.0 → v0.31.0
- k8s.io/client-go: v0.30.0 → v0.31.0
- k8s.io/component-base: v0.30.0 → v0.31.0
- k8s.io/cri-api: v0.30.0 → v0.31.0
- k8s.io/klog/v2: v2.120.1 → v2.130.1
- k8s.io/kubelet: v0.30.0 → v0.31.0
- k8s.io/utils: 3b25d92 → 18e509b
- sigs.k8s.io/yaml: v1.3.0 → v1.4.0

### Removed
- cloud.google.com/go/compute: v1.24.0
- github.com/evanphx/json-patch: [v4.12.0+incompatible](https://github.com/evanphx/json-patch/tree/v4.12.0)
- github.com/go-task/slim-sprig: [52ccab3](https://github.com/go-task/slim-sprig/tree/52ccab3)
- github.com/matttproud/golang_protobuf_extensions: [v1.0.4](https://github.com/matttproud/golang_protobuf_extensions/tree/v1.0.4)
- google.golang.org/appengine: v1.6.8
- google.golang.org/genproto: 6ceb2ff
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ CMDS=csi-node-driver-registrar
all: build

include release-tools/build.make

test: test-logcheck
64 changes: 40 additions & 24 deletions cmd/csi-node-driver-registrar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"context"
"errors"
"flag"
"fmt"
_ "net/http/pprof"
Expand All @@ -29,6 +30,10 @@ import (

"github.com/kubernetes-csi/csi-lib-utils/connection"
csirpc "github.com/kubernetes-csi/csi-lib-utils/rpc"
"k8s.io/component-base/featuregate"
"k8s.io/component-base/logs"
logsapi "k8s.io/component-base/logs/api/v1"
_ "k8s.io/component-base/logs/json/register"
registerapi "k8s.io/kubelet/pkg/apis/pluginregistration/v1"
)

Expand Down Expand Up @@ -87,7 +92,8 @@ func newRegistrationServer(driverName string, endpoint string, versions []string

// GetInfo is the RPC invoked by plugin watcher
func (e registrationServer) GetInfo(ctx context.Context, req *registerapi.InfoRequest) (*registerapi.PluginInfo, error) {
klog.Infof("Received GetInfo call: %+v", req)
logger := klog.FromContext(ctx)
logger.Info("Received GetInfo call", "request", req)

return &registerapi.PluginInfo{
Type: registerapi.CSIPlugin,
Expand All @@ -98,9 +104,10 @@ func (e registrationServer) GetInfo(ctx context.Context, req *registerapi.InfoRe
}

func (e registrationServer) NotifyRegistrationStatus(ctx context.Context, status *registerapi.RegistrationStatus) (*registerapi.RegistrationStatusResponse, error) {
klog.Infof("Received NotifyRegistrationStatus call: %+v", status)
logger := klog.FromContext(ctx)
logger.Info("Received NotifyRegistrationStatus call", "status", status)
if !status.PluginRegistered {
klog.Errorf("Registration process failed with error: %+v, restarting registration container.", status.Error)
logger.Error(errors.New(status.Error), "Registration process failed with error, restarting registration container")
os.Exit(1)
}

Expand All @@ -112,18 +119,26 @@ func modeIsKubeletRegistrationProbe() bool {
}

func main() {
klog.InitFlags(nil)
flag.Set("logtostderr", "true")
fg := featuregate.NewFeatureGate()
logsapi.AddFeatureGates(fg)
c := logsapi.NewLoggingConfiguration()
logsapi.AddGoFlags(c, flag.CommandLine)
logs.InitLogs()
flag.Parse()
logger := klog.Background()
if err := logsapi.ValidateAndApply(c, fg); err != nil {
logger.Error(err, "LoggingConfiguration is invalid")
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
}

if *showVersion {
fmt.Println(os.Args[0], version)
return
}

if *kubeletRegistrationPath == "" {
klog.Error("kubelet-registration-path is a required parameter")
os.Exit(1)
logger.Error(nil, "kubelet-registration-path is a required parameter")
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
}

if modeIsKubeletRegistrationProbe() {
Expand All @@ -132,12 +147,12 @@ func main() {
os.Exit(0)
}

klog.Infof("Version: %s", version)
klog.Infof("Running node-driver-registrar in mode=%s", *mode)
logger.Info("Version", "version", version)
logger.Info("Running node-driver-registrar", "mode", *mode)

if *healthzPort > 0 && *httpEndpoint != "" {
klog.Error("only one of `--health-port` and `--http-endpoint` can be set.")
os.Exit(1)
logger.Error(nil, "Only one of `--health-port` and `--http-endpoint` can be set")
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
}
var addr string
if *healthzPort > 0 {
Expand All @@ -147,32 +162,33 @@ func main() {
}

if *connectionTimeout != 0 {
klog.Warning("--connection-timeout is deprecated and will have no effect")
logger.Info("--connection-timeout is deprecated and will have no effect")
}

// Once https://github.com/container-storage-interface/spec/issues/159 is
// resolved, if plugin does not support PUBLISH_UNPUBLISH_VOLUME, then we
// can skip adding mapping to "csi.volume.kubernetes.io/nodeid" annotation.

klog.V(1).Infof("Attempting to open a gRPC connection with: %q", *csiAddress)
csiConn, err := connection.ConnectWithoutMetrics(*csiAddress)
logger.V(1).Info("Attempting to open a gRPC connection", "csiAddress", *csiAddress)
ctx := klog.NewContext(context.Background(), logger)
csiConn, err := connection.ConnectWithoutMetrics(ctx, *csiAddress)
if err != nil {
klog.Errorf("error connecting to CSI driver: %v", err)
os.Exit(1)
logger.Error(err, "Error connecting to CSI driver")
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
}

klog.V(1).Infof("Calling CSI driver to discover driver name")
ctx, cancel := context.WithTimeout(context.Background(), *operationTimeout)
logger.V(1).Info("Calling CSI driver to discover driver name")
getNameCtx, cancel := context.WithTimeout(ctx, *operationTimeout)
defer cancel()

csiDriverName, err := csirpc.GetDriverName(ctx, csiConn)
csiDriverName, err := csirpc.GetDriverName(getNameCtx, csiConn)
if err != nil {
klog.Errorf("error retreiving CSI driver name: %v", err)
os.Exit(1)
logger.Error(err, "Error retreiving CSI driver name")
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
}
klog.V(2).Infof("CSI driver name: %q", csiDriverName)
defer closeGrpcConnection(*csiAddress, csiConn)
logger.V(2).Info("CSI driver name", "csiDriverName", csiDriverName)
defer closeGrpcConnection(logger, *csiAddress, csiConn)

// Run forever
nodeRegister(csiDriverName, addr)
nodeRegister(ctx, csiDriverName, addr)
}
Loading

0 comments on commit c21f5d0

Please sign in to comment.