From 0e65cb0e7c11d45414fa2e0da2053c47d22febb4 Mon Sep 17 00:00:00 2001 From: Evgeny Uglov Date: Tue, 27 Jan 2026 12:07:12 -0500 Subject: [PATCH] Mirror internal repository with cleaned references --- .gitignore | 2 + Dockerfile | 16 +- Gopkg.toml | 26 -- Makefile | 159 ++++----- README.md | 18 +- common/constants/consts.go | 4 +- common/utils/fromcontext/from-context.go | 12 +- common/utils/identifiers/fqdn.go | 4 +- common/utils/identifiers/node.go | 4 +- common/utils/identifiers/snapshot.go | 6 +- common/utils/identifiers/uuid.go | 4 +- common/utils/identifiers/volume.go | 6 +- common/utils/logging/logging.go | 197 ----------- common/utils/logging/logging_test.go | 211 ------------ common/utils/powerscale-fs/powerscale-fs.go | 6 +- .../utils/powerscale-fs/powerscale-fs_test.go | 4 +- core/semver/semver.go | 2 +- csi-utils/csiutils.go | 11 +- csi-utils/csiutils_test.go | 2 +- docker.mk | 31 -- go.mod | 132 ++++---- go.sum | 313 ++++++++++-------- helper.mk | 17 + images.mk | 21 ++ main.go | 22 +- main_test.go | 7 +- mkdocs.yml | 7 + overrides.mk | 72 +--- provider/provider.go | 12 +- provider/provider_test.go | 2 +- .../secret/karavi-authorization-config.json | 1 - service/controller.go | 289 ++++++++-------- service/controllerNodeToArrayConnectivity.go | 6 +- service/controller_test.go | 14 +- service/csi_extension_server.go | 10 +- service/features/service.feature | 4 +- service/identity.go | 13 +- service/interceptor/interceptor.go | 11 +- service/interceptor/interceptor_test.go | 6 +- service/isiService.go | 141 +++----- service/isiService_test.go | 12 +- service/mount.go | 30 +- service/mount_test.go | 2 +- service/node.go | 117 +++---- service/nodeConnectivityChecker.go | 10 +- service/nodeConnectivityChecker_test.go | 2 +- service/node_test.go | 12 +- service/replication.go | 106 +++--- service/replication_test.go | 41 +-- service/service.go | 262 ++++----------- service/service_test.go | 66 ++-- service/step_defs_test.go | 253 +++++++------- service/step_handlers_test.go | 15 +- test/integration/integration_test.go | 8 +- test/integration/step_defs_test.go | 25 +- 55 files changed, 1101 insertions(+), 1685 deletions(-) delete mode 100644 Gopkg.toml delete mode 100644 common/utils/logging/logging.go delete mode 100644 common/utils/logging/logging_test.go delete mode 100644 docker.mk create mode 100644 helper.mk create mode 100644 images.mk create mode 100644 mkdocs.yml delete mode 100644 samples/secret/karavi-authorization-config.json diff --git a/.gitignore b/.gitignore index 1cc104d5..47f45d41 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ gocsi .idea csm-common.mk go-code-tester + +vendor/ diff --git a/Dockerfile b/Dockerfile index 2f0a6935..30786097 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright © 2021-2025 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2021-2026 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,21 +11,23 @@ # limitations under the License # some arguments that must be supplied -ARG GOPROXY ARG GOIMAGE ARG BASEIMAGE +ARG VERSION="2.16.0" # Stage to build the driver FROM $GOIMAGE as builder -ARG GOPROXY +ARG VERSION + RUN mkdir -p /go/src COPY ./ /go/src/ + WORKDIR /go/src/ -RUN CGO_ENABLED=0 \ - make build +RUN make build IMAGE_VERSION=$VERSION # Stage to build the driver image FROM $BASEIMAGE AS final +ARG VERSION # copy in the driver COPY --from=builder /go/src/csi-isilon / @@ -36,8 +38,8 @@ LABEL vendor="Dell Technologies" \ name="csi-isilon" \ summary="CSI Driver for Dell EMC PowerScale" \ description="CSI Driver for provisioning persistent storage from Dell EMC PowerScale" \ - release="1.15.0" \ - version="2.15.0" \ + release="1.16.0" \ + version=$VERSION \ license="Apache-2.0" COPY ./licenses /licenses diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 0ea4eeae..00000000 --- a/Gopkg.toml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2019-2021 Dell Inc. or its subsidiaries. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License - - -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# Refer to https://github.com/toml-lang/toml for detailed TOML docs. - -[prune] - non-go = true - go-tests = true - unused-packages = true - -[[constraint]] - name = "github.com/dell/gocsi" - version = "1.2.3" diff --git a/Makefile b/Makefile index b9af2e47..3cbc12e2 100644 --- a/Makefile +++ b/Makefile @@ -1,96 +1,63 @@ -# default target -all: help - -# include an overrides file, which sets up default values and allows user overrides -include overrides.mk - -# Help target, prints usefule information -help: - @echo - @echo "The following targets are commonly used:" - @echo - @echo "build - Builds the code locally" - @echo "clean - Cleans the local build" - @echo "docker - Builds the code within a golang container and then creates the driver image" - @echo "integration-test - Runs the integration tests. Requires access to an array" - @echo "push - Pushes the built container to a target registry" - @echo "unit-test - Runs the unit tests" - @echo - @make -s overrides-help - -# Clean the build -clean: - rm -f core/core_generated.go go-code-tester - rm -f semver.mk - go clean - -# Dependencies -dependencies: - go generate - go run core/semver/semver.go -f mk >semver.mk - -format: - @gofmt -w -s . - -# Build the driver locally -build: dependencies - GOOS=linux CGO_ENABLED=0 go build - -# Generates the docker container (but does not push) -podman-build: - make -f docker.mk podman-build - -# Generates the docker container without using cache(but does not push) -podman-build-no-cache: - make -f docker.mk podman-build-no-cache - -docker: build - make -f docker.mk docker - -# Pushes container to the repository -podman-build-image-push: podman-build - make -f docker.mk podman-build-image-push - -dev-build-image-push: dev-build - make -f docker.mk docker-build-image-push - -# Windows or Linux; requires no hardware -unit-test: go-code-tester - GITHUB_OUTPUT=/dev/null \ - ./go-code-tester 90 "." "" "true" "" "" "./service/mock|./common/constants|./test/integration|./core|./provider" - -coverage: - cd service; go tool cover -html=c.out -o coverage.html - -# Linux only; populate env.sh with the hardware parameters -integration-test: - ( cd test/integration; sh run.sh ) - -version: - go generate - go run core/semver/semver.go -f mk >semver.mk - make -f docker.mk version - -gosec: - gosec -quiet -log gosec.log -out=gosecresults.csv -fmt=csv ./... - -.PHONY: actions action-help -actions: ## Run all GitHub Action checks that run on a pull request creation - @echo "Running all GitHub Action checks for pull request events..." - @act -l | grep -v ^Stage | grep pull_request | grep -v image_security_scan | awk '{print $$2}' | while read WF; do \ - echo "Running workflow: $${WF}"; \ - act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job "$${WF}"; \ - done - -go-code-tester: - curl -o go-code-tester -L https://raw.githubusercontent.com/dell/common-github-actions/main/go-code-tester/entrypoint.sh \ - && chmod +x go-code-tester - -action-help: ## Echo instructions to run one specific workflow locally - @echo "GitHub Workflows can be run locally with the following command:" - @echo "act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job " - @echo "" - @echo "Where '' is a Job ID returned by the command:" - @echo "act -l" - @echo "" - @echo "NOTE: if act is not installed, it can be downloaded from https://github.com/nektos/act" +# Copyright © 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Dell Technologies, Dell and other trademarks are trademarks of Dell Inc. +# or its subsidiaries. Other trademarks may be trademarks of their respective +# owners. + +include images.mk + +# This will be overridden during image build. +IMAGE_VERSION ?= 0.0.0 +LDFLAGS = "-X main.ManifestSemver=$(IMAGE_VERSION)" + +# default target +all: help + +# Help target, prints usefule information +help: + @echo + @echo "The following targets are commonly used:" + @echo + @echo "build - Builds the code locally" + @echo "clean - Cleans the local build" + @echo "integration-test - Runs the integration tests. Requires access to an array" + @echo "unit-test - Runs the unit tests" + @echo "vendor - Downloads a vendor list (local copy) of repositories required to compile the repo." + @echo + @make -s overrides-help + +# Clean the build +clean: + rm -f core/core_generated.go go-code-tester + rm -f semver.mk + rm -rf csm-common.mk + rm -rf vendor + go clean + +format: + @gofmt -w -s . + +# Build the driver locally +build: generate vendor + CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -mod=vendor -ldflags $(LDFLAGS) -o csi-isilon + +# Windows or Linux; requires no hardware +unit-test: go-code-tester + GITHUB_OUTPUT=/dev/null \ + ./go-code-tester 90 "." "" "true" "" "" "./service/mock|./common/constants|./test/integration|./core|./provider" + +coverage: + cd service; go tool cover -html=c.out -o coverage.html + +# Linux only; populate env.sh with the hardware parameters +integration-test: + ( cd test/integration; sh run.sh ) + +gosec: + gosec -quiet -log gosec.log -out=gosecresults.csv -fmt=csv ./... + +go-code-tester: + git clone --depth 1 git@github.com:CSM/actions.git temp-repo + cp temp-repo/go-code-tester/entrypoint.sh ./go-code-tester + chmod +x go-code-tester + rm -rf temp-repo diff --git a/README.md b/README.md index 5b3f0bf4..a8f0e669 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ +# :lock: **Important Notice** +Starting with the release of **Container Storage Modules v1.16.0**, this repository will no longer be maintained as an open source project. Future development will continue under a closed source model. This change reflects our commitment to delivering even greater value to our customers by enabling faster innovation and more deeply integrated features with the Dell storage portfolio.
+For existing customers using Dell’s Container Storage Modules, you will continue to receive: +* **Ongoing Support & Community Engagement**
+ You will continue to receive high-quality support through Dell Support and our community channels. Your experience of engaging with the Dell community remains unchanged. +* **Streamlined Deployment & Updates**
+ Deployment and update processes will remain consistent, ensuring a smooth and familiar experience. +* **Access to Documentation & Resources**
+ All documentation and related materials will remain publicly accessible, providing transparency and technical guidance. +* **Continued Access to Current Open Source Version**
+ The current open-source version will remain available under its existing license for those who rely on it. + +Moving to a closed source model allows Dell’s development team to accelerate feature delivery and enhance integration across our Enterprise Kubernetes Storage solutions ultimately providing a more seamless and robust experience.
+We deeply appreciate the contributions of the open source community and remain committed to supporting our customers through this transition.
+ +For questions or access requests, please contact the maintainers via [Dell Support](https://www.dell.com/support/kbdoc/en-in/000188046/container-storage-interface-csi-drivers-and-container-storage-modules-csm-how-to-get-support). + # CSI Driver for Dell EMC PowerScale [![Go Report Card](https://goreportcard.com/badge/github.com/dell/csi-isilon?style=flat-square)](https://goreportcard.com/report/github.com/dell/csi-isilon) @@ -49,4 +66,3 @@ Both the Controller and the Node portions of the driver can only be run on nodes ## Documentation For more detailed information on the driver, please refer to [Container Storage Modules documentation](https://dell.github.io/csm-docs/). - diff --git a/common/constants/consts.go b/common/constants/consts.go index a4d71a42..e9b1eb09 100644 --- a/common/constants/consts.go +++ b/common/constants/consts.go @@ -3,7 +3,7 @@ package constants import ( "time" - "github.com/sirupsen/logrus" + csmlog "github.com/dell/csmlog" ) /* @@ -64,7 +64,7 @@ const ( IsilonConfigFile = "/isilon-configs/config" // DefaultLogLevel for csi logs - DefaultLogLevel = logrus.DebugLevel + DefaultLogLevel = csmlog.DebugLevel // ParamCSILogLevel csi driver log level ParamCSILogLevel = "CSI_LOG_LEVEL" diff --git a/common/utils/fromcontext/from-context.go b/common/utils/fromcontext/from-context.go index 2981f7f6..ed089f06 100644 --- a/common/utils/fromcontext/from-context.go +++ b/common/utils/fromcontext/from-context.go @@ -20,18 +20,20 @@ import ( "fmt" "strconv" - "github.com/dell/csi-isilon/v2/common/utils/logging" + csmlog "github.com/dell/csmlog" csictx "github.com/dell/gocsi/context" "gopkg.in/yaml.v3" ) +var log = csmlog.GetLogger() + // GetBoolean parses an environment variable into a boolean value. If an error is encountered, default is set to false, and error is logged func GetBoolean(ctx context.Context, key string) bool { - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) if val, ok := csictx.LookupEnv(ctx, key); ok { b, err := strconv.ParseBool(val) if err != nil { - log.WithField(key, val).Debugf( + log.WithFields(csmlog.Fields{key: val}).Debugf( "invalid boolean value for '%s', defaulting to false", key) return false } @@ -55,11 +57,11 @@ func GetArray(ctx context.Context, key string) ([]string, error) { // GetUint parses an environment variable into a uint value. If an error is encountered, default is set to 0, and error is logged func GetUint(ctx context.Context, key string) uint { - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) if val, ok := csictx.LookupEnv(ctx, key); ok { i, err := strconv.ParseUint(val, 10, 0) if err != nil { - log.WithField(key, val).Debugf( + log.WithFields(csmlog.Fields{key: val}).Debugf( "invalid int value for '%s', defaulting to 0", key) return 0 } diff --git a/common/utils/identifiers/fqdn.go b/common/utils/identifiers/fqdn.go index 71948c0e..b4240dee 100644 --- a/common/utils/identifiers/fqdn.go +++ b/common/utils/identifiers/fqdn.go @@ -21,13 +21,13 @@ import ( "net" "strings" + csmlog "github.com/dell/csmlog" "github.com/Showmax/go-fqdn" - "github.com/dell/csi-isilon/v2/common/utils/logging" ) // GetFQDNByIP returns the FQDN based on the parsed ip address func GetFQDNByIP(ctx context.Context, ip string) (string, error) { - log := logging.GetRunIDLogger(ctx) + log := csmlog.GetLogger().WithContext(ctx) names, err := net.LookupAddr(ip) if err != nil { log.Debugf("error getting FQDN: '%s'", err) diff --git a/common/utils/identifiers/node.go b/common/utils/identifiers/node.go index 49eff7c6..2f57220b 100644 --- a/common/utils/identifiers/node.go +++ b/common/utils/identifiers/node.go @@ -20,7 +20,7 @@ import ( "fmt" "regexp" - "github.com/dell/csi-isilon/v2/common/utils/logging" + csmlog "github.com/dell/csmlog" ) const ( @@ -36,7 +36,7 @@ var NodeIDPattern = regexp.MustCompile(fmt.Sprintf("^(.+)%s(.+)%s(.+)$", NodeIDS // ParseNodeID parses NodeID to node name, node FQDN and IP address using pattern '^(.+)=#=#=(.+)=#=#=(.+)' func ParseNodeID(ctx context.Context, nodeID string) (string, string, string, error) { - log := logging.GetRunIDLogger(ctx) + log := csmlog.GetLogger().WithContext(ctx) matches := NodeIDPattern.FindStringSubmatch(nodeID) diff --git a/common/utils/identifiers/snapshot.go b/common/utils/identifiers/snapshot.go index 096c7445..60006aab 100644 --- a/common/utils/identifiers/snapshot.go +++ b/common/utils/identifiers/snapshot.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/dell/csi-isilon/v2/common/utils/logging" + csmlog "github.com/dell/csmlog" ) // SnapshotIDSeparator is the separator that separates snapshot id and cluster name (two components that a normalized snapshot ID is comprised of) @@ -29,7 +29,7 @@ const SnapshotIDSeparator = "=_=_=" // GetNormalizedSnapshotID combines snapshotID ID and cluster name and access zone to form the normalized snapshot ID // e.g. 12345 + cluster1 + accessZone => 12345=_=_=cluster1=_=_=zone1 func GetNormalizedSnapshotID(ctx context.Context, snapshotID, clusterName, accessZone string) string { - log := logging.GetRunIDLogger(ctx) + log := csmlog.GetLogger().WithContext(ctx) snapID := fmt.Sprintf("%s%s%s%s%s", snapshotID, SnapshotIDSeparator, clusterName, SnapshotIDSeparator, accessZone) @@ -43,7 +43,7 @@ func GetNormalizedSnapshotID(ctx context.Context, snapshotID, clusterName, acces // e.g. 12345 => 12345, "" // e.g. 12345=_=_=cluster1=_=_=zone => 12345, cluster1, zone func ParseNormalizedSnapshotID(ctx context.Context, snapID string) (string, string, string, error) { - log := logging.GetRunIDLogger(ctx) + log := csmlog.GetLogger().WithContext(ctx) tokens := strings.Split(snapID, SnapshotIDSeparator) if len(tokens) < 1 { return "", "", "", fmt.Errorf("snapshot ID '%s' cannot be split into tokens", snapID) diff --git a/common/utils/identifiers/uuid.go b/common/utils/identifiers/uuid.go index b6017fec..be05d26a 100644 --- a/common/utils/identifiers/uuid.go +++ b/common/utils/identifiers/uuid.go @@ -16,13 +16,13 @@ limitations under the License. package identifiers import ( - "github.com/dell/csi-isilon/v2/common/utils/logging" + csmlog "github.com/dell/csmlog" "github.com/google/uuid" ) // GetNewUUID generates a UUID func GetNewUUID() (string, error) { - log := logging.GetLogger() + log := csmlog.GetLogger() id, err := uuid.NewUUID() if err != nil { log.Errorf("error generating UUID : '%s'", err) diff --git a/common/utils/identifiers/volume.go b/common/utils/identifiers/volume.go index 91ebc995..fef95d33 100644 --- a/common/utils/identifiers/volume.go +++ b/common/utils/identifiers/volume.go @@ -21,7 +21,7 @@ import ( "strconv" "strings" - "github.com/dell/csi-isilon/v2/common/utils/logging" + "github.com/dell/csmlog" ) // VolumeIDSeparator is the separator that separates volume name and export ID (two components that a normalized volume ID is comprised of) @@ -30,7 +30,7 @@ const VolumeIDSeparator = "=_=_=" // GetNormalizedVolumeID combines volume name (i.e. the directory name), export ID, access zone and clusterName to form the normalized volume ID // e.g. k8s-e89c9d089e + 19 + csi0zone + cluster1 => k8s-e89c9d089e=_=_=19=_=_=csi0zone=_=_=cluster1 func GetNormalizedVolumeID(ctx context.Context, volName string, exportID int, accessZone, clusterName string) string { - log := logging.GetRunIDLogger(ctx) + log := csmlog.GetLogger().WithContext(ctx) volID := fmt.Sprintf("%s%s%s%s%s%s%s", volName, VolumeIDSeparator, strconv.Itoa(exportID), VolumeIDSeparator, accessZone, VolumeIDSeparator, clusterName) @@ -44,7 +44,7 @@ func GetNormalizedVolumeID(ctx context.Context, volName string, exportID int, ac // e.g. k8s-e89c9d089e=_=_=19=_=_=csi0zone => k8s-e89c9d089e, 19, csi0zone, "" // e.g. k8s-e89c9d089e=_=_=19=_=_=csi0zone=_=_=cluster1 => k8s-e89c9d089e, 19, csi0zone, cluster1 func ParseNormalizedVolumeID(ctx context.Context, volID string) (string, int, string, string, error) { - log := logging.GetRunIDLogger(ctx) + log := csmlog.GetLogger().WithContext(ctx) tokens := strings.Split(volID, VolumeIDSeparator) if len(tokens) < 3 { return "", 0, "", "", fmt.Errorf("volume ID '%s' cannot be split into tokens", volID) diff --git a/common/utils/logging/logging.go b/common/utils/logging/logging.go deleted file mode 100644 index 3efb877e..00000000 --- a/common/utils/logging/logging.go +++ /dev/null @@ -1,197 +0,0 @@ -/* - Copyright (c) 2021-2025 Dell Inc, or its subsidiaries. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package logging - -import ( - "context" - "fmt" - "reflect" - "runtime" - "strconv" - "strings" - "sync" - "time" - - "github.com/dell/csi-isilon/v2/common/constants" - "github.com/sirupsen/logrus" -) - -var ( - singletonLog *logrus.Logger - once sync.Once -) - -// LogConst represents string in context.WithValue -type LogConst string - -// Constants used for logging -const ( - // Default log format will output [INFO]: 2006-01-02T15:04:05Z07:00 - Log message - defaultLogFormat = "time=\"%time%\" level=%lvl% %clusterName% %runid% msg=\"%msg%\"" - defaultTimestampFormat = time.RFC3339 - ClusterName = "clusterName" - PowerScaleLogger LogConst = "powerscalelog" - LogFields LogConst = "fields" - RequestID = "requestid" - RunID = "runid" -) - -// Formatter implements logrus.Formatter interface. -type Formatter struct { - // logrus.TextFormatter - // Timestamp format - TimestampFormat string - // Available standard keys: time, msg, lvl - // Also can include custom fields but limited to strings. - // All of fields need to be wrapped inside %% i.e %time% %msg% - LogFormat string - - CallerPrettyfier func(*runtime.Frame) (function string, file string) -} - -// Format building log message. -func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error) { - output := f.LogFormat - if output == "" { - output = defaultLogFormat - } - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = defaultTimestampFormat - } - - output = strings.Replace(output, "%time%", entry.Time.Format(timestampFormat), 1) - output = strings.Replace(output, "%msg%", entry.Message, 1) - level := strings.ToUpper(entry.Level.String()) - output = strings.Replace(output, "%lvl%", strings.ToLower(level), 1) - - fields := entry.Data - - runID, ok := fields[RunID] - if ok { - output = strings.Replace(output, "%runid%", fmt.Sprintf("runid=%v", runID), 1) - } else { - output = strings.Replace(output, "%runid%", "", 1) - } - - clusterName, ok := fields[ClusterName] - if ok { - output = strings.Replace(output, "%clusterName%", fmt.Sprintf("clusterName=%v", clusterName), 1) - } else { - output = strings.Replace(output, "%clusterName%", "", 1) - } - - for k, val := range entry.Data { - switch v := val.(type) { - case string: - output = strings.Replace(output, "%"+k+"%", v, 1) - case int: - s := strconv.Itoa(v) - output = strings.Replace(output, "%"+k+"%", s, 1) - case bool: - s := strconv.FormatBool(v) - output = strings.Replace(output, "%"+k+"%", s, 1) - } - } - - var fileVal string - if entry.HasCaller() { - if f.CallerPrettyfier != nil { - _, fileVal = f.CallerPrettyfier(entry.Caller) - } else { - fileVal = fmt.Sprintf("%s:%d", entry.Caller.File, entry.Caller.Line) - } - - if fileVal != "" { - output = fmt.Sprintf("%s file=\"%s\"", output, fileVal) - } - } - - output = fmt.Sprintf("%s\n", output) - - return []byte(output), nil -} - -// GetLogger function to get custom logging -func GetLogger() *logrus.Logger { - once.Do(func() { - singletonLog = logrus.New() - fmt.Println("csi-powerscale logger initiated. This should be called only once.") - singletonLog.Level = constants.DefaultLogLevel - singletonLog.SetReportCaller(true) - singletonLog.Formatter = &Formatter{ - CallerPrettyfier: func(f *runtime.Frame) (string, string) { - filename1 := strings.Split(f.File, "dell/csi-powerscale") - if len(filename1) > 1 { - return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("dell/csi-powerscale%s:%d", filename1[1], f.Line) - } - - filename2 := strings.Split(f.File, "dell/goisilon") - if len(filename2) > 1 { - return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("dell/goisilon%s:%d", filename2[1], f.Line) - } - - return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("%s:%d", f.File, f.Line) - }, - } - }) - - return singletonLog -} - -// GetRunIDLogger returns the current runID logger -func GetRunIDLogger(ctx context.Context) *logrus.Entry { - tempLog := ctx.Value(PowerScaleLogger) - if ctx.Value(PowerScaleLogger) != nil && reflect.TypeOf(tempLog) == reflect.TypeOf(&logrus.Entry{}) { - return ctx.Value(PowerScaleLogger).(*logrus.Entry) - } - - return GetLogger().WithFields(logrus.Fields{}) -} - -// ParseLogLevel returns the logrus.Level of input log level string -func ParseLogLevel(lvl string) (logrus.Level, error) { - return logrus.ParseLevel(lvl) -} - -// UpdateLogLevel updates the log level -func UpdateLogLevel(lvl logrus.Level, mu *sync.Mutex) { - mu.Lock() - defer mu.Unlock() - singletonLog.Level = lvl -} - -// GetCurrentLogLevel updates the log level -func GetCurrentLogLevel() logrus.Level { - return singletonLog.Level -} - -// LogMap logs the key-value entries of a given map -func LogMap(ctx context.Context, mapName string, m map[string]string) { - log := GetRunIDLogger(ctx) - log.Debugf("map '%s':", mapName) - for key, value := range m { - log.Debugf(" [%s]='%s'", key, value) - } -} - -// GetMessageWithRunID returns message with runID information -func GetMessageWithRunID(runid string, format string, args ...interface{}) string { - str := fmt.Sprintf(format, args...) - return fmt.Sprintf(" runid=%s %s", runid, str) -} diff --git a/common/utils/logging/logging_test.go b/common/utils/logging/logging_test.go deleted file mode 100644 index e962bebd..00000000 --- a/common/utils/logging/logging_test.go +++ /dev/null @@ -1,211 +0,0 @@ -/* - Copyright (c) 2021-2025 Dell Inc, or its subsidiaries. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package logging - -import ( - "context" - "reflect" - "runtime" - "sync" - "testing" - "time" - - "github.com/sirupsen/logrus" -) - -func TestGetMessageWithRunID(t *testing.T) { - tests := []struct { - name string - runid string - format string - args []interface{} - expected string - }{ - {"Basic message", "12345", "Process started", nil, " runid=12345 Process started"}, - {"Formatted message", "98765", "Error code: %d", []interface{}{404}, " runid=98765 Error code: 404"}, - {"Multiple arguments", "56789", "User %s logged in at %s", []interface{}{"Alice", "10:00 AM"}, " runid=56789 User Alice logged in at 10:00 AM"}, - {"Empty runID", "", "System rebooting", nil, " runid= System rebooting"}, - {"Empty format", "54321", "", nil, " runid=54321 "}, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := GetMessageWithRunID(tt.runid, tt.format, tt.args...) - if got != tt.expected { - t.Errorf("Expected %q, got %q", tt.expected, got) - } - }) - } -} - -func TestLogMap(_ *testing.T) { - ctx := context.Background() - m := map[string]string{"key1": "value1", "key2": "value2"} - LogMap(ctx, "testMap", m) // Ensure this runs without panic -} - -func TestParseLogLevel(t *testing.T) { - type args struct { - lvl string - } - tests := []struct { - name string - args args - want logrus.Level - wantErr bool - }{ - { - name: "success", - args: args{ - lvl: "info", - }, - want: logrus.InfoLevel, - wantErr: false, - }, - { - name: "fail", - args: args{ - lvl: "test", - }, - want: logrus.PanicLevel, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got, err := ParseLogLevel(tt.args.lvl) - if (err != nil) != tt.wantErr { - t.Errorf("ParseLogLevel() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("ParseLogLevel() = %v, want %v", got, tt.want) - } - }) - } -} - -func TestUpdateLogLevel(t *testing.T) { - singletonLog = logrus.New() - - type args struct { - lvl logrus.Level - mu *sync.Mutex - } - tests := []struct { - name string - args args - }{ - { - name: "update log level", - args: args{ - lvl: logrus.ErrorLevel, - mu: &sync.Mutex{}, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - UpdateLogLevel(tt.args.lvl, tt.args.mu) - if singletonLog.Level != tt.args.lvl { - t.Errorf("Expected log level %v, got %v", tt.args.lvl, singletonLog.Level) - } - }) - } -} - -func TestGetCurrentLogLevel(t *testing.T) { - singletonLog = logrus.New() - singletonLog.SetLevel(logrus.InfoLevel) - - tests := []struct { - name string - want logrus.Level - }{ - { - name: "return current log level", - want: logrus.InfoLevel, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := GetCurrentLogLevel(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetCurrentLogLevel() = %v, want %v", got, tt.want) - } - }) - } -} - -func TestFormatter_Format(t *testing.T) { - type fields struct { - TimestampFormat string - LogFormat string - CallerPrettyfier func(*runtime.Frame) (function string, file string) - } - type args struct { - entry *logrus.Entry - } - tests := []struct { - name string - fields fields - args args - want []byte - wantErr bool - }{ - { - name: "has keyed data", - fields: fields{ - TimestampFormat: "", - LogFormat: "%time%, %lvl%, %stringkey%, %intkey%, %boolkey%, %msg%, %runid%, %clusterName%", - CallerPrettyfier: nil, - }, - args: args{ - entry: &logrus.Entry{ - Time: time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC), - Level: logrus.InfoLevel, - Message: "some message", - Data: logrus.Fields{ - RunID: "", - ClusterName: "some-cluster", - "stringkey": "stringvalue", - "intkey": 1, - "boolkey": true, - }, - }, - }, - want: []byte("1970-01-01T00:00:00Z, info, stringvalue, 1, true, some message, runid=, clusterName=some-cluster\n"), - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - f := &Formatter{ - TimestampFormat: tt.fields.TimestampFormat, - LogFormat: tt.fields.LogFormat, - CallerPrettyfier: tt.fields.CallerPrettyfier, - } - got, err := f.Format(tt.args.entry) - if (err != nil) != tt.wantErr { - t.Errorf("Formatter.Format() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Formatter.Format() = \"%v\", want \"%v\"", string(got), string(tt.want)) - } - }) - } -} diff --git a/common/utils/powerscale-fs/powerscale-fs.go b/common/utils/powerscale-fs/powerscale-fs.go index 709ccc5a..ba40c7cd 100644 --- a/common/utils/powerscale-fs/powerscale-fs.go +++ b/common/utils/powerscale-fs/powerscale-fs.go @@ -23,8 +23,8 @@ import ( "strconv" "strings" - "github.com/dell/csi-isilon/v2/common/utils/logging" - isi "github.com/dell/goisilon" + csmlog "github.com/dell/csmlog" + isi "github.com/dell/gopowerscale" ) // CSIQuotaIDPrefix is the CSI tag for quota id stored in the export's description field set by csi driver @@ -49,7 +49,7 @@ func GetQuotaIDWithCSITag(quotaID string) string { // GetQuotaIDFromDescription extracts quota id from the description field of export func GetQuotaIDFromDescription(ctx context.Context, export isi.Export) (string, error) { - log := logging.GetRunIDLogger(ctx) + log := csmlog.GetLogger().WithContext(ctx) log.Debugf("try to extract quota id from the description field of export (id:'%d', path: '%s', description : '%s')", export.ID, export.Paths, export.Description) diff --git a/common/utils/powerscale-fs/powerscale-fs_test.go b/common/utils/powerscale-fs/powerscale-fs_test.go index 3d85fdd9..454f736e 100644 --- a/common/utils/powerscale-fs/powerscale-fs_test.go +++ b/common/utils/powerscale-fs/powerscale-fs_test.go @@ -24,8 +24,8 @@ import ( "path" "testing" - isi "github.com/dell/goisilon" - apiv2 "github.com/dell/goisilon/api/v2" + isi "github.com/dell/gopowerscale" + apiv2 "github.com/dell/gopowerscale/api/v2" "github.com/stretchr/testify/assert" ) diff --git a/core/semver/semver.go b/core/semver/semver.go index 4132248d..3ed8bfb6 100644 --- a/core/semver/semver.go +++ b/core/semver/semver.go @@ -357,7 +357,7 @@ var OSExit = func(code int) { // GetExitError is a wrapper around exec.ExitError var GetExitError = func(err error) (e *exec.ExitError, ok bool) { e, ok = err.(*exec.ExitError) - return + return e, ok } // GetStatusError is a wrapper around syscall.WaitStatus diff --git a/csi-utils/csiutils.go b/csi-utils/csiutils.go index fdf1a8f9..2fba0a63 100644 --- a/csi-utils/csiutils.go +++ b/csi-utils/csiutils.go @@ -21,9 +21,10 @@ import ( "net" "os" + "github.com/dell/csi-powerscale/v2/common/constants" + csmlog "github.com/dell/csmlog" + "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/csi-isilon/v2/common/constants" - "github.com/dell/csi-isilon/v2/common/utils/logging" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -36,9 +37,10 @@ var parseCIDR = func(s string) (net.IP, *net.IPNet, error) { return net.ParseCIDR(s) } +var log = csmlog.GetLogger() + // RemoveExistingCSISockFile When the sock file that the gRPC server is going to be listening on already exists, error will be thrown saying the address is already in use, thus remove it first var RemoveExistingCSISockFile = func() error { - log := logging.GetLogger() protoAddr := os.Getenv(constants.EnvCSIEndpoint) log.Debugf("check if sock file '%s' has already been created", protoAddr) @@ -53,7 +55,7 @@ var RemoveExistingCSISockFile = func() error { if err := os.RemoveAll(protoAddr); err != nil { - log.WithError(err).Debugf("error removing sock file '%s'", protoAddr) + log.Debugf("error removing sock file '%s'"+"failed with error : %s", protoAddr, err.Error()) return fmt.Errorf( "failed to remove sock file: '%s', error '%v'", protoAddr, err) @@ -71,7 +73,6 @@ var RemoveExistingCSISockFile = func() error { // GetNFSClientIP is used to fetch IP address from networks on which NFS traffic is allowed func GetNFSClientIP(allowedNetworks []string) (string, error) { var nodeIP string - log := logging.GetLogger() addrs, err := interfaceAddrs() if err != nil { log.Errorf("Encountered error while fetching system IP addresses: %+v\n", err.Error()) diff --git a/csi-utils/csiutils_test.go b/csi-utils/csiutils_test.go index bfecab3d..1b2a9bd3 100644 --- a/csi-utils/csiutils_test.go +++ b/csi-utils/csiutils_test.go @@ -22,8 +22,8 @@ import ( "os" "testing" + "github.com/dell/csi-powerscale/v2/common/constants" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/csi-isilon/v2/common/constants" "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/docker.mk b/docker.mk deleted file mode 100644 index f0c4354e..00000000 --- a/docker.mk +++ /dev/null @@ -1,31 +0,0 @@ -# docker makefile, included from Makefile, will build/push images with docker or podman - -docker: download-csm-common - $(eval include csm-common.mk) - @echo "Building docker image: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" - docker build --pull -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --build-arg GOPROXY=$(GOPROXY) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . - -docker-push: - @echo "Pushing: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" - docker push "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" - -podman-build: download-csm-common - $(eval include csm-common.mk) - @echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" - @echo "Using Golang Image $(DEFAULT_GOIMAGE)" - $(BUILDER) build --pull $(NOCACHE) -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --build-arg GOPROXY=$(GOPROXY) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . - -podman-build-no-cache: - @echo "Building with --no-cache ..." - @make podman-build NOCACHE=--no-cache - -podman-build-image-push: - @echo "Pushing: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" - $(BUILDER) push "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" - -version: - @echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) BUILD ${BUILD} TYPE ${TYPE} RELNOTE $(RELNOTE) SEMVER $(SEMVER)" - @echo "Target Version: $(VERSION)" - -download-csm-common: - curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk \ No newline at end of file diff --git a/go.mod b/go.mod index 195da6de..09944f62 100644 --- a/go.mod +++ b/go.mod @@ -1,111 +1,119 @@ -module github.com/dell/csi-isilon/v2 +module github.com/dell/csi-powerscale/v2 -go 1.25 +go 1.25.0 require ( + github.com/dell/csi-metadata-retriever v1.13.0 + github.com/dell/csmlog v1.0.0 + github.com/dell/dell-csi-extensions/common v1.10.0 + github.com/dell/dell-csi-extensions/podmon v1.10.0 + github.com/dell/dell-csi-extensions/replication v1.13.0 + github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.8.1 + github.com/dell/gocsi v1.16.0 + github.com/dell/gofsutil v1.21.0 + github.com/dell/gopowerscale v1.21.0 github.com/Showmax/go-fqdn v1.0.0 github.com/akutz/gosync v0.1.0 - github.com/akutz/gournal v0.5.0 github.com/container-storage-interface/spec v1.6.0 github.com/cucumber/godog v0.15.0 - github.com/dell/csi-metadata-retriever v1.12.0 - github.com/dell/dell-csi-extensions/common v1.9.0 - github.com/dell/dell-csi-extensions/podmon v1.9.0 - github.com/dell/dell-csi-extensions/replication v1.12.0 - github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.8.1 - github.com/dell/gocsi v1.15.0 - github.com/dell/gofsutil v1.20.0 - github.com/dell/goisilon v1.20.0 github.com/fsnotify/fsnotify v1.9.0 github.com/golang/mock v1.6.0 github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.1 github.com/kubernetes-csi/csi-lib-utils v0.11.0 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/viper v1.20.0 - github.com/stretchr/testify v1.11.0 - golang.org/x/net v0.46.0 - google.golang.org/grpc v1.75.0 - google.golang.org/protobuf v1.36.6 + github.com/spf13/viper v1.21.0 + github.com/stretchr/testify v1.11.1 + golang.org/x/net v0.49.0 + google.golang.org/grpc v1.78.0 + google.golang.org/protobuf v1.36.10 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.34.0 - k8s.io/apimachinery v0.34.0 - k8s.io/client-go v0.34.0 + k8s.io/api v0.34.2 + k8s.io/apimachinery v0.34.2 + k8s.io/client-go v0.34.2 ) require ( - github.com/PuerkitoBio/goquery v1.10.2 // indirect + github.com/PuerkitoBio/goquery v1.11.0 // indirect github.com/andybalholm/cascadia v1.3.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect - github.com/coreos/go-systemd/v22 v22.5.0 // indirect + github.com/coreos/go-systemd/v22 v22.6.0 // indirect github.com/cucumber/gherkin/go/v26 v26.2.0 // indirect github.com/cucumber/messages/go/v21 v21.0.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.12.2 // indirect + github.com/emicklei/go-restful/v3 v3.13.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/go-logr/logr v1.4.3 // indirect - github.com/go-openapi/jsonpointer v0.21.0 // indirect - github.com/go-openapi/jsonreference v0.21.0 // indirect - github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/jsonpointer v0.22.3 // indirect + github.com/go-openapi/jsonreference v0.21.3 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/gnostic-models v0.7.0 // indirect + github.com/google/gnostic-models v0.7.1 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-memdb v1.3.4 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.11 // indirect - github.com/mailru/easyjson v0.9.0 // indirect + github.com/klauspost/compress v1.18.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.62.0 // indirect - github.com/prometheus/procfs v0.15.1 // indirect - github.com/sagikazarmark/locafero v0.7.0 // indirect - github.com/sourcegraph/conc v0.3.0 // indirect - github.com/spf13/afero v1.12.0 // indirect - github.com/spf13/cast v1.7.1 // indirect - github.com/spf13/pflag v1.0.9 // indirect - github.com/stretchr/objx v0.5.2 // indirect + github.com/prometheus/client_golang v1.23.2 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.67.4 // indirect + github.com/prometheus/procfs v0.19.2 // indirect + github.com/sagikazarmark/locafero v0.12.0 // indirect + github.com/spf13/afero v1.15.0 // indirect + github.com/spf13/cast v1.10.0 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/stretchr/objx v0.5.3 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/x448/float16 v0.8.4 // indirect - go.etcd.io/etcd/api/v3 v3.6.1 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.6.1 // indirect - go.etcd.io/etcd/client/v3 v3.6.1 // indirect - go.opentelemetry.io/otel v1.37.0 // indirect - go.opentelemetry.io/otel/trace v1.37.0 // indirect + go.etcd.io/etcd/api/v3 v3.6.6 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.6.6 // indirect + go.etcd.io/etcd/client/v3 v3.6.6 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect + go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel/trace v1.38.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - go.yaml.in/yaml/v2 v2.4.2 // indirect + go.uber.org/zap v1.27.1 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/oauth2 v0.30.0 // indirect - golang.org/x/sys v0.37.0 // indirect - golang.org/x/term v0.36.0 // indirect - golang.org/x/text v0.30.0 // indirect - golang.org/x/time v0.9.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + golang.org/x/oauth2 v0.33.0 // indirect + golang.org/x/sys v0.40.0 // indirect + golang.org/x/term v0.39.0 // indirect + golang.org/x/text v0.33.0 // indirect + golang.org/x/time v0.14.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect + gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - k8s.io/component-base v0.32.1 // indirect + k8s.io/component-base v0.34.2 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect - k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect - sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect sigs.k8s.io/yaml v1.6.0 // indirect ) diff --git a/go.sum b/go.sum index 6b278b31..c44aa81d 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,24 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/dell/csi-metadata-retriever v1.13.0 h1:6eb/VaVoY3NVGXUppMJEDZirsH1y8Ki/SHkJCkmI+L8= +github.com/dell/csi-metadata-retriever v1.13.0/go.mod h1:ZiOG9J1MjTUslncrbfgZ2v8sxdOB6ZdRtVjRCAQ0tmc= +github.com/dell/csmlog v1.0.0 h1:EzW+nMJBD0QTNP88OoaAJUOMVilS9cWkO248BTcJt/4= +github.com/dell/csmlog v1.0.0/go.mod h1:7rBzSv9xF5t233+J+9vkStjFsmyYO3L/B9tDTy3+9ZU= +github.com/dell/dell-csi-extensions/common v1.10.0 h1:WIFPWVEBUyzOTCOPAlcgQsiRRGAufyKJYbIATbNZXIY= +github.com/dell/dell-csi-extensions/common v1.10.0/go.mod h1:zRHzmPX5SQQnqQ1LEIxG4hYqLBeQOSiD8TkEhU0eWTY= +github.com/dell/dell-csi-extensions/podmon v1.10.0 h1:YeM9OmgJHE+n6aNaeEC96EuVev5x3pddggcM7Ws7pkk= +github.com/dell/dell-csi-extensions/podmon v1.10.0/go.mod h1:+g7fdyw1Zx74NBJQgi1BCtsywqk37MJd9JN86IPJJu0= +github.com/dell/dell-csi-extensions/replication v1.13.0 h1:DSpoZ3vX65a3KDxUv0OinLkY2qUAQtRX3E1c1e3fnvA= +github.com/dell/dell-csi-extensions/replication v1.13.0/go.mod h1:aJBwd55amqbY3kk8SG7NjwH7nxBscceDwc1rKesUG1g= +github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.8.1 h1:W0UcLCZ8qyJ+NBRDfrZefN+fMs2i73ydkIsq6RjP7bM= +github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.8.1/go.mod h1:C4Ji1GCEayZ733hcHkvM6JDcboWJjk43H7xp30a/trc= +github.com/dell/gocsi v1.16.0 h1:avhQPD11rYzT6/dPxpZfFsJV+T/T0x1GJqqbco45W8c= +github.com/dell/gocsi v1.16.0/go.mod h1:Fz5dQv/kWf5Y1EXZEzxLBQSsnW2HE/WY95R0WCDQLO4= +github.com/dell/gofsutil v1.21.0 h1:SeusAYjiO/1ogvg/TapvCyHcrM9z+OvdaMU5i9Ijn3M= +github.com/dell/gofsutil v1.21.0/go.mod h1:qBGEz1wMOtqTODuJfiBZhUHT0JjexBblu2oa+sEclNs= +github.com/dell/gopowerscale v1.21.0 h1:eIhFLRtOHqGqVcL06kDHjrex3BPQl2Uvn9l1K13koxM= +github.com/dell/gopowerscale v1.21.0/go.mod h1:Gge2u+lyteIRXiwfhizIiwsMP8xq1MAQZgeKB6ZrmoY= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -35,16 +53,14 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8= -github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU= +github.com/PuerkitoBio/goquery v1.11.0 h1:jZ7pwMQXIITcUXNH83LLk+txlaEy6NVOfTuP43xxfqw= +github.com/PuerkitoBio/goquery v1.11.0/go.mod h1:wQHgxUOU3JGuj3oD/QFfxUdlzW6xPHfqyHre6VMY4DQ= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Showmax/go-fqdn v1.0.0 h1:0rG5IbmVliNT5O19Mfuvna9LL7zlHyRfsSvBPZmF9tM= github.com/Showmax/go-fqdn v1.0.0/go.mod h1:SfrFBzmDCtCGrnHhoDjuvFnKsWjEQX/Q9ARZvOrJAko= github.com/akutz/gosync v0.1.0 h1:naxPT/aDYDh79PMwM3XmencmNQeYmpNFSZy4ZE9zIW0= github.com/akutz/gosync v0.1.0/go.mod h1:I8I4aiqJI1nqaeYOOB1WS+CgRJVVPqhct9Y4njywM84= -github.com/akutz/gournal v0.5.0 h1:ELlKqTTp9dmaaadDvO19YxUmdMghYuSi23AxoSL/g98= -github.com/akutz/gournal v0.5.0/go.mod h1:w7Ucz8IOvtgsEL1321IY8bIUoASU/khBjAy/L6doMWc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -89,8 +105,8 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5zn0bCJWo= +github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -107,22 +123,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dell/csi-metadata-retriever v1.12.0 h1:54z7Sm2XCgTfiEI8lcGwg5P24brEnfylqGvMzQiWKWo= -github.com/dell/csi-metadata-retriever v1.12.0/go.mod h1:TsLkzdvdsp/EBT2ffeTw3Sq/v2bSWzIIvfUfhhYQBZg= -github.com/dell/dell-csi-extensions/common v1.9.0 h1:H1NXBYlJZ+XTCe4tSXo94Lvg8HD2wgt6ywql3kVrG34= -github.com/dell/dell-csi-extensions/common v1.9.0/go.mod h1:DA9lX2BX3fdshR40IaXfokDrIKo9a32QShcTlAqhf+c= -github.com/dell/dell-csi-extensions/podmon v1.9.0 h1:AYE3n6o6jB3Sh0uce65JPmir3FPxvqSW/21/bGqRhvY= -github.com/dell/dell-csi-extensions/podmon v1.9.0/go.mod h1:jz846RAruY/m25uBbZVYcr8vp7wmKakbjOuUBwpY0Ls= -github.com/dell/dell-csi-extensions/replication v1.12.0 h1:jOdaZsoGHWX9SsqgH+2v9cIJSAVLF1SnKKHtdiF5Ywc= -github.com/dell/dell-csi-extensions/replication v1.12.0/go.mod h1:nyPBfbMOpboVI/cYLOFJhv0LADGSvHwDcF4AxZau/go= -github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.8.1 h1:NnS/P2OpwMlQ70fwls/KVVfe8z8op4b7nXArv8CDsqk= -github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.8.1/go.mod h1:rlJGlmp1NI8gU52HYKY2cy13TbSWvt9p5VAG2RLbkQs= -github.com/dell/gocsi v1.15.0 h1:SXBtiNTb3iTHms4WRoewwdJaItOY8XaaxBjkTYy8o5Q= -github.com/dell/gocsi v1.15.0/go.mod h1:u8+NcCB2rWr79Dx63GWUo3TsAJj/RSlRoimTrp6BZiM= -github.com/dell/gofsutil v1.20.0 h1:jkQrOb4sSxEUcPTAbyLBABMBf+7vBC6g+yzxTGb0Ozw= -github.com/dell/gofsutil v1.20.0/go.mod h1:kKFZSYY0tF5lx/U6UhSAqLxKnNESd0hT4gJ4PlYXSB8= -github.com/dell/goisilon v1.20.0 h1:10gcC3TKAayUBS7lQRNmOhAeLhqKoM5YaYrBqwFPB3c= -github.com/dell/goisilon v1.20.0/go.mod h1:9He3aVVfVf7MOrAFICVEiToZBrFQsXy1amjFe8B4rw4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -130,8 +130,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU= -github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -168,20 +168,47 @@ github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= -github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonpointer v0.22.3 h1:dKMwfV4fmt6Ah90zloTbUKWMD+0he+12XYAsPotrkn8= +github.com/go-openapi/jsonpointer v0.22.3/go.mod h1:0lBbqeRsQ5lIanv3LHZBrmRGHLHcQoOXQnf88fHlGWo= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= -github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/jsonreference v0.21.3 h1:96Dn+MRPa0nYAR8DR1E03SblB5FJvh7W6krPI0Z7qMc= +github.com/go-openapi/jsonreference v0.21.3/go.mod h1:RqkUP0MrLf37HqxZxrIAtTWW4ZJIK1VzduhXYBEeGc4= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= -github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= @@ -190,8 +217,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -227,8 +254,8 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= -github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -274,8 +301,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -314,8 +341,6 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I= github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -330,8 +355,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk= +github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -351,8 +376,6 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= -github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -398,16 +421,15 @@ github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.38.0 h1:c/WX+w8SLAinvuKKQFh77WEucCnPk4j2OTUr7lt7BeY= -github.com/onsi/gomega v1.38.0/go.mod h1:OcXcwId0b9QsE7Y49u+BTrL4IdKOBOKnD6VQNTJEB6o= +github.com/onsi/gomega v1.39.0 h1:y2ROC3hKFmQZJNFeGAMeHZKkjBL65mIZcvrLQBF9k6Q= +github.com/onsi/gomega v1.39.0/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= @@ -418,39 +440,39 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= -github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= +github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc= +github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= +github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= -github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= +github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4= +github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -463,34 +485,32 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= -github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= +github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= -github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= -github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= +github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= +github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -500,8 +520,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8= -github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= @@ -519,34 +539,33 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.4.0 h1:TU77id3TnN/zKr7CO/uk+fBCwF2jGcMuw2B/FMAzYIk= -go.etcd.io/bbolt v1.4.0/go.mod h1:AsD+OCi/qPN1giOX1aiLAha3o1U8rAz65bvN4j0sRuk= -go.etcd.io/etcd/api/v3 v3.6.1 h1:yJ9WlDih9HT457QPuHt/TH/XtsdN2tubyxyQHSHPsEo= -go.etcd.io/etcd/api/v3 v3.6.1/go.mod h1:lnfuqoGsXMlZdTJlact3IB56o3bWp1DIlXPIGKRArto= -go.etcd.io/etcd/client/pkg/v3 v3.6.1 h1:CxDVv8ggphmamrXM4Of8aCC8QHzDM4tGcVr9p2BSoGk= -go.etcd.io/etcd/client/pkg/v3 v3.6.1/go.mod h1:aTkCp+6ixcVTZmrJGa7/Mc5nMNs59PEgBbq+HCmWyMc= -go.etcd.io/etcd/client/v3 v3.6.1 h1:KelkcizJGsskUXlsxjVrSmINvMMga0VWwFF0tSPGEP0= -go.etcd.io/etcd/client/v3 v3.6.1/go.mod h1:fCbPUdjWNLfx1A6ATo9syUmFVxqHH9bCnPLBZmnLmMY= -go.etcd.io/etcd/pkg/v3 v3.6.1 h1:Qpshk3/SLra217k7FxcFGaH2niFAxFf1Dug57f0IUiw= -go.etcd.io/etcd/pkg/v3 v3.6.1/go.mod h1:nS0ahQoZZ9qXjQAtYGDt80IEHKl9YOF7mv6J0lQmBoQ= -go.etcd.io/etcd/server/v3 v3.6.1 h1:Y/mh94EeImzXyTBIMVgR0v5H+ANtRFDY4g1s5sxOZGE= -go.etcd.io/etcd/server/v3 v3.6.1/go.mod h1:nCqJGTP9c2WlZluJB59j3bqxZEI/GYBfQxno0MguVjE= +go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= +go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= +go.etcd.io/etcd/api/v3 v3.6.6 h1:mcaMp3+7JawWv69p6QShYWS8cIWUOl32bFLb6qf8pOQ= +go.etcd.io/etcd/api/v3 v3.6.6/go.mod h1:f/om26iXl2wSkcTA1zGQv8reJRSLVdoEBsi4JdfMrx4= +go.etcd.io/etcd/client/pkg/v3 v3.6.6 h1:uoqgzSOv2H9KlIF5O1Lsd8sW+eMLuV6wzE3q5GJGQNs= +go.etcd.io/etcd/client/pkg/v3 v3.6.6/go.mod h1:YngfUVmvsvOJ2rRgStIyHsKtOt9SZI2aBJrZiWJhCbI= +go.etcd.io/etcd/client/v3 v3.6.6 h1:G5z1wMf5B9SNexoxOHUGBaULurOZPIgGPsW6CN492ec= +go.etcd.io/etcd/client/v3 v3.6.6/go.mod h1:36Qv6baQ07znPR3+n7t+Rk5VHEzVYPvFfGmfF4wBHV8= +go.etcd.io/etcd/pkg/v3 v3.6.6 h1:wylOivS/UxXTZ0Le5fOdxCjatW5ql9dcWEggQQHSorw= +go.etcd.io/etcd/pkg/v3 v3.6.6/go.mod h1:9TKZL7WUEVHXYM3srP3ESZfIms34s1G72eNtWA9YKg4= +go.etcd.io/etcd/server/v3 v3.6.6 h1:YSRWGJPzU+lIREwUQI4MfyLZrkUyzjJOVpMxJvZePaY= +go.etcd.io/etcd/server/v3 v3.6.6/go.mod h1:A1OQ1x3PaiENDLywMjCiMwV1pwJSpb0h9Z5ORP2dv6I= go.etcd.io/raft/v3 v3.6.0 h1:5NtvbDVYpnfZWcIHgGRk9DyzkBIXOi8j+DDp1IcnUWQ= go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= -go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= +go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= +go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= @@ -554,19 +573,19 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqx go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= -go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= +go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= +go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI= -go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg= +go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= +go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc= -go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= +go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= +go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= -go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= +go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= +go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= @@ -580,10 +599,10 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= -go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= +go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -600,8 +619,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= -golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= +golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= +golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -678,15 +697,15 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4= -golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= -golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= +golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= +golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -755,8 +774,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= -golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= +golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -768,8 +787,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q= -golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss= +golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= +golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -784,14 +803,14 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= -golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= -golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -834,8 +853,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= -golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= +golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= +golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -879,10 +898,10 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 h1:FiusG7LWj+4byqhbvmB+Q93B/mOxJLN2DTozDuZm4EU= -google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:kXqgZtrWaf6qS3jZOCnCH7WYfrvFjkC51bM8fz3RsCA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 h1:pFyd6EwwL2TqFf8emdthzeX+gZE1ElRq3iM8pui4KBY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -895,8 +914,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4= -google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -909,8 +928,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -919,8 +938,8 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= -gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo= +gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -953,39 +972,39 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= -k8s.io/api v0.34.0 h1:L+JtP2wDbEYPUeNGbeSa/5GwFtIA662EmT2YSLOkAVE= -k8s.io/api v0.34.0/go.mod h1:YzgkIzOOlhl9uwWCZNqpw6RJy9L2FK4dlJeayUoydug= +k8s.io/api v0.34.2 h1:fsSUNZhV+bnL6Aqrp6O7lMTy6o5x2C4XLjnh//8SLYY= +k8s.io/api v0.34.2/go.mod h1:MMBPaWlED2a8w4RSeanD76f7opUoypY8TFYkSM+3XHw= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.34.0 h1:eR1WO5fo0HyoQZt1wdISpFDffnWOvFLOOeJ7MgIv4z0= -k8s.io/apimachinery v0.34.0/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= +k8s.io/apimachinery v0.34.2 h1:zQ12Uk3eMHPxrsbUJgNF8bTauTVR2WgqJsTmwTE/NW4= +k8s.io/apimachinery v0.34.2/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= -k8s.io/client-go v0.34.0 h1:YoWv5r7bsBfb0Hs2jh8SOvFbKzzxyNo0nSb0zC19KZo= -k8s.io/client-go v0.34.0/go.mod h1:ozgMnEKXkRjeMvBZdV1AijMHLTh3pbACPvK7zFR+QQY= +k8s.io/client-go v0.34.2 h1:Co6XiknN+uUZqiddlfAjT68184/37PS4QAzYvQvDR8M= +k8s.io/client-go v0.34.2/go.mod h1:2VYDl1XXJsdcAxw7BenFslRQX28Dxz91U9MWKjX97fE= k8s.io/component-base v0.22.0/go.mod h1:SXj6Z+V6P6GsBhHZVbWCw9hFjUdUYnJerlhhPnYCBCg= -k8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk= -k8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w= +k8s.io/component-base v0.34.2 h1:HQRqK9x2sSAsd8+R4xxRirlTjowsg6fWCPwWYeSvogQ= +k8s.io/component-base v0.34.2/go.mod h1:9xw2FHJavUHBFpiGkZoKuYZ5pdtLKe97DEByaA+hHbM= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA= -k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= -sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco= -sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.3.1 h1:JrhdFMqOd/+3ByqlP2I45kTOZmTRLBUm5pvRjeheg7E= +sigs.k8s.io/structured-merge-diff/v6 v6.3.1/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/helper.mk b/helper.mk new file mode 100644 index 00000000..386320a0 --- /dev/null +++ b/helper.mk @@ -0,0 +1,17 @@ +# Copyright © 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Dell Technologies, Dell and other trademarks are trademarks of Dell Inc. +# or its subsidiaries. Other trademarks may be trademarks of their respective +# owners. + +generate: + GOPRIVATE=github.com go generate + GOPRIVATE=github.com go run core/semver/semver.go -f mk > semver.mk + +download-csm-common: + git clone --depth 1 git@github.com:CSM/csm.git temp-repo + cp temp-repo/config/csm-common.mk . + rm -rf temp-repo + +vendor: + GOPRIVATE=github.com go mod vendor diff --git a/images.mk b/images.mk new file mode 100644 index 00000000..fb7b0eb3 --- /dev/null +++ b/images.mk @@ -0,0 +1,21 @@ +# Copyright © 2026 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Dell Technologies, Dell and other trademarks are trademarks of Dell Inc. +# or its subsidiaries. Other trademarks may be trademarks of their respective +# owners. + +include overrides.mk +include helper.mk + +images: download-csm-common generate vendor + $(eval include csm-common.mk) + @echo "Building: $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)" + $(BUILDER) build --pull $(NOCACHE) -t "$(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)" --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) . + +images-no-cache: + @echo "Building with --no-cache ..." + @make images NOCACHE=--no-cache + +push: + @echo "Pushing: $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)" + $(BUILDER) push "$(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)" diff --git a/main.go b/main.go index fec7605e..95d79c5c 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main /* - Copyright (c) 2019-2025 Dell Inc, or its subsidiaries. + Copyright (c) 2019-2026 Dell Inc, or its subsidiaries. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,17 +25,19 @@ import ( "strings" "time" - "github.com/dell/csi-isilon/v2/common/constants" - "github.com/dell/csi-isilon/v2/common/k8sutils" - "github.com/dell/csi-isilon/v2/provider" - "github.com/dell/csi-isilon/v2/service" + "github.com/dell/csi-powerscale/v2/common/constants" + "github.com/dell/csi-powerscale/v2/common/k8sutils" + "github.com/dell/csi-powerscale/v2/provider" + "github.com/dell/csi-powerscale/v2/service" + csmlog "github.com/dell/csmlog" "github.com/dell/gocsi" - log "github.com/sirupsen/logrus" "k8s.io/client-go/kubernetes" ) var exitFunc = os.Exit +var ManifestSemver string + // sets environment variables func setEnvsFunc() { // We always want to enable Request and Response logging(no reason for users to control this) @@ -44,6 +46,7 @@ func setEnvsFunc() { } func validateArgs(driverConfigParamsfile *string) { + log := csmlog.GetLogger() log.Info("Validating driver config params file argument") if *driverConfigParamsfile == "" { fmt.Fprintf(os.Stderr, "driver-config-params argument is mandatory") @@ -67,6 +70,13 @@ func main() { } func mainR(runFunc func(ctx context.Context, name, desc string, usage string, sp gocsi.StoragePluginProvider), createKubeClientSet func(kubeconfig string) (kubernetes.Interface, error), leaderElection func(clientset kubernetes.Interface, lockName, namespace string, renewDeadline, leaseDuration, retryPeriod time.Duration, run func(ctx context.Context))) { + log := csmlog.GetLogger() + + if ManifestSemver != "" { + service.ManifestSemver = ManifestSemver + service.Manifest["semver"] = ManifestSemver + } + setEnvsFunc() enableLeaderElection := flag.Bool("leader-election", false, "Enables leader election.") log.Info("Enabling leader election") diff --git a/main_test.go b/main_test.go index e53578f2..d4374cf8 100644 --- a/main_test.go +++ b/main_test.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2025 Dell Inc, or its subsidiaries. +Copyright (c) 2025-2026 Dell Inc, or its subsidiaries. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/dell/csi-isilon/v2/common/constants" + "github.com/dell/csi-powerscale/v2/common/constants" "github.com/dell/gocsi" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -124,6 +124,9 @@ func TestMainFunctionWithLeaderElection(t *testing.T) { os.Unsetenv("KUBERNETES_SERVICE_PORT") }() + // Set Manifest version similar to how the image would be built. + ManifestSemver = "1.0.0" + // reset os.Args before next test os.Args = origArgs diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..a88f6c9c --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,7 @@ +site_name: 'csi-powerscale' +site_description: 'csi-powerscale Documentation.' +docs_dir: docs +plugins: + - techdocs-core +theme: + name: material diff --git a/overrides.mk b/overrides.mk index 7c4530f8..f539071d 100644 --- a/overrides.mk +++ b/overrides.mk @@ -1,54 +1,12 @@ -# Copyright © 2020-2023 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2020-2026 Dell Inc. or its subsidiaries. All Rights Reserved. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License +# Dell Technologies, Dell and other trademarks are trademarks of Dell Inc. +# or its subsidiaries. Other trademarks may be trademarks of their respective +# owners. -# overrides file -# this file, included from the Makefile, will overlay default values with environment variables -# - -# DEFAULT values -DEFAULT_GOVERSION="1.21" -DEFAULT_REGISTRY="" -DEFAULT_IMAGENAME="isilon" -DEFAULT_BUILDSTAGE="final" -ifeq ($(origin BUILD_TIMESTAMP), undefined) -BUILD_TIMESTAMP := $(shell date +%Y%m%d%H%M%S) -endif -DEFAULT_IMAGETAG=$(BUILD_TIMESTAMP) -DEFAULT_GOPROXY="" - -# set the GOVERSION if needed -ifeq ($(GOVERSION),) -export GOVERSION="$(DEFAULT_GOVERSION)" -endif - -# set the REGISTRY if needed -ifeq ($(REGISTRY),) -export REGISTRY="$(DEFAULT_REGISTRY)" -endif - -# set the IMAGENAME if needed -ifeq ($(IMAGENAME),) -export IMAGENAME="$(DEFAULT_IMAGENAME)" -endif - -# set the IMAGETAG if needed -ifeq ($(IMAGETAG),) -export IMAGETAG="$(DEFAULT_IMAGETAG)" -endif - -# set the GOPROXY if needed -ifeq ($(GOPROXY),) -export GOPROXY="$(DEFAULT_GOPROXY)" -endif +IMAGE_REGISTRY="sample_registry" +IMAGE_NAME="csi-isilon" +IMAGE_TAG?=$(shell date +%Y%m%d%H%M%S) # figure out if podman or docker should be used (use podman if found) ifneq (, $(shell which podman 2>/dev/null)) @@ -62,14 +20,10 @@ overrides-help: @echo @echo "The following environment variables can be set to control the build" @echo - @echo "GOVERSION - The version of Go to build with, default is: $(DEFAULT_GOVERSION)" - @echo " Current setting is: $(GOVERSION)" - @echo "REGISTRY - The registry to push images to, default is: $(DEFAULT_REGISTRY)" - @echo " Current setting is: $(REGISTRY)" - @echo "IMAGENAME - The image name to be built, defaut is: $(DEFAULT_IMAGENAME)" - @echo " Current setting is: $(IMAGENAME)" - @echo "IMAGETAG - The image tag to be built, default is an empty string which will determine the tag by examining annotated tags in the repo." - @echo " Current setting is: $(IMAGETAG)" - @echo "GOPROXY - The goproxy to be used for resolving dependencies, default is: $(DEFAULT_GOPROXY)" - @echo " Current setting is: $(GOPROXY)" + @echo "IMAGE_REGISTRY - The registry to push images to." + @echo " Current setting is: $(IMAGE_REGISTRY)" + @echo "IMAGE_NAME - The image name to be built." + @echo " Current setting is: $(IMAGE_NAME)" + @echo "IMAGE_TAG - The image tag to be built, default is the current date." + @echo " Current setting is: $(IMAGE_TAG)" @echo diff --git a/provider/provider.go b/provider/provider.go index 846ef7f5..1e5f137e 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -17,18 +17,18 @@ package provider */ import ( - "github.com/dell/csi-isilon/v2/common/utils/logging" - csiutils "github.com/dell/csi-isilon/v2/csi-utils" - "github.com/dell/csi-isilon/v2/service" - "github.com/dell/csi-isilon/v2/service/interceptor" + csiutils "github.com/dell/csi-powerscale/v2/csi-utils" + "github.com/dell/csi-powerscale/v2/service" + "github.com/dell/csi-powerscale/v2/service/interceptor" + csmlog "github.com/dell/csmlog" "github.com/dell/gocsi" "google.golang.org/grpc" ) +var log = csmlog.GetLogger() + // New returns a new Storage Plug-in Provider. func New() gocsi.StoragePluginProvider { - log := logging.GetLogger() - // TODO during the test, for some reason, when the controller & node pods start, // the sock files always exist right from the beginning, even if you manually // remove them prior to using helm to install the csi driver. Need to find out why. diff --git a/provider/provider_test.go b/provider/provider_test.go index cdf36c70..1cf49732 100644 --- a/provider/provider_test.go +++ b/provider/provider_test.go @@ -21,7 +21,7 @@ import ( "errors" "testing" - csiutils "github.com/dell/csi-isilon/v2/csi-utils" + csiutils "github.com/dell/csi-powerscale/v2/csi-utils" "github.com/dell/gocsi" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/samples/secret/karavi-authorization-config.json b/samples/secret/karavi-authorization-config.json deleted file mode 100644 index 10ce0c3a..00000000 --- a/samples/secret/karavi-authorization-config.json +++ /dev/null @@ -1 +0,0 @@ -[{"username":"-","password":"-","intendedEndpoint":"https://10.0.0.1:8080","endpoint":"https://localhost:9400","systemID":"myIsilonClusterName","skipCertificateValidation":true,"isDefault":true}] diff --git a/service/controller.go b/service/controller.go index 275e9e8e..ebe50f0e 100644 --- a/service/controller.go +++ b/service/controller.go @@ -29,15 +29,16 @@ import ( fPath "path" + "github.com/dell/csi-powerscale/v2/common/constants" + id "github.com/dell/csi-powerscale/v2/common/utils/identifiers" + + isilonfs "github.com/dell/csi-powerscale/v2/common/utils/powerscale-fs" + csiutils "github.com/dell/csi-powerscale/v2/csi-utils" + csmlog "github.com/dell/csmlog" + isi "github.com/dell/gopowerscale" + isiApi "github.com/dell/gopowerscale/api" + v1 "github.com/dell/gopowerscale/api/v1" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/csi-isilon/v2/common/constants" - id "github.com/dell/csi-isilon/v2/common/utils/identifiers" - "github.com/dell/csi-isilon/v2/common/utils/logging" - isilonfs "github.com/dell/csi-isilon/v2/common/utils/powerscale-fs" - csiutils "github.com/dell/csi-isilon/v2/csi-utils" - isi "github.com/dell/goisilon" - isiApi "github.com/dell/goisilon/api" - v1 "github.com/dell/goisilon/api/v1" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -121,6 +122,7 @@ const ( // clusterToNodeIDMap is a map[clusterName][]*nodeIDToClientMap var clusterToNodeIDMap = new(sync.Map) +var log = csmlog.GetLogger() var ( getGetExportWithPathAndZoneFunc = func(isiConfig *IsilonClusterConfig) func(context.Context, string, string) (isi.Export, error) { return isiConfig.isiSvc.GetExportWithPathAndZone @@ -273,18 +275,20 @@ func (s *service) CreateVolume( } } - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) + // set noProbeOnStart to false so subsequent calls can lead to probe noProbeOnStart = false isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error: %v ", err.Error()) return nil, err } - - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // auto probe @@ -364,7 +368,7 @@ func (s *service) CreateVolume( _, err := strconv.ParseBool(val) // use the default if the boolean literal from the storage class is malformed if err != nil { - log.WithField(RootClientEnabledParam, val).Debugf( + log.WithFields(csmlog.Fields{RootClientEnabledParam: val}).Debugf( "invalid boolean value for '%s', defaulting to 'false'", RootClientEnabledParam) rootClientEnabled = RootClientEnabledParamDefault @@ -393,11 +397,11 @@ func (s *service) CreateVolume( var snapshotSrcClusterName string sourceSnapshotID, snapshotSrcClusterName, _, err = id.ParseNormalizedSnapshotID(ctx, normalizedSnapshotID) if err != nil { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "failed to parse snapshot ID '%s', error : '%v'", normalizedSnapshotID, err)) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "failed to parse snapshot ID '%s', error : '%v'", normalizedSnapshotID, err)) } if snapshotSrcClusterName != "" && snapshotSrcClusterName != clusterName { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "source snapshot's cluster name '%s' and new volume's cluster name '%s' doesn't match", snapshotSrcClusterName, clusterName)) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "source snapshot's cluster name '%s' and new volume's cluster name '%s' doesn't match", snapshotSrcClusterName, clusterName)) } log.Infof("Creating volume from snapshot ID: '%s'", sourceSnapshotID) @@ -415,17 +419,17 @@ func (s *service) CreateVolume( vcs := req.GetVolumeCapabilities() if len(vcs) == 0 { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "volume capabilty is required")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "volume capabilty is required")) } for _, vc := range vcs { if vc == nil { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "volume capabilty is required")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "volume capabilty is required")) } am := vc.GetAccessMode() if am == nil { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "access mode is required")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "access mode is required")) } if am.Mode == csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY { @@ -468,7 +472,7 @@ func (s *service) CreateVolume( remoteIsiConfig, err := s.getIsilonConfig(ctx, &remoteSystemName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v ", err.Error()) return nil, status.Errorf(codes.InvalidArgument, "can't find cluster with name %s in driver config", remoteSystemName) } @@ -576,7 +580,7 @@ func (s *service) CreateVolume( var errMsg string if err == nil { if foundVol { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "the export may not be ready yet and the path is %s", path)) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "the export may not be ready yet and the path is %s", path)) } } else { // internal error @@ -681,7 +685,7 @@ func (s *service) CreateVolume( return s.getCreateVolumeResponse(ctx, exportID, volumeName, exportPath, accessZone, sizeInBytes, azServiceIP, rootClientEnabled, sourceSnapshotID, sourceVolumeID, clusterName, azNetwork), nil } time.Sleep(RetrySleepTime) - log.Printf("Begin to retry '%d' time(s), for export id '%d' and path '%s'\n", i+1, exportID, path) + log.Infof("Begin to retry '%d' time(s), for export id '%d' and path '%s'\n", i+1, exportID, path) } } else { return nil, err @@ -712,7 +716,7 @@ func (s *service) CreateVolume( return s.getCreateVolumeResponse(ctx, exportID, volumeName, exportPath, accessZone, sizeInBytes, azServiceIP, rootClientEnabled, sourceSnapshotID, sourceVolumeID, clusterName, azNetwork), nil } time.Sleep(RetrySleepTime) - log.Printf("Begin to retry '%d' time(s), for export id '%d' and path '%s'\n", i+1, exportID, path) + log.Infof("Begin to retry '%d' time(s), for export id '%d' and path '%s'\n", i+1, exportID, path) } } else { // clear quota and delete volume since the export cannot be created @@ -725,7 +729,7 @@ func (s *service) CreateVolume( return nil, err } } - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "the export id %d and path %s may not be ready yet after retrying", exportID, path)) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "the export id %d and path %s may not be ready yet after retrying", exportID, path)) } // Define function types for external function calls @@ -882,9 +886,7 @@ func (s *service) getCSIVolume(ctx context.Context, exportID int, volName, path, "ClusterName": clusterName, } - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) log.Debugf("Attributes '%v'", attributes) // Set content source as part of create volume response if volume is created from snapshot or existing volume @@ -924,14 +926,15 @@ func (s *service) DeleteVolume( *csi.DeleteVolumeResponse, error, ) { // TODO more checks need to be done, e.g. if access mode is VolumeCapability_AccessMode_MULTI_NODE_XXX, then other nodes might still be using this volume, thus the delete should be skipped - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) + fields := csmlog.ExtractFieldsFromContext(ctx) + // set noProbeOnStart to false so subsequent calls can lead to probe noProbeOnStart = false // validate request if err := s.ValidateDeleteVolumeRequest(ctx, req); err != nil { - log.Error("invalid volume id ", err.Error()) + log.Errorf("invalid volume id %v", err.Error()) return &csi.DeleteVolumeResponse{}, nil } @@ -943,11 +946,12 @@ func (s *service) DeleteVolume( isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + fields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, fields) log.Debugf("Cluster Name: %v", clusterName) // probe if err := s.autoProbe(ctx, isiConfig); err != nil { @@ -1078,9 +1082,7 @@ func (s *service) processSnapshotTrackingDirectoryDuringDeleteVolume( ) error { exportPath := (*export.Paths)[0] - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) // Get Zone Path zone, err := getZoneByNameFunc(isiConfig)(ctx, accessZone) if err != nil { @@ -1151,9 +1153,8 @@ func (s *service) ControllerExpandVolume( ctx context.Context, req *csi.ControllerExpandVolumeRequest, ) (*csi.ControllerExpandVolumeResponse, error) { - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) + fields := csmlog.ExtractFieldsFromContext(ctx) volName, exportID, accessZone, clusterName, err := id.ParseNormalizedVolumeID(ctx, req.GetVolumeId()) if err != nil { return nil, status.Error(codes.NotFound, err.Error()) @@ -1161,11 +1162,13 @@ func (s *service) ControllerExpandVolume( isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + fields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, fields) + log.Debugf("Cluster Name: %v", clusterName) // auto probe @@ -1232,16 +1235,17 @@ func (s *service) ControllerPublishVolume( isROVolumeFromSnapshot bool ) - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) // set noProbeOnStart to false so subsequent calls can lead to probe noProbeOnStart = false volumeContext := req.GetVolumeContext() if volumeContext != nil { - log.Printf("VolumeContext:") + log.Infof("VolumeContext:") for key, value := range volumeContext { - log.Printf(" [%s]=%s", key, value) + log.Infof(" [%s]=%s", key, value) } // Check volumeContext for AzNetwork and get the corresponding IP from node labels if azNet, ok := volumeContext["AzNetwork"]; ok && azNet != "" { @@ -1260,21 +1264,22 @@ func (s *service) ControllerPublishVolume( volID := req.GetVolumeId() if volID == "" { return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "volume ID is required")) + GetMessageWithReqID(runID, "volume ID is required")) } volName, exportID, accessZone, clusterName, err := id.ParseNormalizedVolumeID(ctx, volID) if err != nil { - return nil, status.Error(codes.NotFound, logging.GetMessageWithRunID(runID, "failed to parse volume ID '%s', error : '%v'", volID, err)) + return nil, status.Error(codes.NotFound, GetMessageWithReqID(runID, "failed to parse volume ID '%s', error : '%v'", volID, err)) } isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) if err := s.autoProbe(ctx, isiConfig); err != nil { @@ -1300,14 +1305,14 @@ func (s *service) ControllerPublishVolume( if isROVolumeFromSnapshot { log.Info("Volume source is snapshot") if export, err := isiConfig.isiSvc.GetExportWithPathAndZone(ctx, exportPath, accessZone); err != nil || export == nil { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "error retrieving export for %s", exportPath)) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "error retrieving export for %s", exportPath)) } } else { isiPath = isilonfs.GetIsiPathFromExportPath(exportPath) vol, err := isiConfig.isiSvc.GetVolumeWithIsiPath(ctx, isiPath, "", volName) if err != nil || vol.Name == "" { return nil, status.Error(codes.Internal, - logging.GetMessageWithRunID(runID, "failure checking volume status before controller publish: %s", + GetMessageWithReqID(runID, "failure checking volume status before controller publish: %s", err.Error())) } } @@ -1316,30 +1321,30 @@ func (s *service) ControllerPublishVolume( if nodeID == "" { return nil, status.Error(codes.NotFound, - logging.GetMessageWithRunID(runID, "node ID is required")) + GetMessageWithReqID(runID, "node ID is required")) } vc := req.GetVolumeCapability() if vc == nil { return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "volume capability is required")) + GetMessageWithReqID(runID, "volume capability is required")) } am := vc.GetAccessMode() if am == nil { return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "access mode is required")) + GetMessageWithReqID(runID, "access mode is required")) } if am.Mode == csi.VolumeCapability_AccessMode_UNKNOWN { return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, errUnknownAccessMode)) + GetMessageWithReqID(runID, errUnknownAccessMode)) } vcs := []*csi.VolumeCapability{req.GetVolumeCapability()} if !checkValidAccessTypes(vcs) { return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, errUnknownAccessType)) + GetMessageWithReqID(runID, errUnknownAccessType)) } rootClientEnabled := false @@ -1353,20 +1358,20 @@ func (s *service) ControllerPublishVolume( if err != nil { log.Errorf("failed to parse node id '%s' with error : %s", nodeID, err.Error()) return nil, status.Error(codes.NotFound, - logging.GetMessageWithRunID(runID, "failed to parse node id '%s'", nodeID)) + GetMessageWithReqID(runID, "failed to parse node id '%s'", nodeID)) } exportCount, err := isiConfig.isiSvc.GetExportsCountAttachedToNode(ctx, nodeIP) if err != nil { log.Errorf("failed to export count for node id '%s' with error : %s", nodeID, err.Error()) return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "failed to export count for node id '%s'", nodeID)) + GetMessageWithReqID(runID, "failed to export count for node id '%s'", nodeID)) } if s.opts.MaxVolumesPerNode > 0 && exportCount >= s.opts.MaxVolumesPerNode { log.Errorf("maximum volume limit reached for node : '%s'", nodeID) return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "maximum volume limit reached for node : '%s'", nodeID)) + GetMessageWithReqID(runID, "maximum volume limit reached for node : '%s'", nodeID)) } addClientFunc := s.getAddClientFunc(rootClientEnabled, isiConfig) @@ -1427,7 +1432,7 @@ func (s *service) ControllerPublishVolume( break } if isiConfig.isiSvc.OtherClientsAlreadyAdded(ctx, exportID, accessZone, nodeID) { - return nil, status.Error(codes.NotFound, logging.GetMessageWithRunID(runID, + return nil, status.Error(codes.NotFound, GetMessageWithReqID(runID, "export %d in access zone %s already has other clients added to it, and the access mode is %s, thus the request fails", exportID, accessZone, am.Mode)) } @@ -1453,11 +1458,11 @@ func (s *service) ControllerPublishVolume( } } default: - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "unsupported access mode: %s", am.String())) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "unsupported access mode: %s", am.String())) } if err != nil { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "internal error occurred when attempting to add client ip %s to export %d, error : %v", nodeID, exportID, err)) } return &csi.ControllerPublishVolumeResponse{}, nil @@ -1473,9 +1478,8 @@ func (s *service) ValidateVolumeCapabilities( isiPath string ) - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) - + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) // parse the input volume id and fetch it's components volID := req.GetVolumeId() volName, exportID, accessZone, clusterName, err := id.ParseNormalizedVolumeID(ctx, volID) @@ -1485,11 +1489,14 @@ func (s *service) ValidateVolumeCapabilities( isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v ", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) + fields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", fields["csi.requestid"]) log.Debugf("Cluster Name: %v", clusterName) if err := s.autoProbe(ctx, isiConfig); err != nil { @@ -1507,11 +1514,10 @@ func (s *service) ValidateVolumeCapabilities( } } isiPath = isilonfs.GetIsiPathFromExportPath(exportPath) - vol, err := s.getVolByName(ctx, isiPath, volName, isiConfig) if err != nil { return nil, status.Error(codes.Internal, - logging.GetMessageWithRunID(runID, "failure checking volume status for capabilities: %s", + GetMessageWithReqID(runID, "failure checking volume status for capabilities: %s", err.Error())) } @@ -1604,7 +1610,9 @@ func (s *service) ListVolumes(_ context.Context, } func (s *service) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) { - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + fields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", fields["csi.requestid"]) var ( startToken int maxEntries = int(req.GetMaxEntries()) @@ -1618,7 +1626,7 @@ func (s *service) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReque i, err := strconv.ParseInt(token, 10, 64) if err != nil { log.Errorf("Failed to parse starting token: %s, error=%v", token, err) - return nil, status.Error(codes.Aborted, logging.GetMessageWithRunID(runID, "unable to parse StartingToken: %v into uint32", token)) + return nil, status.Error(codes.Aborted, GetMessageWithReqID(runID, "unable to parse StartingToken: %v into uint32", token)) } startToken = int(i) log.Debugf("Parsed starting token: startToken=%d", startToken) @@ -1627,7 +1635,7 @@ func (s *service) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReque snapshots, nextToken, err := s.listPowerScaleSnapshots(ctx, startToken, maxEntries, snapshotID, sourceVolID) if err != nil { log.Errorf("Failed to list snapshots: %v", err) - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "failed to list snapshots: %v", err.Error())) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "failed to list snapshots: %v", err.Error())) } if len(snapshots) == 0 { @@ -1651,14 +1659,14 @@ func (s *service) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReque } func (s *service) listPowerScaleSnapshots(ctx context.Context, startToken, maxEntries int, snapID, srcID string) (isi.SnapshotList, string, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) log.Infof("Entering listPowerScaleSnapshots: snapID=%s, srcID=%s", snapID, srcID) var filteredSnapshots isi.SnapshotList var totalSnapshots int for _, config := range s.getIsilonClusters() { - log := log.WithField("cluster", config.ClusterName) + log := log.WithFields(csmlog.Fields{"cluster": config.ClusterName}) snapshots, err := config.isiSvc.GetSnapshots(ctx) if err != nil { log.Errorf("Failed to get snapshots: %v", err) @@ -1732,8 +1740,8 @@ func shouldIncludeSnapshot(ctx context.Context, snap isi.Snapshot, snapID, srcID // It replaces the snapshot name with a normalized snapshot ID (e.g. 12345=_=_=cluster1=_=_=zone1) // and the snapshot path with a normalized volume ID of the source volume (e.g. k8s-e89c9d089e=_=_=19=_=_=csi0zone=_=_=cluster1). func normalizeSnapshot(ctx context.Context, snap isi.Snapshot, config *IsilonClusterConfig, s *service) { - ctx, log, _ := GetRunIDLog(ctx) - log = log.WithField("snapshotID", snap.ID) + log := log.WithContext(ctx) + log = log.WithFields(csmlog.Fields{"snapshotID": snap.ID}) log.Debugf("Normalizing snapshot: ID=%d", snap.ID) snap.Name = id.GetNormalizedSnapshotID(ctx, strconv.FormatInt(snap.ID, 10), config.ClusterName, s.opts.AccessZone) @@ -1751,19 +1759,20 @@ func (s *service) ControllerUnpublishVolume( req *csi.ControllerUnpublishVolumeRequest) ( *csi.ControllerUnpublishVolumeResponse, error, ) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) // set noProbeOnStart to false so subsequent calls can lead to probe noProbeOnStart = false azNetwork := "" if req.VolumeId == "" { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "ControllerUnpublishVolumeRequest.VolumeId is empty")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "ControllerUnpublishVolumeRequest.VolumeId is empty")) } volumeName, exportID, accessZone, clusterName, err := id.ParseNormalizedVolumeID(ctx, req.VolumeId) if err != nil { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "failed to parse volume ID %s, error : %s", req.VolumeId, err.Error())) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "failed to parse volume ID %s, error : %s", req.VolumeId, err.Error())) } // Get the PV with the given volumeName @@ -1778,16 +1787,17 @@ func (s *service) ControllerUnpublishVolume( isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error : %v ", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // auto probe if err := s.autoProbe(ctx, isiConfig); err != nil { - return nil, status.Error(codes.FailedPrecondition, logging.GetMessageWithRunID(runID, "error %s", err.Error())) + return nil, status.Error(codes.FailedPrecondition, GetMessageWithReqID(runID, "error %s", err.Error())) } if volErr == nil { @@ -1803,7 +1813,7 @@ func (s *service) ControllerUnpublishVolume( ips, err := s.getIpsFromAZNetworkLabel(ctx, req.NodeId, azNetwork) if err != nil { log.Debugf("No matching IP(s) found from AZNetwork label %s", azNetwork) - return nil, status.Error(codes.FailedPrecondition, logging.GetMessageWithRunID(runID, "error %s", err.Error())) + return nil, status.Error(codes.FailedPrecondition, GetMessageWithReqID(runID, "error %s", err.Error())) } log.Debugf("Using IPs %s from AZNetwork %s to remove from export", ips, azNetwork) @@ -1814,7 +1824,7 @@ func (s *service) ControllerUnpublishVolume( return nil, delErr } } else { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "error encountered when trying to remove clients %s from export %d with access zone %s on cluster %s, error %s", ips, exportID, accessZone, clusterName, err.Error())) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "error encountered when trying to remove clients %s from export %d with access zone %s on cluster %s, error %s", ips, exportID, accessZone, clusterName, err.Error())) } } } else { @@ -1824,7 +1834,7 @@ func (s *service) ControllerUnpublishVolume( nodeID := req.GetNodeId() if nodeID == "" { return nil, status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "node ID is required")) + GetMessageWithReqID(runID, "node ID is required")) } log.Debugf("ignoreUnresolvableHosts value is '%t', for clusterName '%s'", *isiConfig.IgnoreUnresolvableHosts, clusterName) @@ -1836,7 +1846,7 @@ func (s *service) ControllerUnpublishVolume( return nil, delErr } } else { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "error encountered when trying to remove client %s from export %d with access zone %s on cluster %s, error %s", nodeID, exportID, accessZone, clusterName, err.Error())) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "error encountered when trying to remove client %s from export %d with access zone %s on cluster %s, error %s", nodeID, exportID, accessZone, clusterName, err.Error())) } } } @@ -1858,18 +1868,16 @@ func (s *service) ControllerUnpublishVolume( // []string: The array of IP(s) associated with the matching AZNetwork label, or empty if not found // error: Any error that occurs during the function call func (s *service) getIpsFromAZNetworkLabel(ctx context.Context, nodeID, azNetwork string) ([]string, error) { - // Fetch log handler - _, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) // Get node labels nodeName, _, _, err := id.ParseNodeID(ctx, nodeID) if err != nil { - log.Error("failed to get Node Name with error", err.Error()) + log.Errorf("failed to get Node Name with error %v", err.Error()) return nil, err } labels, err := getNodeLabelsWithNameFunc(s)(nodeName) if err != nil { - log.Error("failed to get Node Labels with error", err.Error()) + log.Errorf("failed to get Node Labels with error %v", err.Error()) return nil, err } @@ -1909,8 +1917,9 @@ func (s *service) GetCapacity( var clusterName string params := req.GetParameters() - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) if _, ok := params[ClusterNameParam]; ok { if params[ClusterNameParam] == "" { @@ -1922,11 +1931,12 @@ func (s *service) GetCapacity( isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) if err := s.autoProbe(ctx, isiConfig); err != nil { @@ -1939,10 +1949,10 @@ func (s *service) GetCapacity( stat, err := isiConfig.isiSvc.GetStatistics(ctx, keyArray) if err != nil || len(stat.StatsList) < 1 { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "Could not retrieve capacity. %s", err.Error())) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "Could not retrieve capacity. %s", err.Error())) } if stat.StatsList[0].Error != "" { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "Could not retrieve capacity. Data returned error %s", stat.StatsList[0].Error)) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "Could not retrieve capacity. Data returned error %s", stat.StatsList[0].Error)) } remainingCapInBytes := stat.StatsList[0].Value @@ -2049,15 +2059,14 @@ func (s *service) ControllerGetCapabilities( } func (s *service) controllerProbe(ctx context.Context, clusterConfig *IsilonClusterConfig) error { - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) if err := s.validateOptsParameters(clusterConfig); err != nil { return fmt.Errorf("controller probe failed : '%v'", err) } if clusterConfig.isiSvc == nil { - logLevel := logging.GetCurrentLogLevel() + logLevel := csmlog.GetLevel() var err error clusterConfig.isiSvc, err = s.GetIsiService(ctx, clusterConfig, logLevel) if clusterConfig.isiSvc == nil { @@ -2085,28 +2094,30 @@ func (s *service) CreateSnapshot( req *csi.CreateSnapshotRequest) ( *csi.CreateSnapshotResponse, error, ) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) log.Infof("CreateSnapshot started") // parse the input volume id and fetch it's components _, exportID, accessZone, clusterName, err := id.ParseNormalizedVolumeID(ctx, req.GetSourceVolumeId()) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, " runid=%s %s", runID, err.Error()) + return nil, status.Errorf(codes.InvalidArgument, " ReqID=%s %s", runID, err.Error()) } isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // auto probe if err := s.autoProbe(ctx, isiConfig); err != nil { - return nil, status.Errorf(codes.FailedPrecondition, " runid=%s %s", runID, err.Error()) + return nil, status.Errorf(codes.FailedPrecondition, " ReqID=%s %s", runID, err.Error()) } var ( @@ -2132,7 +2143,7 @@ func (s *service) CreateSnapshot( // snapshotName: name of the snapshot that need to be created srcVolumeID, snapshotName, err := s.validateCreateSnapshotRequest(ctx, req, isiPath, isiConfig) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, " runid=%s %s", runID, err.Error()) + return nil, status.Errorf(codes.InvalidArgument, " ReqID=%s %s", runID, err.Error()) } log.Infof("snapshot name is '%s' and source volume ID is '%s' access Zone is '%s'", snapshotName, srcVolumeID, accessZone) @@ -2146,14 +2157,14 @@ func (s *service) CreateSnapshot( } // return already exists error return nil, status.Error(codes.AlreadyExists, - logging.GetMessageWithRunID(runID, "a snapshot with name '%s' already exists but is "+ + GetMessageWithReqID(runID, "a snapshot with name '%s' already exists but is "+ "incompatible with the specified source volume id '%s'", snapshotName, req.GetSourceVolumeId())) } // create new snapshot for source direcory path := isilonfs.GetPathForVolume(isiPath, srcVolumeID) if snapshotNew, err = isiConfig.isiSvc.CreateSnapshot(ctx, path, snapshotName); err != nil { - return nil, status.Errorf(codes.Internal, " runid=%s %s", runID, err.Error()) + return nil, status.Errorf(codes.Internal, " ReqID=%s %s", runID, err.Error()) } _, _ = isiConfig.isiSvc.GetSnapshot(ctx, snapshotName) @@ -2167,26 +2178,28 @@ func (s *service) validateCreateSnapshotRequest( ctx context.Context, req *csi.CreateSnapshotRequest, isiPath string, isiConfig *IsilonClusterConfig, ) (string, string, error) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) srcVolumeID, _, _, clusterName, err := id.ParseNormalizedVolumeID(ctx, req.GetSourceVolumeId()) if err != nil { - return "", "", status.Errorf(codes.InvalidArgument, " runid=%s %s", runID, err.Error()) + return "", "", status.Errorf(codes.InvalidArgument, " ReqID=%s %s", runID, err.Error()) } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) if !isiConfig.isiSvc.IsVolumeExistent(ctx, isiPath, srcVolumeID, "") { return "", "", status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "source volume id is invalid")) + GetMessageWithReqID(runID, "source volume id is invalid")) } snapshotName := req.GetName() if snapshotName == "" { return "", "", status.Error(codes.InvalidArgument, - logging.GetMessageWithRunID(runID, "name cannot be empty")) + GetMessageWithReqID(runID, "name cannot be empty")) } return srcVolumeID, snapshotName, nil @@ -2222,11 +2235,12 @@ func (s *service) DeleteSnapshot( req *csi.DeleteSnapshotRequest) ( *csi.DeleteSnapshotResponse, error, ) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + fields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", fields["csi.requestid"]) log.Infof("DeleteSnapshot started") if req.GetSnapshotId() == "" { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "snapshot id to be deleted is required")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "snapshot id to be deleted is required")) } // parse the input snapshot id and fetch it's components snapshotID, clusterName, accessZone, err := id.ParseNormalizedSnapshotID(ctx, req.GetSnapshotId()) @@ -2235,11 +2249,12 @@ func (s *service) DeleteSnapshot( } isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v ", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + fields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, fields) log.Debugf("Cluster Name: %v", clusterName) if err := s.autoProbe(ctx, isiConfig); err != nil { @@ -2263,13 +2278,13 @@ func (s *service) DeleteSnapshot( return &csi.DeleteSnapshotResponse{}, nil } // Internal server error if the error is not about "not found" - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "cannot check the existence of the snapshot: %s", err.Error())) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "cannot check the existence of the snapshot: %s", err.Error())) } if jsonError.StatusCode == 404 { return &csi.DeleteSnapshotResponse{}, nil } - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "cannot check the existence of the snapshot: %s", err.Error())) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "cannot check the existence of the snapshot: %s", err.Error())) } // Get snapshot path @@ -2277,7 +2292,7 @@ func (s *service) DeleteSnapshot( log.Infof("Snapshot source volume isiPath is '%s'", snapshotSourceVolumeIsiPath) snapshotIsiPath, err := isiConfig.isiSvc.GetSnapshotIsiPath(ctx, snapshotSourceVolumeIsiPath, snapshotID, accessZone) if err != nil { - return nil, status.Errorf(codes.Internal, " runid%s error %s", runID, err.Error()) + return nil, status.Errorf(codes.Internal, " ReqID%s error %s", runID, err.Error()) } log.Debugf("The Isilon directory path of snapshot is= %v", snapshotIsiPath) @@ -2292,7 +2307,7 @@ func (s *service) DeleteSnapshot( // Note: This is true only for RO volumes from snapshots if export != nil { if err := s.processSnapshotTrackingDirectoryDuringDeleteSnapshot(ctx, export, snapshotIsiPath, accessZone, &deleteSnapshot, isiConfig); err != nil { - log.Error("Failed to get RO volume from snapshot ", err.Error()) + log.Errorf("Failed to get RO volume from snapshot %v ", err.Error()) return nil, err } } @@ -2300,7 +2315,7 @@ func (s *service) DeleteSnapshot( if deleteSnapshot { err = isiConfig.isiSvc.DeleteSnapshot(ctx, id, "") if err != nil { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "error deleting snapshot: %s", err.Error())) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "error deleting snapshot: %s", err.Error())) } } log.Infof("Snapshot with id '%s' deleted", snapshotID) @@ -2315,9 +2330,7 @@ func (s *service) processSnapshotTrackingDirectoryDuringDeleteSnapshot( deleteSnapshot *bool, isiConfig *IsilonClusterConfig, ) error { - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) // get Zone details zone, err := isiConfig.isiSvc.GetZoneByName(ctx, accessZone) if err != nil { @@ -2438,8 +2451,9 @@ func addMetaData(params map[string]string) map[string]string { func (s *service) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest, ) (*csi.ControllerGetVolumeResponse, error) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) abnormal := false message := "" @@ -2447,20 +2461,21 @@ func (s *service) ControllerGetVolume(ctx context.Context, volID := req.GetVolumeId() if volID == "" { - return nil, status.Error(codes.FailedPrecondition, logging.GetMessageWithRunID(runID, "no VolumeID found in request")) + return nil, status.Error(codes.FailedPrecondition, GetMessageWithReqID(runID, "no VolumeID found in request")) } volName, exportID, accessZone, clusterName, err := id.ParseNormalizedVolumeID(ctx, volID) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, " runid=%s error %s", runID, err.Error()) + return nil, status.Errorf(codes.InvalidArgument, " ReqID=%s error %s", runID, err.Error()) } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } @@ -2468,16 +2483,16 @@ func (s *service) ControllerGetVolume(ctx context.Context, isiPathFromParams, err := s.validateIsiPath(ctx, volName) if err != nil { - log.Error("Failed get isiPath", err.Error()) + log.Errorf("Failed get isiPath %v", err.Error()) } if isiPathFromParams != isiPath && isiPathFromParams != "" { - log.Debug("overriding isiPath with value from StorageClass", isiPathFromParams) + log.Debugf("overriding isiPath with value from StorageClass %v", isiPathFromParams) isiPath = isiPathFromParams } if err := s.autoProbe(ctx, isiConfig); err != nil { - return nil, status.Errorf(codes.FailedPrecondition, " runid=%s error %s", runID, err.Error()) + return nil, status.Errorf(codes.FailedPrecondition, " ReqID=%s error %s", runID, err.Error()) } // check if volume exists diff --git a/service/controllerNodeToArrayConnectivity.go b/service/controllerNodeToArrayConnectivity.go index f2961501..0bd7533a 100644 --- a/service/controllerNodeToArrayConnectivity.go +++ b/service/controllerNodeToArrayConnectivity.go @@ -38,10 +38,10 @@ var ( // queryStatus make API call to the specified url to retrieve connection status func (s *service) queryArrayStatus(ctx context.Context, url string) (bool, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) defer func() { if err := recover(); err != nil { - log.Println("panic occurred in queryStatus:", err) + log.Infof("panic occurred in queryStatus: %v", err) } }() log.Infof("Calling API %s with timeout %v", url, timeout) @@ -66,7 +66,7 @@ func (s *service) queryArrayStatus(ctx context.Context, url string) (bool, error } defer func() { if err := resp.Body.Close(); err != nil { - log.Printf("Error closing HTTP response: %s", err.Error()) + log.Infof("Error closing HTTP response: %s", err.Error()) } }() bodyBytes, err := GetIoReadAll(resp.Body) diff --git a/service/controller_test.go b/service/controller_test.go index 0c058ac2..f2f0e072 100644 --- a/service/controller_test.go +++ b/service/controller_test.go @@ -26,14 +26,14 @@ import ( "testing" "time" - "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/csi-isilon/v2/common/utils/identifiers" + "github.com/dell/csi-powerscale/v2/common/utils/identifiers" vgsext "github.com/dell/dell-csi-extensions/volumeGroupSnapshot" - isi "github.com/dell/goisilon" - apiv1 "github.com/dell/goisilon/api/v1" - v1 "github.com/dell/goisilon/api/v1" - v2 "github.com/dell/goisilon/api/v2" - isimocks "github.com/dell/goisilon/mocks" + isi "github.com/dell/gopowerscale" + apiv1 "github.com/dell/gopowerscale/api/v1" + v1 "github.com/dell/gopowerscale/api/v1" + v2 "github.com/dell/gopowerscale/api/v2" + isimocks "github.com/dell/gopowerscale/mocks" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/service/csi_extension_server.go b/service/csi_extension_server.go index 49f93e97..6d5d4ab1 100644 --- a/service/csi_extension_server.go +++ b/service/csi_extension_server.go @@ -20,12 +20,12 @@ import ( "context" "fmt" - id "github.com/dell/csi-isilon/v2/common/utils/identifiers" + id "github.com/dell/csi-powerscale/v2/common/utils/identifiers" podmon "github.com/dell/dell-csi-extensions/podmon" ) func (s *service) ValidateVolumeHostConnectivity(ctx context.Context, req *podmon.ValidateVolumeHostConnectivityRequest) (*podmon.ValidateVolumeHostConnectivityResponse, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) log.Infof("ValidateVolumeHostConnectivity called %+v", req) rep := &podmon.ValidateVolumeHostConnectivityResponse{ Messages: make([]string, 0), @@ -66,7 +66,7 @@ func (s *service) ValidateVolumeHostConnectivity(ctx context.Context, req *podmo // Get cluster config isiConfig, err := s.getIsilonConfig(ctx, &systemID) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v ", err.Error()) return nil, err } @@ -90,7 +90,7 @@ func (s *service) ValidateVolumeHostConnectivity(ctx context.Context, req *podmo } func (s *service) getArrayIDsFromVolumes(ctx context.Context, systemIDs map[string]bool, requestVolumeIDs []string) bool { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) var err error var systemID string var foundAtLeastOne bool @@ -115,7 +115,7 @@ func (s *service) getArrayIDsFromVolumes(ctx context.Context, systemIDs map[stri // checkIfNodeIsConnected looks at the 'nodeId' to determine if there is connectivity to the 'arrayId' array. // The 'rep' object will be filled with the results of the check. func (s *service) checkIfNodeIsConnected(ctx context.Context, arrayID string, nodeID string, rep *podmon.ValidateVolumeHostConnectivityResponse) error { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) log.Infof("Checking if array %s is connected to node %s", arrayID, nodeID) var message string rep.Connected = false diff --git a/service/features/service.feature b/service/features/service.feature index 0dc95497..44935757 100644 --- a/service/features/service.feature +++ b/service/features/service.feature @@ -97,8 +97,8 @@ Feature: Isilon CSI interface Examples: | induced | errormsg | - | "StatsError" | "runid=1 Could not retrieve capacity. Data returned error" | - | "InstancesError" | "runid=1 Could not retrieve capacity. Error retrieving Statistics" | + | "StatsError" | "ReqID=1 Could not retrieve capacity. Data returned error" | + | "InstancesError" | "ReqID=1 Could not retrieve capacity. Error retrieving Statistics" | | "none" | "none" | Scenario: Call NodeGetInfo diff --git a/service/identity.go b/service/identity.go index 74bc6a2d..91c57d22 100644 --- a/service/identity.go +++ b/service/identity.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2019-2023 Dell Inc, or its subsidiaries. +Copyright (c) 2019-2026 Dell Inc, or its subsidiaries. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,10 +21,9 @@ import ( "golang.org/x/net/context" "google.golang.org/protobuf/types/known/wrapperspb" - csi "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/csi-isilon/v2/common/constants" - "github.com/dell/csi-isilon/v2/core" + "github.com/dell/csi-powerscale/v2/common/constants" csiext "github.com/dell/dell-csi-extensions/replication" + csi "github.com/container-storage-interface/spec/lib/go/csi" ) func (s *service) GetPluginInfo( @@ -32,9 +31,11 @@ func (s *service) GetPluginInfo( _ *csi.GetPluginInfoRequest) ( *csi.GetPluginInfoResponse, error, ) { + Manifest["semver"] = ManifestSemver + return &csi.GetPluginInfoResponse{ Name: constants.PluginName, - VendorVersion: core.SemVer, + VendorVersion: ManifestSemver, Manifest: Manifest, }, nil } @@ -78,7 +79,7 @@ func (s *service) Probe( _ *csi.ProbeRequest) ( *csi.ProbeResponse, error, ) { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) ready := new(wrapperspb.BoolValue) ready.Value = true rep := new(csi.ProbeResponse) diff --git a/service/interceptor/interceptor.go b/service/interceptor/interceptor.go index cf11aa82..fd8b9f6d 100644 --- a/service/interceptor/interceptor.go +++ b/service/interceptor/interceptor.go @@ -25,18 +25,19 @@ import ( "sync" "time" + csmlog "github.com/dell/csmlog" + "github.com/dell/gocsi/middleware/serialvolume" "github.com/akutz/gosync" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/gocsi/middleware/serialvolume" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - controller "github.com/dell/csi-isilon/v2/service" + controller "github.com/dell/csi-powerscale/v2/service" csictx "github.com/dell/gocsi/context" mwtypes "github.com/dell/gocsi/middleware/serialvolume/lockprovider" - log "github.com/sirupsen/logrus" + xctx "golang.org/x/net/context" "github.com/dell/csi-metadata-retriever/retriever" @@ -154,6 +155,7 @@ func NewCustomSerialLock() grpc.UnaryServerInterceptor { } func (i *interceptor) createMetadataRetrieverClient(ctx context.Context) { + log := csmlog.GetLogger().WithContext(ctx) metricsManager := metrics.NewCSIMetricsManagerWithOptions("csi-metadata-retriever", metrics.WithProcessStartTime(false), metrics.WithSubsystem(metrics.SubsystemSidecar)) @@ -171,7 +173,7 @@ func (i *interceptor) createMetadataRetrieverClient(ctx context.Context) { i.opts.MetadataSidecarClient = retrieverClient } else { - log.Warn("env var not found: ", "CSI_RETRIEVER_ENDPOINT") + log.Warnf("env var not found: %v", "CSI_RETRIEVER_ENDPOINT") } } @@ -196,6 +198,7 @@ func (i *interceptor) controllerUnpublishVolume(ctx context.Context, req *csi.Co func (i *interceptor) createVolume(ctx context.Context, req *csi.CreateVolumeRequest, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (res interface{}, resErr error) { + log := csmlog.GetLogger().WithContext(ctx) lock, err := i.opts.locker.GetLockWithID(ctx, req.Name) if err != nil { return nil, err diff --git a/service/interceptor/interceptor_test.go b/service/interceptor/interceptor_test.go index 1b0aad08..1d72c0b9 100644 --- a/service/interceptor/interceptor_test.go +++ b/service/interceptor/interceptor_test.go @@ -25,11 +25,11 @@ import ( "testing" "time" - "github.com/akutz/gosync" - "github.com/container-storage-interface/spec/lib/go/csi" - controller "github.com/dell/csi-isilon/v2/service" "github.com/dell/csi-metadata-retriever/retriever" + controller "github.com/dell/csi-powerscale/v2/service" csictx "github.com/dell/gocsi/context" + "github.com/akutz/gosync" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/stretchr/testify/assert" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/service/isiService.go b/service/isiService.go index c9e353b8..896a3979 100644 --- a/service/isiService.go +++ b/service/isiService.go @@ -23,15 +23,14 @@ import ( "strings" "sync" - apiv1 "github.com/dell/goisilon/api/v1" + apiv1 "github.com/dell/gopowerscale/api/v1" - id "github.com/dell/csi-isilon/v2/common/utils/identifiers" - "github.com/dell/csi-isilon/v2/common/utils/logging" - isilonfs "github.com/dell/csi-isilon/v2/common/utils/powerscale-fs" - strutil "github.com/dell/csi-isilon/v2/common/utils/string-utils" + id "github.com/dell/csi-powerscale/v2/common/utils/identifiers" + isilonfs "github.com/dell/csi-powerscale/v2/common/utils/powerscale-fs" + strutil "github.com/dell/csi-powerscale/v2/common/utils/string-utils" - isi "github.com/dell/goisilon" - "github.com/dell/goisilon/api" + isi "github.com/dell/gopowerscale" + "github.com/dell/gopowerscale/api" ) type isiService struct { @@ -40,8 +39,7 @@ type isiService struct { } func (svc *isiService) CopySnapshot(ctx context.Context, isiPath, snapshotSourceVolumeIsiPath string, srcSnapshotID int64, dstVolumeName string, accessZone string) (isi.Volume, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to copy snapshot '%d'", srcSnapshotID) @@ -56,8 +54,7 @@ func (svc *isiService) CopySnapshot(ctx context.Context, isiPath, snapshotSource } func (svc *isiService) CopyVolume(ctx context.Context, isiPath, srcVolumeName, dstVolumeName string) (isi.Volume, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to copy volume '%s'", srcVolumeName) @@ -72,8 +69,7 @@ func (svc *isiService) CopyVolume(ctx context.Context, isiPath, srcVolumeName, d } func (svc *isiService) CreateSnapshot(ctx context.Context, path, snapshotName string) (isi.Snapshot, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to create snapshot '%s'", snapshotName) @@ -88,8 +84,7 @@ func (svc *isiService) CreateSnapshot(ctx context.Context, path, snapshotName st } func (svc *isiService) CreateVolume(ctx context.Context, isiPath, volName, isiVolumePathPermissions string) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to create volume '%s'", volName) @@ -101,8 +96,7 @@ func (svc *isiService) CreateVolume(ctx context.Context, isiPath, volName, isiVo } func (svc *isiService) CreateVolumeWithMetaData(ctx context.Context, isiPath, volName, isiVolumePathPermissions string, metadata map[string]string) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to create volume '%s'", volName) log.Debugf("header metadata '%v'", metadata) @@ -115,8 +109,7 @@ func (svc *isiService) CreateVolumeWithMetaData(ctx context.Context, isiPath, vo } func (svc *isiService) GetExports(ctx context.Context) (isi.ExportList, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debug("begin getting exports for Isilon") @@ -131,8 +124,7 @@ func (svc *isiService) GetExports(ctx context.Context) (isi.ExportList, error) { } func (svc *isiService) GetExportByIDWithZone(ctx context.Context, exportID int, accessZone string) (isi.Export, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting export by id '%d' with access zone '%s' for Isilon", exportID, accessZone) @@ -147,8 +139,7 @@ func (svc *isiService) GetExportByIDWithZone(ctx context.Context, exportID int, } func (svc *isiService) GetExportsCountAttachedToNode(ctx context.Context, nodeip string) (int64, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting export count for nodeip '%s' for Isilon", nodeip) var count int64 @@ -161,8 +152,7 @@ func (svc *isiService) GetExportsCountAttachedToNode(ctx context.Context, nodeip } func (svc *isiService) ExportVolumeWithZone(ctx context.Context, isiPath, volName, accessZone, description string) (int, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to export volume '%s' with access zone '%s' in Isilon path '%s'", volName, accessZone, isiPath) @@ -180,8 +170,7 @@ func (svc *isiService) ExportVolumeWithZone(ctx context.Context, isiPath, volNam } func (svc *isiService) CreateQuota(ctx context.Context, path, volName, softLimit, advisoryLimit, softGracePrd string, sizeInBytes int64, quotaEnabled bool) (string, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to create quota for '%s', size '%d', quota enabled: '%t'", volName, sizeInBytes, quotaEnabled) var softi, advisoryi int64 var err error @@ -264,8 +253,7 @@ func (svc *isiService) CreateQuota(ctx context.Context, path, volName, softLimit } func (svc *isiService) DeleteQuotaByExportIDWithZone(ctx context.Context, volName string, exportID int, accessZone string) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to delete quota for volume name : '%s', export ID : '%d'", volName, exportID) @@ -299,8 +287,7 @@ func (svc *isiService) DeleteQuotaByExportIDWithZone(ctx context.Context, volNam } func (svc *isiService) GetVolumeQuota(ctx context.Context, volName string, exportID int, accessZone string) (isi.Quota, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to get quota for volume name : '%s', export ID : '%d'", volName, exportID) @@ -331,8 +318,7 @@ func (svc *isiService) GetVolumeQuota(ctx context.Context, volName string, expor } func (svc *isiService) UpdateQuotaSize(ctx context.Context, quotaID string, updatedSize, updatedSoftLimit, updatedAdvisoryLimit, softGrace int64) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("updating quota by id '%s' with size '%d'", quotaID, updatedSize) @@ -344,8 +330,7 @@ func (svc *isiService) UpdateQuotaSize(ctx context.Context, quotaID string, upda } func (svc *isiService) UnexportByIDWithZone(ctx context.Context, exportID int, accessZone string) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to unexport NFS export with ID '%d' in access zone '%s'", exportID, accessZone) @@ -357,8 +342,7 @@ func (svc *isiService) UnexportByIDWithZone(ctx context.Context, exportID int, a } func (svc *isiService) GetExportsWithParams(ctx context.Context, params api.OrderedValues) (isi.Exports, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to get exports with params..") var exports isi.Exports @@ -371,8 +355,7 @@ func (svc *isiService) GetExportsWithParams(ctx context.Context, params api.Orde } func (svc *isiService) DeleteVolume(ctx context.Context, isiPath, volName string) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to delete volume directory '%s'", volName) @@ -393,9 +376,6 @@ func (svc *isiService) ClearQuotaByID(ctx context.Context, quotaID string) error } func (svc *isiService) TestConnection(ctx context.Context) error { - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) - log.Debugf("test connection client, user name : '%s'", svc.client.API.User()) if _, err := svc.client.GetClusterConfig(ctx); err != nil { log.Errorf("error encountered, test connection failed : '%v'", err) @@ -412,8 +392,7 @@ func (svc *isiService) GetNFSExportURLForPath(ip string, dirPath string) string } func (svc *isiService) GetVolumeWithIsiPath(ctx context.Context, isiPath, volID, volName string) (isi.Volume, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting volume with id '%s' and name '%s' for Isilon", volID, volName) @@ -428,8 +407,7 @@ func (svc *isiService) GetVolumeWithIsiPath(ctx context.Context, isiPath, volID, } func (svc *isiService) GetVolume(ctx context.Context, volID, volName string) (isi.Volume, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting volume with name '%s' for Isilon", volName) @@ -444,8 +422,7 @@ func (svc *isiService) GetVolume(ctx context.Context, volID, volName string) (is } func (svc *isiService) GetVolumeSize(ctx context.Context, isiPath, name string) int64 { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting volume size with name '%s' for Isilon", name) @@ -459,8 +436,7 @@ func (svc *isiService) GetVolumeSize(ctx context.Context, isiPath, name string) } func (svc *isiService) GetStatistics(ctx context.Context, keys []string) (isi.Stats, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) var stat isi.Stats var err error @@ -472,8 +448,7 @@ func (svc *isiService) GetStatistics(ctx context.Context, keys []string) (isi.St } func (svc *isiService) IsIOInProgress(ctx context.Context) (isi.Clients, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) var clients isi.Clients var err error @@ -485,8 +460,7 @@ func (svc *isiService) IsIOInProgress(ctx context.Context) (isi.Clients, error) } func (svc *isiService) IsVolumeExistent(ctx context.Context, isiPath, volID, name string) bool { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("check if volume (id :'%s', name '%s') already exists", volID, name) @@ -498,8 +472,7 @@ func (svc *isiService) IsVolumeExistent(ctx context.Context, isiPath, volID, nam } func (svc *isiService) OtherClientsAlreadyAdded(ctx context.Context, exportID int, accessZone string, nodeID string) bool { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) export, _ := svc.GetExportByIDWithZone(ctx, exportID, accessZone) @@ -549,7 +522,7 @@ func (svc *isiService) OtherClientsAlreadyAdded(ctx context.Context, exportID in // updateClusterToNodeIDMap updates cluster to nodeID map from input clusterName, nodeID and clientToUse func updateClusterToNodeIDMap(ctx context.Context, clusterToNodeIDMap *sync.Map, clusterName, nodeID, clientToUse string) error { - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("updating ClusterToNodeIDMap map for cluster '%s', for nodeID '%s' with clientToUse '%s'", clusterName, nodeID, clientToUse) var nodeIDToClientMaps []*nodeIDToClientMap @@ -588,7 +561,7 @@ func updateClusterToNodeIDMap(ctx context.Context, clusterToNodeIDMap *sync.Map, // getClientToUseForNodeID returns client to use for an input nodeID from the cluster to nodeID map, if present. // Otherwise returns an error func getClientToUseForNodeID(ctx context.Context, clusterToNodeIDMap *sync.Map, clusterName, nodeID string) (string, error) { - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) var nodeIDToClientMaps []*nodeIDToClientMap @@ -611,8 +584,7 @@ func getClientToUseForNodeID(ctx context.Context, clusterToNodeIDMap *sync.Map, } func (svc *isiService) AddExportClientNetworkIdentifierByIDWithZone(ctx context.Context, clusterName string, exportID int, accessZone, nodeID string, ignoreUnresolvableHosts bool, addClientFunc func(ctx context.Context, exportID int, accessZone, clientIP string, ignoreUnresolvableHosts bool) error) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) var clientToUse string // try adding by client FQDN first as it is preferred over IP for its stableness. @@ -674,8 +646,7 @@ func (svc *isiService) AddExportClientNetworkIdentifierByIDWithZone(ctx context. // It iterates through the list of client IPs and calls the provided addClientFunc for each IP, passing the export ID, // access zone, and client IP as arguments. func (svc *isiService) AddExportClientByIPWithZone(ctx context.Context, clusterName string, exportID int, accessZone, nodeID string, clientIPs []string, addClientFunc func(ctx context.Context, exportID int, accessZone, clientIP string, ignoreUnresolvableHosts bool) error) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) var err error for _, clientIP := range clientIPs { @@ -694,8 +665,7 @@ func (svc *isiService) AddExportClientByIPWithZone(ctx context.Context, clusterN } func (svc *isiService) AddExportClientByIDWithZone(ctx context.Context, exportID int, accessZone, clientIP string, ignoreUnresolvableHosts bool) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("AddExportClientByID client '%s'", clientIP) if err := svc.client.AddExportClientsByIDWithZone(ctx, exportID, accessZone, []string{clientIP}, ignoreUnresolvableHosts); err != nil { @@ -705,8 +675,7 @@ func (svc *isiService) AddExportClientByIDWithZone(ctx context.Context, exportID } func (svc *isiService) AddExportRootClientByIDWithZone(ctx context.Context, exportID int, accessZone, clientIP string, ignoreUnresolvableHosts bool) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("AddExportRootClientByID client '%s'", clientIP) if err := svc.client.AddExportRootClientsByIDWithZone(ctx, exportID, accessZone, []string{clientIP}, ignoreUnresolvableHosts); err != nil { @@ -716,8 +685,7 @@ func (svc *isiService) AddExportRootClientByIDWithZone(ctx context.Context, expo } func (svc *isiService) AddExportReadOnlyClientByIDWithZone(ctx context.Context, exportID int, accessZone, clientIP string, ignoreUnresolvableHosts bool) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("AddExportReadOnlyClientByID client '%s'", clientIP) if err := svc.client.AddExportReadOnlyClientsByIDWithZone(ctx, exportID, accessZone, []string{clientIP}, ignoreUnresolvableHosts); err != nil { @@ -727,8 +695,7 @@ func (svc *isiService) AddExportReadOnlyClientByIDWithZone(ctx context.Context, } func (svc *isiService) RemoveExportClientByIDWithZone(ctx context.Context, exportID int, accessZone, nodeID string, ignoreUnresolvableHosts bool) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) // it could either be IP or FQDN that has been added to the export's client fields, should consider both during the removal clientName, clientFQDN, clientIP, err := id.ParseNodeID(ctx, nodeID) @@ -756,8 +723,7 @@ func (svc *isiService) RemoveExportClientByIDWithZone(ctx context.Context, expor } func (svc *isiService) RemoveExportClientByIPsWithZone(ctx context.Context, exportID int, accessZone string, clientIPs []string, ignoreUnresolvableHosts bool) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) if err := svc.client.RemoveExportClientsByIDWithZone(ctx, exportID, accessZone, clientIPs, ignoreUnresolvableHosts); err != nil { if notFoundErr, ok := err.(*api.JSONError); ok { @@ -773,8 +739,7 @@ func (svc *isiService) RemoveExportClientByIPsWithZone(ctx context.Context, expo } func (svc *isiService) GetExportsWithLimit(ctx context.Context, limit string) (isi.ExportList, string, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debug("begin getting exports for Isilon") var exports isi.Exports @@ -802,8 +767,7 @@ func (svc *isiService) GetExportsWithLimit(ctx context.Context, limit string) (i } */ func (svc *isiService) DeleteSnapshot(ctx context.Context, id int64, name string) error { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin to delete snapshot '%s'", name) if err := svc.client.RemoveSnapshot(ctx, id, name); err != nil { @@ -814,8 +778,7 @@ func (svc *isiService) DeleteSnapshot(ctx context.Context, id int64, name string } func (svc *isiService) GetSnapshot(ctx context.Context, identity string) (isi.Snapshot, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting snapshot with id|name '%s' for Isilon", identity) var snapshot isi.Snapshot @@ -829,8 +792,7 @@ func (svc *isiService) GetSnapshot(ctx context.Context, identity string) (isi.Sn } func (svc *isiService) GetSnapshots(ctx context.Context) (isi.SnapshotList, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting all the snapshot for Isilon") var snapshotList isi.SnapshotList var err error @@ -842,8 +804,7 @@ func (svc *isiService) GetSnapshots(ctx context.Context) (isi.SnapshotList, erro } func (svc *isiService) GetSnapshotSize(ctx context.Context, isiPath, name string, accessZone string) int64 { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting snapshot size with name '%s' for Isilon", name) size, err := svc.client.GetSnapshotFolderSize(ctx, isiPath, name, accessZone) @@ -856,8 +817,7 @@ func (svc *isiService) GetSnapshotSize(ctx context.Context, isiPath, name string } func (svc *isiService) GetExportWithPathAndZone(ctx context.Context, path, accessZone string) (isi.Export, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting export with target path '%s' and access zone '%s' for Isilon", path, accessZone) var export isi.Export @@ -871,8 +831,7 @@ func (svc *isiService) GetExportWithPathAndZone(ctx context.Context, path, acces } func (svc *isiService) GetExportWithPath(ctx context.Context, path string) (isi.Export, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) log.Debugf("begin getting export with target path '%s' for Isilon", path) var export isi.Export @@ -909,8 +868,7 @@ func (svc *isiService) isROVolumeFromSnapshot(exportPath, accessZone string) boo } func (svc *isiService) GetSnapshotNameFromIsiPath(ctx context.Context, snapshotIsiPath, accessZone, zonePath string) (string, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) var snapShotName string if !svc.isROVolumeFromSnapshot(snapshotIsiPath, accessZone) { log.Debugf("invalid snapshot isilon path- '%s'", snapshotIsiPath) @@ -963,9 +921,7 @@ func (svc *isiService) GetSnapshotTrackingDirName(snapshotName string) string { } func (svc *isiService) GetSubDirectoryCount(ctx context.Context, isiPath, directory string) (int64, error) { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) - + log := log.WithContext(ctx) var totalSubDirectories int64 if svc.IsVolumeExistent(ctx, isiPath, "", directory) { // Check if there are any entries for volumes present in snapshot tracking dir @@ -996,8 +952,7 @@ func (svc *isiService) GetSubDirectoryCount(ctx context.Context, isiPath, direct } func (svc *isiService) IsHostAlreadyAdded(ctx context.Context, exportID int, accessZone string, nodeID string) bool { - // Fetch log handler - log := logging.GetRunIDLogger(ctx) + log := log.WithContext(ctx) export, _ := svc.GetExportByIDWithZone(ctx, exportID, accessZone) diff --git a/service/isiService_test.go b/service/isiService_test.go index 89628e02..3a6d7836 100644 --- a/service/isiService_test.go +++ b/service/isiService_test.go @@ -23,12 +23,12 @@ import ( "reflect" "testing" - isi "github.com/dell/goisilon" - "github.com/dell/goisilon/api" - apiv1 "github.com/dell/goisilon/api/v1" - apiv2 "github.com/dell/goisilon/api/v2" - apiv5 "github.com/dell/goisilon/api/v5" - isimocks "github.com/dell/goisilon/mocks" + isi "github.com/dell/gopowerscale" + "github.com/dell/gopowerscale/api" + apiv1 "github.com/dell/gopowerscale/api/v1" + apiv2 "github.com/dell/gopowerscale/api/v2" + apiv5 "github.com/dell/gopowerscale/api/v5" + isimocks "github.com/dell/gopowerscale/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) diff --git a/service/mount.go b/service/mount.go index 6269a452..309bc21b 100644 --- a/service/mount.go +++ b/service/mount.go @@ -23,10 +23,10 @@ import ( "strings" "time" - "github.com/sirupsen/logrus" - - csi "github.com/container-storage-interface/spec/lib/go/csi" + csmlog "github.com/dell/csmlog" "github.com/dell/gofsutil" + csi "github.com/container-storage-interface/spec/lib/go/csi" + "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -63,9 +63,7 @@ var ( req *csi.NodePublishVolumeRequest, nfsExportURL string, ) error { - // Fetch log handler - ctx, log := GetLogger(ctx) - + log := log.WithContext(ctx) volCap := req.GetVolumeCapability() if volCap == nil { return status.Error(codes.InvalidArgument, @@ -105,13 +103,13 @@ var ( mntOptions = append(mntOptions, rwOption) - f := logrus.Fields{ + f := csmlog.Fields{ "ID": req.VolumeId, "TargetPath": target, "ExportPath": nfsExportURL, "AccessMode": accMode.GetMode(), } - logrus.WithFields(f).Info("Node publish volume params ") + log.WithFields(f).Info("Node publish volume params ") mnts, err := getGetMountsFunc()(ctx) if err != nil { return status.Errorf(codes.Internal, @@ -176,9 +174,7 @@ func unpublishVolume( ctx context.Context, req *csi.NodeUnpublishVolumeRequest, filterStr string, ) error { - // Fetch log handler - ctx, log := GetLogger(ctx) - + log := log.WithContext(ctx) target := req.GetTargetPath() if target == "" { return status.Error(codes.InvalidArgument, @@ -212,7 +208,7 @@ func unpublishVolume( // mkdir creates the directory specified by path if needed. // return pair is a bool flag of whether dir was created, and an error func mkdir(ctx context.Context, path string) (bool, error) { - _, log := GetLogger(ctx) + log := log.WithContext(ctx) st, err := os.Stat(path) if err == nil { if !st.IsDir() { @@ -221,17 +217,17 @@ func mkdir(ctx context.Context, path string) (bool, error) { return false, nil } if !errors.Is(err, fs.ErrNotExist) { - log.WithField("dir", path).WithError(err).Error("Unable to stat dir") + log.WithFields(csmlog.Fields{"dir": path}).Errorf("Unable to stat dir : %v", err) return false, err } // Case when there is error and the error is fs.ErrNotExists. if err := os.MkdirAll(path, 0o750); err != nil { - log.WithField("dir", path).WithError(err).Error("Unable to create dir") + log.WithFields(csmlog.Fields{"dir": path}).Errorf("Unable to create dir : %v", err) return false, err } - log.WithField("path", path).Debug("created directory") + log.WithFields(csmlog.Fields{"path": path}).Debug("created directory") return true, nil } @@ -245,9 +241,7 @@ func contains(list []string, item string) bool { } func isVolumeMounted(ctx context.Context, filterStr string, target string) (bool, error) { - // Fetch log handler - ctx, log := GetLogger(ctx) - + log := log.WithContext(ctx) mnts, err := getGetMountsFunc()(ctx) if err != nil { return false, status.Errorf(codes.Internal, diff --git a/service/mount_test.go b/service/mount_test.go index a4c1f877..434f48f9 100644 --- a/service/mount_test.go +++ b/service/mount_test.go @@ -23,8 +23,8 @@ import ( "path/filepath" "testing" - csi "github.com/container-storage-interface/spec/lib/go/csi" "github.com/dell/gofsutil" + csi "github.com/container-storage-interface/spec/lib/go/csi" "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/service/node.go b/service/node.go index 925db85c..3f3f1d88 100644 --- a/service/node.go +++ b/service/node.go @@ -26,14 +26,14 @@ import ( "strings" "time" + "github.com/dell/csi-powerscale/v2/common/constants" + "github.com/dell/csi-powerscale/v2/common/k8sutils" + id "github.com/dell/csi-powerscale/v2/common/utils/identifiers" + + isilonfs "github.com/dell/csi-powerscale/v2/common/utils/powerscale-fs" + csiutils "github.com/dell/csi-powerscale/v2/csi-utils" + csmlog "github.com/dell/csmlog" csi "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/csi-isilon/v2/common/constants" - "github.com/dell/csi-isilon/v2/common/k8sutils" - id "github.com/dell/csi-isilon/v2/common/utils/identifiers" - "github.com/dell/csi-isilon/v2/common/utils/logging" - isilonfs "github.com/dell/csi-isilon/v2/common/utils/powerscale-fs" - csiutils "github.com/dell/csi-isilon/v2/csi-utils" - "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -98,16 +98,17 @@ func (s *service) NodePublishVolume( req *csi.NodePublishVolumeRequest) ( *csi.NodePublishVolumeResponse, error, ) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) // set noProbeOnStart to false so subsequent calls can lead to probe noProbeOnStart = false volumeContext := req.GetVolumeContext() if volumeContext == nil { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "VolumeContext is nil, skip NodePublishVolume")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "VolumeContext is nil, skip NodePublishVolume")) } - logging.LogMap(ctx, "VolumeContext", volumeContext) + LogMap(ctx, "VolumeContext", volumeContext) isEphemeralVolume := volumeContext["csi.storage.k8s.io/ephemeral"] == "true" var clusterName string @@ -124,7 +125,8 @@ func (s *service) NodePublishVolume( return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // Probe the node if required and make sure startup called @@ -139,18 +141,18 @@ func (s *service) NodePublishVolume( path := volumeContext["Path"] if path == "" { - return nil, status.Error(codes.FailedPrecondition, logging.GetMessageWithRunID(runID, "no entry keyed by 'Path' found in VolumeContext of volume id : '%s', name '%s', skip NodePublishVolume", req.GetVolumeId(), volumeContext["name"])) + return nil, status.Error(codes.FailedPrecondition, GetMessageWithReqID(runID, "no entry keyed by 'Path' found in VolumeContext of volume id : '%s', name '%s', skip NodePublishVolume", req.GetVolumeId(), volumeContext["name"])) } volName := volumeContext["Name"] if volName == "" { - return nil, status.Error(codes.FailedPrecondition, logging.GetMessageWithRunID(runID, "no entry keyed by 'Name' found in VolumeContext of volume id : '%s', name '%s', skip NodePublishVolume", req.GetVolumeId(), volumeContext["name"])) + return nil, status.Error(codes.FailedPrecondition, GetMessageWithReqID(runID, "no entry keyed by 'Name' found in VolumeContext of volume id : '%s', name '%s', skip NodePublishVolume", req.GetVolumeId(), volumeContext["name"])) } accessZone := volumeContext["AccessZone"] isROVolumeFromSnapshot := isiConfig.isiSvc.isROVolumeFromSnapshot(path, accessZone) if isROVolumeFromSnapshot { log.Info("Volume source is snapshot") if export, err := isiConfig.isiSvc.GetExportWithPathAndZone(ctx, path, accessZone); err != nil || export == nil { - return nil, status.Error(codes.Internal, logging.GetMessageWithRunID(runID, "error retrieving export for %s", path)) + return nil, status.Error(codes.Internal, GetMessageWithReqID(runID, "error retrieving export for %s", path)) } } else { // Parse the target path and empty volume name to get the volume @@ -177,14 +179,14 @@ func (s *service) NodePublishVolume( azServiceIP = isiConfig.MountEndpoint } - f := map[string]interface{}{ + f := csmlog.Fields{ "ID": req.VolumeId, "Name": volumeContext["Name"], "TargetPath": req.GetTargetPath(), "AzServiceIP": azServiceIP, } // TODO: Replace logrus with log - logrus.WithFields(f).Info("Calling publishVolume") + log.WithFields(f).Info("Calling publishVolume") if err := publishVolume(ctx, req, isiConfig.isiSvc.GetNFSExportURLForPath(azServiceIP, path)); err != nil { return nil, err } @@ -197,15 +199,16 @@ func (s *service) NodeUnpublishVolume( req *csi.NodeUnpublishVolumeRequest) ( *csi.NodeUnpublishVolumeResponse, error, ) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", logFields["csi.requestid"]) log.Debug("executing NodeUnpublishVolume") // set noProbeOnStart to false so subsequent calls can lead to probe noProbeOnStart = false volID := req.GetVolumeId() if volID == "" { - return nil, status.Error(codes.FailedPrecondition, logging.GetMessageWithRunID(runID, "no VolumeID found in request")) + return nil, status.Error(codes.FailedPrecondition, GetMessageWithReqID(runID, "no VolumeID found in request")) } log.Infof("The volume ID fetched from NodeUnPublish req is %s", volID) @@ -216,11 +219,12 @@ func (s *service) NodeUnpublishVolume( isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // Probe the node if required @@ -270,7 +274,7 @@ func (s *service) NodeUnpublishVolume( } if err := unpublishVolume(ctx, req, volName); err != nil { - log.Error("Error while calling Unbuplish Volume", err.Error()) + log.Errorf("Error while calling Unbuplish Volume %v", err.Error()) return nil, err } @@ -278,7 +282,7 @@ func (s *service) NodeUnpublishVolume( req.VolumeId = string(data) err := s.ephemeralNodeUnpublish(ctx, req) if err != nil { - log.Error("Error while calling Ephemeral Node Unpublish", err.Error()) + log.Errorf("Error while calling Ephemeral Node Unpublish %v", err.Error()) return nil, err } } @@ -286,15 +290,15 @@ func (s *service) NodeUnpublishVolume( } func (s *service) nodeProbe(ctx context.Context, isiConfig *IsilonClusterConfig) error { - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) if err := s.validateOptsParameters(isiConfig); err != nil { return fmt.Errorf("node probe failed : '%v'", err) } if isiConfig.isiSvc == nil { - logLevel := logging.GetCurrentLogLevel() + logLevel := csmlog.GetLevel() var err error isiConfig.isiSvc, err = s.GetIsiService(ctx, isiConfig, logLevel) if isiConfig.isiSvc == nil { @@ -309,7 +313,8 @@ func (s *service) nodeProbe(ctx context.Context, isiConfig *IsilonClusterConfig) return fmt.Errorf("node probe failed : '%v'", err) } - ctx, log = setClusterContext(ctx, isiConfig.ClusterName) + logFields[isiConfig.ClusterName] = isiConfig.ClusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debug("node probe succeeded") return nil @@ -361,13 +366,11 @@ func (s *service) NodeGetInfo( _ *csi.NodeGetInfoRequest) ( *csi.NodeGetInfoResponse, error, ) { - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) nodeID, err := s.getPowerScaleNodeID(ctx) log.Infof("Node ID of worker node is '%s'", nodeID) if (err) != nil { - log.Error("Failed to create Node ID with error", err.Error()) + log.Errorf("Failed to create Node ID with error %v", err.Error()) return nil, err } if noProbeOnStart { @@ -415,7 +418,7 @@ func (s *service) NodeGetInfo( var maxIsilonVolumesPerNode int64 labels, err := s.GetNodeLabels() if err != nil { - log.Error("failed to get Node Labels with error", err.Error()) + log.Errorf("failed to get Node Labels with error %v", err.Error()) return nil, err } @@ -448,16 +451,17 @@ func (s *service) NodeGetInfo( func (s *service) NodeGetVolumeStats( ctx context.Context, req *csi.NodeGetVolumeStatsRequest, ) (*csi.NodeGetVolumeStatsResponse, error) { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + fields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", fields["csi.requestid"]) volID := req.GetVolumeId() if volID == "" { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "no VolumeID found in request")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "no VolumeID found in request")) } volPath := req.GetVolumePath() if volPath == "" { - return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "no Volume Path found in request")) + return nil, status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "no Volume Path found in request")) } volName, exportID, accessZone, clusterName, _ := id.ParseNormalizedVolumeID(ctx, volID) @@ -497,7 +501,7 @@ func (s *service) NodeGetVolumeStats( // if we cannot find it there, we check the export isiPathFromParams, err := s.validateIsiPath(ctx, volName) if err != nil { - log.Error("Failed to get isiPath: ", err.Error()) + log.Errorf("Failed to get isiPath %v", err.Error()) // if not in pv or sc, calculate it from the export exportPath, err := getExportPathFromExportID(ctx, isiConfig, exportID, accessZone) if err != nil { @@ -507,38 +511,38 @@ func (s *service) NodeGetVolumeStats( } } if isiPathFromParams != "" { - log.Debug("Found IsiPath from PV/SC/Export: ", isiPathFromParams) + log.Debugf("Found IsiPath from PV/SC/Export: %v ", isiPathFromParams) isiPath = isiPathFromParams // set service to utilize new path isiConfigCopy.IsiPath = isiPath - isiConfigCopy.isiSvc, err = s.GetIsiService(ctx, isiConfigCopy, logging.GetCurrentLogLevel()) + isiConfigCopy.isiSvc, err = s.GetIsiService(ctx, isiConfigCopy, csmlog.GetLevel()) if err != nil { - log.Error("NodeGetVolumeStats: Failed to get isiService: ", err.Error()) + log.Errorf("NodeGetVolumeStats: Failed to get isiService %v ", err.Error()) return nil, err } } // Probe the node if required and make sure startup called - if err := s.autoProbe(ctx, isiConfig); err != nil { + if err := s.autoProbe(ctx, isiConfigCopy); err != nil { log.Error("nodeProbe failed with error :" + err.Error()) return nil, err } isiVol, err := isiConfigCopy.isiSvc.GetVolume(ctx, "", volName) if err != nil || isiVol == nil { - return nil, status.Error(codes.NotFound, logging.GetMessageWithRunID(runID, "volume %v does not exist at path %v", volName, volPath)) + return nil, status.Error(codes.NotFound, GetMessageWithReqID(runID, "volume %v does not exist at path %v", volName, volPath)) } // check whether the original volume is mounted isMounted, _ := getIsVolumeMounted(ctx, volName, volPath) if !isMounted { - return nil, status.Error(codes.NotFound, logging.GetMessageWithRunID(runID, "no volume is mounted at path: %s", volPath)) + return nil, status.Error(codes.NotFound, GetMessageWithReqID(runID, "no volume is mounted at path: %s", volPath)) } // check whether volume path is accessible _, err = getOsReadDir(volPath) if err != nil { - return nil, status.Error(codes.NotFound, logging.GetMessageWithRunID(runID, "volume path is not accessible: %s", err)) + return nil, status.Error(codes.NotFound, GetMessageWithReqID(runID, "volume path is not accessible: %s", err)) } // Get Volume stats metrics @@ -583,9 +587,7 @@ func (s *service) NodeGetVolumeStats( } func (s *service) ephemeralNodePublish(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) log.Info("Received request to node publish Ephemeral Volume..") volID := req.GetVolumeId() @@ -732,14 +734,15 @@ func (s *service) ephemeralNodeUnpublish( var ephemeralNodeUnpublishFunc = func(s *service, ctx context.Context, req *csi.NodeUnpublishVolumeRequest, ) error { - // Fetch log handler - ctx, log, runID := GetRunIDLog(ctx) + log := log.WithContext(ctx) + fields := csmlog.ExtractFieldsFromContext(ctx) + runID := fmt.Sprintf("%v", fields["csi.requestid"]) log.Infof("Request received for Ephemeral NodeUnpublish..") volumeID := req.GetVolumeId() log.Infof("The volID is %s", volumeID) if volumeID == "" { - return status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "volume ID is required")) + return status.Error(codes.InvalidArgument, GetMessageWithReqID(runID, "volume ID is required")) } nodeID, nodeIDErr := s.getPowerScaleNodeID(ctx) @@ -786,8 +789,7 @@ func (s *service) getPowerScaleNodeID(ctx context.Context) (string, error) { var nodeIP string var err error - // Fetch log handler - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) // When valid list of allowedNetworks is being given as part of values.yaml, we need // to fetch first IP from matching network @@ -795,7 +797,7 @@ func (s *service) getPowerScaleNodeID(ctx context.Context) (string, error) { log.Debugf("Fetching IP address of custom network for NFS I/O traffic") nodeIP, err = csiutils.GetNFSClientIP(s.opts.allowedNetworks) if err != nil { - log.Error("Failed to find IP address corresponding to the allowed network with error", err.Error()) + log.Errorf("Failed to find IP address corresponding to the allowed network with error %v", err.Error()) return "", err } } else { @@ -822,8 +824,7 @@ func (s *service) getPowerScaleNodeID(ctx context.Context) (string, error) { } func (s *service) ReconcileNodeAzLabels(ctx context.Context) error { - ctx, log, _ := GetRunIDLog(ctx) - + log := log.WithContext(ctx) addrs, err := getInterfaceAddrsFunc()() if err != nil { log.Errorf("could not get network interface addresses: '%v'", err.Error()) @@ -850,7 +851,7 @@ func (s *service) ReconcileNodeAzLabels(ctx context.Context) error { labels, err := getNodeLabelsFunc(s)() if err != nil { - log.Error("failed to get node labels", err.Error()) + log.Errorf("failed to get node labels %v", err.Error()) } labelsToRemove := make([]string, 0) @@ -865,7 +866,7 @@ func (s *service) ReconcileNodeAzLabels(ctx context.Context) error { if nodeLabelsNeedPatching(labels, labelsToAdd, labelsToRemove) { err = getPatchNodeLabelsFunc(s)(labelsToAdd, labelsToRemove) if err != nil { - log.Error("failed to patch node labels", err.Error()) + log.Errorf("failed to patch node labels %v", err.Error()) return err } log.Debugf("reconciled node network labels, added: %v, removed: %v", labelsToAdd, labelsToRemove) diff --git a/service/nodeConnectivityChecker.go b/service/nodeConnectivityChecker.go index 55670799..4dd8cc0f 100644 --- a/service/nodeConnectivityChecker.go +++ b/service/nodeConnectivityChecker.go @@ -25,10 +25,9 @@ import ( "sync" "time" - "github.com/dell/csi-isilon/v2/common/constants" - fromctx "github.com/dell/csi-isilon/v2/common/utils/fromcontext" + "github.com/dell/csi-powerscale/v2/common/constants" + fromctx "github.com/dell/csi-powerscale/v2/common/utils/fromcontext" "github.com/gorilla/mux" - log "github.com/sirupsen/logrus" ) const ( @@ -55,6 +54,7 @@ type ArrayConnectivityStatus struct { } func setAPIPort(ctx context.Context) { + log := log.WithContext(ctx) port := fromctx.GetUint(ctx, constants.EnvPodmonAPIPORT) if port == 0 { // If the port number cannot be fetched, set it to default @@ -68,6 +68,7 @@ func setAPIPort(ctx context.Context) { // reads the pollingFrequency from Env, sets default if not found func setPollingFrequency(ctx context.Context) int64 { + log := log.WithContext(ctx) pollRate, err := fromctx.GetInt64(ctx, constants.EnvPodmonArrayConnectivityPollRate) if err != nil || pollRate == 0 { log.Debugf("use default pollingFrequency %d seconds, err %v", constants.DefaultPodmonPollRate, err) @@ -93,6 +94,7 @@ var MarshalSyncMapToJSON = func(m *sync.Map) ([]byte, error) { // startAPIService reads nodes to array status periodically func (s *service) startAPIService(ctx context.Context) { + log := log.WithContext(ctx) isPodmonEnabled := fromctx.GetBoolean(ctx, constants.EnvPodmonEnabled) if !isPodmonEnabled { log.Info("podmon is not enabled") @@ -194,6 +196,7 @@ func connectivityStatus(w http.ResponseWriter, _ *http.Request) { // startNodeToArrayConnectivityCheck starts connectivityTest as one goroutine for each cluster func (s *service) startNodeToArrayConnectivityCheck(ctx context.Context) { + log := log.WithContext(ctx) log.Debug("startNodeToArrayConnectivityCheck called") probeStatus = new(sync.Map) isilonClusters := s.getIsilonClusters() @@ -207,6 +210,7 @@ func (s *service) startNodeToArrayConnectivityCheck(ctx context.Context) { // testConnectivityAndUpdateStatus runs probe to test connectivity from node to array // updates probeStatus map[array]ArrayConnectivityStatus func (s *service) testConnectivityAndUpdateStatus(ctx context.Context, cluster *IsilonClusterConfig, timeout time.Duration) { + log := log.WithContext(ctx) defer func() { if err := recover(); err != nil { log.Errorf("panic occurred in testConnectivityAndUpdateStatus:%s for clsuter %s", err, cluster) diff --git a/service/nodeConnectivityChecker_test.go b/service/nodeConnectivityChecker_test.go index 41ba878c..9c80d949 100644 --- a/service/nodeConnectivityChecker_test.go +++ b/service/nodeConnectivityChecker_test.go @@ -28,7 +28,7 @@ import ( "testing" "time" - "github.com/dell/csi-isilon/v2/common/constants" + "github.com/dell/csi-powerscale/v2/common/constants" "github.com/gorilla/mux" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/service/node_test.go b/service/node_test.go index a51a140c..5e9d5d61 100644 --- a/service/node_test.go +++ b/service/node_test.go @@ -27,11 +27,11 @@ import ( "sync" "testing" + isi "github.com/dell/gopowerscale" + v1 "github.com/dell/gopowerscale/api/v1" + v2 "github.com/dell/gopowerscale/api/v2" + isimocks "github.com/dell/gopowerscale/mocks" "github.com/container-storage-interface/spec/lib/go/csi" - isi "github.com/dell/goisilon" - v1 "github.com/dell/goisilon/api/v1" - v2 "github.com/dell/goisilon/api/v2" - isimocks "github.com/dell/goisilon/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "golang.org/x/net/context" @@ -144,7 +144,7 @@ func TestNodeGetVolumeStats(t *testing.T) { mockClient.On("VolumesPath").Return("/path/to/volumes") mockClient.On( "Get", - mock.AnythingOfType("*context.valueCtx"), + mock.AnythingOfType("context.backgroundCtx"), "platform/2/protocols/nfs/exports", mock.AnythingOfType("string"), mock.AnythingOfType("api.OrderedValues"), @@ -157,7 +157,7 @@ func TestNodeGetVolumeStats(t *testing.T) { mockClient.On( "Get", - mock.AnythingOfType("*context.valueCtx"), + mock.AnythingOfType("context.backgroundCtx"), "namespace/path/to/volumes", "volume-id", mock.AnythingOfType("api.OrderedValues"), diff --git a/service/replication.go b/service/replication.go index 672998b8..ab869b92 100644 --- a/service/replication.go +++ b/service/replication.go @@ -23,13 +23,14 @@ import ( "strings" "time" - id "github.com/dell/csi-isilon/v2/common/utils/identifiers" - isilonfs "github.com/dell/csi-isilon/v2/common/utils/powerscale-fs" + id "github.com/dell/csi-powerscale/v2/common/utils/identifiers" + isilonfs "github.com/dell/csi-powerscale/v2/common/utils/powerscale-fs" csiext "github.com/dell/dell-csi-extensions/replication" - isi "github.com/dell/goisilon" - isiApi "github.com/dell/goisilon/api" - v11 "github.com/dell/goisilon/api/v11" - "github.com/sirupsen/logrus" + isi "github.com/dell/gopowerscale" + isiApi "github.com/dell/gopowerscale/api" + v11 "github.com/dell/gopowerscale/api/v11" + + csmlog "github.com/dell/csmlog" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -46,7 +47,8 @@ const ( func (s *service) CreateRemoteVolume(ctx context.Context, req *csiext.CreateRemoteVolumeRequest, ) (*csiext.CreateRemoteVolumeResponse, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) volID := req.GetVolumeHandle() if volID == "" { @@ -58,12 +60,12 @@ func (s *service) CreateRemoteVolume(ctx context.Context, return nil, status.Error(codes.NotFound, err.Error()) } - log.Info("volume name", volName) - log.Info("export ID", exportID) + log.Infof("volume name : %s", volName) + log.Infof("export ID : %v", exportID) isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v ", err.Error()) return nil, err } @@ -74,11 +76,12 @@ func (s *service) CreateRemoteVolume(ctx context.Context, remoteIsiConfig, err := s.getIsilonConfig(ctx, &remoteClusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, status.Errorf(codes.InvalidArgument, "can't find cluster with name %s in driver config", remoteClusterName) } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // auto probe @@ -123,7 +126,7 @@ func (s *service) CreateRemoteVolume(ctx context.Context, if sourceQuota != nil { volumeSize = sourceQuota.Thresholds.Hard } - log.Info("Volume size: ", volumeSize) + log.Infof("Volume size: %v", volumeSize) remoteAccessZone, ok := req.Parameters[s.WithRP(KeyReplicationRemoteAccessZone)] if !ok { @@ -145,7 +148,7 @@ func (s *service) CreateRemoteVolume(ctx context.Context, log.Info("Remote export doesn't exist, create it") var quotaID string quota, err := remoteIsiConfig.isiSvc.client.GetQuotaWithPath(ctx, exportPath) - log.Info("Get quota", quota) + log.Infof("Get quota : %v", quota) if err != nil { if strings.Contains(err.Error(), "not found:") { log.Info("Remote quota doesn't exist, create it") @@ -173,7 +176,7 @@ func (s *service) CreateRemoteVolume(ctx context.Context, break } time.Sleep(RetrySleepTime) - log.Printf("Begin to retry '%d' time(s), for export id '%d' and path '%s'\n", i+1, remoteExportID, exportPath) + log.Infof("Begin to retry '%d' time(s), for export id '%d' and path '%s'\n", i+1, remoteExportID, exportPath) } } else { return nil, status.Errorf(codes.Internal, "failed to create export: %s", err.Error()) @@ -213,7 +216,7 @@ func (s *service) CreateRemoteVolume(ctx context.Context, volumeContext[AzNetwork] = remoteAzNetwork } - log.Println(volumeContext) + log.Infof("Volume Context : %v", volumeContext) remoteVolume.VolumeContext = volumeContext return &csiext.CreateRemoteVolumeResponse{ @@ -224,7 +227,8 @@ func (s *service) CreateRemoteVolume(ctx context.Context, func (s *service) CreateStorageProtectionGroup(ctx context.Context, req *csiext.CreateStorageProtectionGroupRequest, ) (*csiext.CreateStorageProtectionGroupResponse, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) volID := req.GetVolumeHandle() if volID == "" { @@ -236,12 +240,12 @@ func (s *service) CreateStorageProtectionGroup(ctx context.Context, return nil, status.Error(codes.NotFound, err.Error()) } - log.Info("volume name", volName) - log.Info("export ID", exportID) + log.Infof("volume name : %s", volName) + log.Infof("export ID : %v", exportID) isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v ", err.Error()) return nil, err } @@ -252,11 +256,12 @@ func (s *service) CreateStorageProtectionGroup(ctx context.Context, remoteIsiConfig, err := s.getIsilonConfig(ctx, &remoteClusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, status.Errorf(codes.InvalidArgument, "can't find cluster with name %s in driver config", remoteClusterName) } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // auto probe @@ -326,7 +331,9 @@ func (s *service) CreateStorageProtectionGroup(ctx context.Context, func (s *service) DeleteLocalVolume(ctx context.Context, req *csiext.DeleteLocalVolumeRequest, ) (*csiext.DeleteLocalVolumeResponse, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) + logFields := csmlog.ExtractFieldsFromContext(ctx) + volumeID := req.GetVolumeHandle() log.Infof("Deleting export for volume %s per request from remote replication controller", volumeID) @@ -339,11 +346,12 @@ func (s *service) DeleteLocalVolume(ctx context.Context, isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } - ctx, log = setClusterContext(ctx, clusterName) + logFields[clusterName] = clusterName + ctx = csmlog.SetLogFields(ctx, logFields) log.Debugf("Cluster Name: %v", clusterName) // Ideally the remote directory would be gone due to sync event but the sync may take longer if the policy has greater RPO. @@ -380,7 +388,7 @@ func (s *service) DeleteLocalVolume(ctx context.Context, func (s *service) DeleteStorageProtectionGroup(ctx context.Context, req *csiext.DeleteStorageProtectionGroupRequest, ) (*csiext.DeleteStorageProtectionGroupResponse, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) localParams := req.GetProtectionGroupAttributes() groupID := req.GetProtectionGroupId() isiPath := isilonfs.GetIsiPathFromPgID(groupID) // includes both replication IsiPath AND replication directory name @@ -402,7 +410,7 @@ func (s *service) DeleteStorageProtectionGroup(ctx context.Context, isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, err } @@ -441,7 +449,7 @@ func (s *service) DeleteStorageProtectionGroup(ctx context.Context, if policy != nil { err = isiConfig.isiSvc.client.SyncPolicy(ctx, ppName) if err != nil { - log.Error("Failed to sync before deletion ", err.Error()) + log.Errorf("Failed to sync before deletion %v", err.Error()) } err = isiConfig.isiSvc.client.DeletePolicy(ctx, ppName) @@ -473,7 +481,7 @@ func (s *service) DeleteStorageProtectionGroup(ctx context.Context, } func (s *service) ExecuteAction(ctx context.Context, req *csiext.ExecuteActionRequest) (*csiext.ExecuteActionResponse, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) var reqID string localParams := req.GetProtectionGroupAttributes() @@ -488,7 +496,7 @@ func (s *service) ExecuteAction(ctx context.Context, req *csiext.ExecuteActionRe isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, status.Errorf(codes.InvalidArgument, "can't find cluster with name %s in driver config: %s", clusterName, err.Error()) } @@ -500,7 +508,7 @@ func (s *service) ExecuteAction(ctx context.Context, req *csiext.ExecuteActionRe remoteIsiConfig, err := s.getIsilonConfig(ctx, &remoteClusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, status.Errorf(codes.InvalidArgument, "can't find cluster with name %s in driver config: %s", remoteClusterName, err.Error()) } @@ -528,7 +536,7 @@ func (s *service) ExecuteAction(ctx context.Context, req *csiext.ExecuteActionRe } log.WithFields(fields).Info("Executing ExecuteAction with following fields") - var actionFunc func(context.Context, *IsilonClusterConfig, *IsilonClusterConfig, string, *logrus.Entry) error + var actionFunc func(context.Context, *IsilonClusterConfig, *IsilonClusterConfig, string, *csmlog.CsmLog) error switch action { case csiext.ActionTypes_FAILOVER_REMOTE.String(): // FAILOVER_LOCAL is not supported. Need to handle failover steps in the mirrored perspective. @@ -574,7 +582,7 @@ func (s *service) ExecuteAction(ctx context.Context, req *csiext.ExecuteActionRe } func (s *service) GetStorageProtectionGroupStatus(ctx context.Context, req *csiext.GetStorageProtectionGroupStatusRequest) (*csiext.GetStorageProtectionGroupStatusResponse, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) log.Info("Getting storage protection group status") localParams := req.GetProtectionGroupAttributes() @@ -586,7 +594,7 @@ func (s *service) GetStorageProtectionGroupStatus(ctx context.Context, req *csie isiConfig, err := s.getIsilonConfig(ctx, &clusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, status.Errorf(codes.InvalidArgument, "can't find cluster with name %s in driver config: %s", clusterName, err.Error()) } @@ -597,7 +605,7 @@ func (s *service) GetStorageProtectionGroupStatus(ctx context.Context, req *csie remoteIsiConfig, err := s.getIsilonConfig(ctx, &remoteClusterName) if err != nil { - log.Error("Failed to get Isilon config with error ", err.Error()) + log.Errorf("Failed to get Isilon config with error %v", err.Error()) return nil, status.Errorf(codes.InvalidArgument, "can't find cluster with name %s in driver config: %s", remoteClusterName, err.Error()) } @@ -611,25 +619,25 @@ func (s *service) GetStorageProtectionGroupStatus(ctx context.Context, req *csie // obtain local policy for local cluster localP, err := isiConfig.isiSvc.client.GetPolicyByName(ctx, ppName) if err != nil { - log.Warn("Can't find local replication policy on local cluster, unexpected error ", err.Error()) + log.Warnf("Can't find local replication policy on local cluster, unexpected error %v", err.Error()) } // obtain target policy for local cluster localTP, err := isiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) if err != nil { - log.Warn("Can't find target replication policy on local cluster, unexpected error ", err.Error()) + log.Warnf("Can't find target replication policy on local cluster, unexpected error %v", err.Error()) } // obtain local policy for remote cluster remoteP, err := remoteIsiConfig.isiSvc.client.GetPolicyByName(ctx, ppName) if err != nil { - log.Warn("Can't find local replication policy on remote cluster, unexpected error ", err.Error()) + log.Warnf("Can't find local replication policy on remote cluster, unexpected error %v", err.Error()) } // obtain target policy for remote cluster remoteTP, err := remoteIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) if err != nil { - log.Warn("Can't find target replication policy on remote cluster, unexpected error ", err.Error()) + log.Warnf("Can't find target replication policy on remote cluster, unexpected error %v", err.Error()) } // Check if any of the policy jobs are currently running @@ -637,7 +645,7 @@ func (s *service) GetStorageProtectionGroupStatus(ctx context.Context, req *csie localJob, err := isiConfig.isiSvc.client.GetJobsByPolicyName(ctx, ppName) if err != nil { if apiErr, ok := err.(*isiApi.JSONError); ok && apiErr.StatusCode != 404 { - log.Warn("Unexpected error while querying active jobs for local policy ", err.Error()) + log.Warnf("Unexpected error while querying active jobs for local policy %v", err.Error()) isSyncCheckFailed = true } } @@ -650,7 +658,7 @@ func (s *service) GetStorageProtectionGroupStatus(ctx context.Context, req *csie remoteJob, err := remoteIsiConfig.isiSvc.client.GetJobsByPolicyName(ctx, ppName) if err != nil { if apiErr, ok := err.(*isiApi.JSONError); ok && apiErr.StatusCode != 404 { - log.Warn("Unexpected error while querying active jobs for remote policy ", err.Error()) + log.Warnf("Unexpected error while querying active jobs for remote policy %v", err.Error()) isSyncCheckFailed = true } } @@ -695,7 +703,7 @@ func (s *service) GetStorageProtectionGroupStatus(ctx context.Context, req *csie return resp, nil } -func failover(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func failover(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running failover action") ppName := strings.ReplaceAll(vgName, ".", "-") @@ -727,7 +735,7 @@ func failover(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIs return nil } -func failoverUnplanned(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func failoverUnplanned(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running unplanned failover action") // With unplanned failover -- do minimum requests, we will ensure mirrored policy is created in further reprotect call // We can't use remote config (source site) because we need to assume it's down @@ -743,7 +751,7 @@ func failoverUnplanned(ctx context.Context, localIsiConfig *IsilonClusterConfig, return nil } -func reprotect(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func reprotect(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running reprotect action") ppName := strings.ReplaceAll(vgName, ".", "-") @@ -791,7 +799,7 @@ func reprotect(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteI return nil } -func failbackDiscardLocal(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func failbackDiscardLocal(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running failback action - discard local") ppName := strings.ReplaceAll(vgName, ".", "-") ppNameMirror := ppName + "_mirror" @@ -885,7 +893,7 @@ func failbackDiscardLocal(ctx context.Context, localIsiConfig *IsilonClusterConf return nil } -func failbackDiscardRemote(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func failbackDiscardRemote(ctx context.Context, localIsiConfig *IsilonClusterConfig, remoteIsiConfig *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running failback action - discard remote") ppName := strings.ReplaceAll(vgName, ".", "-") @@ -934,7 +942,7 @@ func failbackDiscardRemote(ctx context.Context, localIsiConfig *IsilonClusterCon return nil } -func synchronize(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func synchronize(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running sync action") // get all running // if running - wait for it and succeed @@ -949,7 +957,7 @@ func synchronize(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *Is return nil } -func suspend(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func suspend(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running suspend action") ppName := strings.ReplaceAll(vgName, ".", "-") @@ -969,7 +977,7 @@ func suspend(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *Isilon return nil } -func resume(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *logrus.Entry) error { +func resume(ctx context.Context, localIsiConfig *IsilonClusterConfig, _ *IsilonClusterConfig, vgName string, log *csmlog.CsmLog) error { log.Info("Running resume action") ppName := strings.ReplaceAll(vgName, ".", "-") diff --git a/service/replication_test.go b/service/replication_test.go index 5a383ff1..048a6fef 100644 --- a/service/replication_test.go +++ b/service/replication_test.go @@ -22,11 +22,12 @@ import ( "reflect" "testing" + csmlog "github.com/dell/csmlog" csiext "github.com/dell/dell-csi-extensions/replication" - isi "github.com/dell/goisilon" - v11 "github.com/dell/goisilon/api/v11" - "github.com/dell/goisilon/mocks" - "github.com/sirupsen/logrus" + isi "github.com/dell/gopowerscale" + v11 "github.com/dell/gopowerscale/api/v11" + "github.com/dell/gopowerscale/mocks" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) @@ -215,7 +216,7 @@ func Test_failbackDiscardLocal(t *testing.T) { t.Run(tt.name, func(t *testing.T) { localIsiConfig, remoteIsiConfig := setUpSvcForFailbackDiscardLocal(tt.failStep) - err := failbackDiscardLocal(context.Background(), localIsiConfig, remoteIsiConfig, "vgstest-Five_Minutes", logrus.NewEntry(logrus.New())) + err := failbackDiscardLocal(context.Background(), localIsiConfig, remoteIsiConfig, "vgstest-Five_Minutes", log.WithContext(context.Background())) if tt.wantErr == "" { assert.NoError(t, err) } else { @@ -249,7 +250,7 @@ func Test_synchronize(t *testing.T) { // Negative case - when policy sync failed svc.client.API.(*MockClient).On("Get", anyArgs...).Return(errors.New("policy sync failed")).Run(nil).Times(1) - err := synchronize(context.Background(), localIsiConfig, remoteIsiConfig, ppName, logrus.NewEntry(logrus.New())) + err := synchronize(context.Background(), localIsiConfig, remoteIsiConfig, ppName, log.WithContext(context.Background())) assert.Error(t, err) // Positive cases @@ -305,7 +306,7 @@ func Test_synchronize(t *testing.T) { } }).Times(1) - err = synchronize(context.Background(), localIsiConfig, remoteIsiConfig, ppName, logrus.NewEntry(logrus.New())) + err = synchronize(context.Background(), localIsiConfig, remoteIsiConfig, ppName, log.WithContext(context.Background())) assert.NoError(t, err) } @@ -333,7 +334,7 @@ func Test_suspend(t *testing.T) { // Negative case - can't disable local policy svc.client.API.(*MockClient).On("Get", anyArgs...).Return(errors.New("can't disable local policy")).Run(nil).Times(1) - err := suspend(context.Background(), localIsiConfig, remoteIsiConfig, ppName, logrus.NewEntry(logrus.New())) + err := suspend(context.Background(), localIsiConfig, remoteIsiConfig, ppName, log.WithContext(context.Background())) assert.Error(t, err) // Negative case - policy couldn't reach disabled condition @@ -351,7 +352,7 @@ func Test_suspend(t *testing.T) { }).Times(1) svc.client.API.(*MockClient).On("Get", anyArgs...).Return(errors.New("policy couldn't reach disabled condition")).Run(nil).Times(1) - err = suspend(context.Background(), localIsiConfig, remoteIsiConfig, ppName, logrus.NewEntry(logrus.New())) + err = suspend(context.Background(), localIsiConfig, remoteIsiConfig, ppName, log.WithContext(context.Background())) assert.Error(t, err) // Positive cases @@ -368,7 +369,7 @@ func Test_suspend(t *testing.T) { } }).Times(2) - err = suspend(context.Background(), localIsiConfig, remoteIsiConfig, ppName, logrus.NewEntry(logrus.New())) + err = suspend(context.Background(), localIsiConfig, remoteIsiConfig, ppName, log.WithContext(context.Background())) assert.NoError(t, err) } @@ -433,7 +434,7 @@ func Test_failbackDiscardRemote(t *testing.T) { } }).Times(2) - err := failbackDiscardRemote(context.Background(), localIsiConfig, remoteIsiConfig, "vgstest-Five_Minutes", logrus.NewEntry(logrus.New())) + err := failbackDiscardRemote(context.Background(), localIsiConfig, remoteIsiConfig, "vgstest-Five_Minutes", log.WithContext(context.Background())) assert.NoError(t, err) } @@ -633,7 +634,7 @@ func Test_reprotect(t *testing.T) { localIsiConfig *IsilonClusterConfig remoteIsiConfig *IsilonClusterConfig vgName string - log *logrus.Entry + log *csmlog.CsmLog } tests := []struct { name string @@ -654,7 +655,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) @@ -678,7 +679,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) @@ -711,7 +712,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) @@ -747,7 +748,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) @@ -799,7 +800,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) @@ -855,7 +856,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) @@ -915,7 +916,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) @@ -988,7 +989,7 @@ func Test_reprotect(t *testing.T) { isiSvc: remoteSvc, }, vgName: "csi-vg-test", - log: logrus.NewEntry(logrus.New()), + log: log.WithContext(context.Background()), }, setMocks: func() { // mocks function: localIsiConfig.isiSvc.client.GetTargetPolicyByName(ctx, ppName) diff --git a/service/service.go b/service/service.go index 5a0025e4..661f3cec 100644 --- a/service/service.go +++ b/service/service.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2019-2025 Dell Inc, or its subsidiaries. +Copyright (c) 2019-2026 Dell Inc, or its subsidiaries. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,32 +26,31 @@ import ( "runtime" "strings" "sync" - "sync/atomic" "time" - "github.com/akutz/gournal" - "github.com/dell/csi-isilon/v2/common/k8sutils" - isilonfs "github.com/dell/csi-isilon/v2/common/utils/powerscale-fs" + "github.com/dell/csi-powerscale/v2/common/k8sutils" + isilonfs "github.com/dell/csi-powerscale/v2/common/utils/powerscale-fs" + "google.golang.org/grpc" - "google.golang.org/grpc/metadata" "google.golang.org/protobuf/types/known/wrapperspb" "gopkg.in/yaml.v3" - csi "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/dell/csi-isilon/v2/common/constants" - fromctx "github.com/dell/csi-isilon/v2/common/utils/fromcontext" - id "github.com/dell/csi-isilon/v2/common/utils/identifiers" - "github.com/dell/csi-isilon/v2/common/utils/logging" - "github.com/dell/csi-isilon/v2/core" + "github.com/dell/csi-powerscale/v2/common/constants" + fromctx "github.com/dell/csi-powerscale/v2/common/utils/fromcontext" + id "github.com/dell/csi-powerscale/v2/common/utils/identifiers" + + "github.com/dell/csi-powerscale/v2/core" commonext "github.com/dell/dell-csi-extensions/common" podmon "github.com/dell/dell-csi-extensions/podmon" csiext "github.com/dell/dell-csi-extensions/replication" vgsext "github.com/dell/dell-csi-extensions/volumeGroupSnapshot" "github.com/dell/gocsi" csictx "github.com/dell/gocsi/context" - isi "github.com/dell/goisilon" + isi "github.com/dell/gopowerscale" + csi "github.com/container-storage-interface/spec/lib/go/csi" "github.com/fsnotify/fsnotify" - "github.com/sirupsen/logrus" + + csmlog "github.com/dell/csmlog" "github.com/spf13/viper" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -64,17 +63,18 @@ import ( var ( // To maintain runid for Non debug mode. Note: CSI will not generate runid if CSI_DEBUG=false - runid int64 isilonConfigFile string // DriverConfigParamsFile is the name of the input driver config params file DriverConfigParamsFile string - updateMutex sync.Mutex - Manifest = map[string]string{ - "url": "http://github.com/dell/csi-isilon", - "semver": core.SemVer, - "commit": core.CommitSha32, + + // Update when the manifest version changes. + ManifestSemver string + + Manifest = map[string]string{ + "semver": ManifestSemver, "formed": core.CommitTime.Format(time.RFC1123), } + noProbeOnStart bool newIsiClientWithArgsFunc = isi.NewClientWithArgs @@ -90,7 +90,7 @@ type Service interface { } type azNetworkLabels interface { - setAzReconcileInterval(log *logrus.Logger, v *viper.Viper) + setAzReconcileInterval(log *csmlog.CsmLog, v *viper.Viper) getReconcileInterval() time.Duration getUpdateIntervalChannel() <-chan time.Duration ReconcileNodeAzLabels(ctx context.Context) error @@ -175,7 +175,7 @@ func New() Service { } func (s *service) initializeServiceOpts(ctx context.Context) error { - log := logging.GetLogger() + log := log.WithContext(ctx) // Get the SP's operating mode. s.mode = csictx.Getenv(ctx, gocsi.EnvVarMode) @@ -323,7 +323,7 @@ func (s *service) ValidateDeleteVolumeRequest(ctx context.Context, func (s *service) probeAllClusters(ctx context.Context) error { isilonClusters := s.getIsilonClusters() - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) probeSuccessCount := 0 for i := range isilonClusters { @@ -343,7 +343,7 @@ func (s *service) probeAllClusters(ctx context.Context) error { } func (s *service) probe(ctx context.Context, clusterConfig *IsilonClusterConfig) error { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) log.Debugf("calling probe for cluster '%s'", clusterConfig.ClusterName) // Do a controller probe if strings.EqualFold(s.mode, constants.ModeController) { @@ -374,7 +374,7 @@ func (s *service) probe(ctx context.Context, clusterConfig *IsilonClusterConfig) } func (s *service) probeOnStart(ctx context.Context) error { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) if noProbeOnStart { log.Debugf("noProbeOnStart is true , skip probe") return nil @@ -384,7 +384,7 @@ func (s *service) probeOnStart(ctx context.Context) error { } func (s *service) setNoProbeOnStart(ctx context.Context) { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) if fromctx.GetBoolean(ctx, constants.EnvNoProbeOnStart) { log.Debug("X_CSI_ISI_NO_PROBE_ON_START is true, set noProbeOnStart to true") noProbeOnStart = true @@ -395,7 +395,7 @@ func (s *service) setNoProbeOnStart(ctx context.Context) { } func (s *service) autoProbe(ctx context.Context, isiConfig *IsilonClusterConfig) error { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) if isiConfig.isiSvc != nil { log.Debug("isiSvc already initialized, skip probing") return nil @@ -410,8 +410,8 @@ func (s *service) autoProbe(ctx context.Context, isiConfig *IsilonClusterConfig) return s.probe(ctx, isiConfig) } -func (s *service) GetIsiClient(clientCtx context.Context, isiConfig *IsilonClusterConfig, logLevel logrus.Level) (*isi.Client, error) { - clientCtx, log := GetLogger(clientCtx) +func (s *service) GetIsiClient(clientCtx context.Context, isiConfig *IsilonClusterConfig, _ csmlog.Level) (*isi.Client, error) { + log := log.WithContext(clientCtx) // First we fetch node labels using kubernetes API and check, if label // .dellemc.com/: @@ -448,24 +448,6 @@ func (s *service) GetIsiClient(clientCtx context.Context, isiConfig *IsilonClust log.Errorf("init client failed for custom topology") return nil, errors.New("init client failed for custom topology") } - - if logLevel == logrus.DebugLevel { - clientCtx = context.WithValue( - clientCtx, - gournal.LevelKey(), - gournal.DebugLevel) - - gournal.DefaultLevel = gournal.DebugLevel - } else { - gournalLevel := getGournalLevelFromLogrusLevel(logLevel) - clientCtx = context.WithValue( - clientCtx, - gournal.LevelKey(), - gournalLevel) - - gournal.DefaultLevel = gournalLevel - } - client, err := newIsiClientWithArgsFunc( clientCtx, isiConfig.EndpointURL, @@ -487,12 +469,7 @@ func (s *service) GetIsiClient(clientCtx context.Context, isiConfig *IsilonClust return client, nil } -func getGournalLevelFromLogrusLevel(logLevel logrus.Level) gournal.Level { - gournalLevel := gournal.ParseLevel(logLevel.String()) - return gournalLevel -} - -func (s *service) GetIsiService(clientCtx context.Context, isiConfig *IsilonClusterConfig, logLevel logrus.Level) (*isiService, error) { +func (s *service) GetIsiService(clientCtx context.Context, isiConfig *IsilonClusterConfig, logLevel csmlog.Level) (*isiService, error) { var isiClient *isi.Client var err error if isiClient, err = s.GetIsiClient(clientCtx, isiConfig, logLevel); err != nil { @@ -523,13 +500,13 @@ func (s *service) logServiceStats() { "mode": s.mode, } // TODO: Replace logrus with log - logrus.WithFields(fields).Infof("Configured '%s'", constants.PluginName) + log.WithFields(fields).Infof("Configured '%s'", constants.PluginName) } func (s *service) BeforeServe( ctx context.Context, _ *gocsi.StoragePlugin, _ net.Listener, ) error { - log := logging.GetLogger() + log := log.WithContext(ctx) if err := s.initializeServiceOpts(ctx); err != nil { return err @@ -557,7 +534,7 @@ func (s *service) BeforeServe( vc.OnConfigChange(func(_ fsnotify.Event) { log.Infof("Driver config params file changed") if err := s.updateDriverConfigParams(ctx, vc); err != nil { - log.Warn(err) + log.Warn(err.Error()) } }) @@ -579,7 +556,6 @@ func (s *service) BeforeServe( // RegisterAdditionalServers registers any additional grpc services that use the CSI socket. func (s *service) RegisterAdditionalServers(server *grpc.Server) { - _, log := GetLogger(context.Background()) log.Info("Registering additional GRPC servers") csiext.RegisterReplicationServer(server, s) vgsext.RegisterVolumeGroupSnapshotServer(server, s) @@ -587,13 +563,13 @@ func (s *service) RegisterAdditionalServers(server *grpc.Server) { } func (s *service) loadIsilonConfigs(ctx context.Context, configFile string) error { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) log.Info("Updating cluster config details") watcher, _ := fsnotify.NewWatcher() defer watcher.Close() parentFolder, _ := filepath.Abs(filepath.Dir(configFile)) - log.Debug("Config folder: ", parentFolder) + log.Debugf("Config folder: %v", parentFolder) done := make(chan bool) go func() { for { @@ -608,8 +584,8 @@ func (s *service) loadIsilonConfigs(ctx context.Context, configFile string) erro noProbeOnStart = false err := s.syncIsilonConfigs(ctx) if err != nil { - log.Debug("Cluster configuration array length:", s.getIsilonClusterLength()) - log.Error("Invalid configuration in secret.yaml. Error:", err) + log.Debugf("Cluster configuration array length: %v", s.getIsilonClusterLength()) + log.Errorf("Invalid configuration in secret.yaml. Error: %v", err) } } @@ -617,13 +593,13 @@ func (s *service) loadIsilonConfigs(ctx context.Context, configFile string) erro if !ok { return } - log.Error("cluster config file load error:", err) + log.Errorf("cluster config file load error: %v", err) } } }() err := watcher.Add(parentFolder) if err != nil { - log.Error("Unable to add file watcher for folder ", parentFolder) + log.Errorf("Unable to add file watcher for folder %v", parentFolder) return err } <-done @@ -644,7 +620,7 @@ func (s *service) getUpdateIntervalChannel() <-chan time.Duration { // reconcileNodeAzLabels reconciles the node access zone labels func (r *reconciler) reconcileNodeAzLabels(ctx context.Context) error { - _, log := GetLogger(ctx) + log := log.WithContext(ctx) azReconcileInterval := r.service.getReconcileInterval() @@ -689,14 +665,14 @@ func (s *service) getIsilonClusterLength() (length int) { length++ return true }) - return + return length } var syncMutex sync.Mutex // Reads the credentials from secrets and initialize all arrays. func (s *service) syncIsilonConfigs(ctx context.Context) error { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) log.Info("************* Synchronizing Isilon Clusters' config **************") syncMutex.Lock() defer syncMutex.Unlock() @@ -745,8 +721,8 @@ func unmarshalYAMLContent(configBytes []byte) (*IsilonClusters, error) { func (s *service) getNewIsilonConfigs(ctx context.Context, configBytes []byte) (map[interface{}]interface{}, string, error) { var noOfDefaultClusters int var defaultIsiClusterName string - logLevel := logging.GetCurrentLogLevel() - log := logging.GetLogger() + logLevel := csmlog.GetLevel() + log := log.WithContext(ctx) var inputConfigs *IsilonClusters var yamlErr error @@ -812,9 +788,10 @@ func (s *service) getNewIsilonConfigs(ctx context.Context, configBytes []byte) ( } config.EndpointURL = fmt.Sprintf("https://%s:%s", config.Endpoint, config.EndpointPort) - clientCtx, _ := GetLogger(ctx) + // clientCtx, _ := GetLogger(ctx) + // Need to verify this part if !noProbeOnStart { - config.isiSvc, err = s.GetIsiService(clientCtx, &config, logLevel) + config.isiSvc, err = s.GetIsiService(ctx, &config, logLevel) if err != nil { log.Errorf("failed to get isi client for cluster %s, error: %v", config.ClusterName, err) } @@ -857,14 +834,13 @@ func (s *service) getNewIsilonConfigs(ctx context.Context, configBytes []byte) ( "IgnoreUnresolvableHosts": *config.IgnoreUnresolvableHosts, } // TODO: Replace logrus with log - logrus.WithFields(fields).Infof("new config details set for cluster %s", config.ClusterName) + log.WithFields(fields).Infof("new config details set for cluster %s", config.ClusterName) } return newIsiClusters, defaultIsiClusterName, nil } func handler(_, value interface{}) bool { - _, log := GetLogger(context.Background()) log.Debug(value.(*IsilonClusterConfig).String()) return true } @@ -889,20 +865,20 @@ func (s *service) getIsilonClusters() []*IsilonClusterConfig { // Update configurable params from configmap func (s *service) updateDriverConfigParams(ctx context.Context, v *viper.Viper) error { - log := logging.GetLogger() + log := log.WithContext(ctx) logLevel := constants.DefaultLogLevel if v.IsSet(constants.ParamCSILogLevel) { inputLogLevel := v.GetString(constants.ParamCSILogLevel) if inputLogLevel != "" { inputLogLevel = strings.ToLower(inputLogLevel) var err error - logLevel, err = logging.ParseLogLevel(inputLogLevel) + logLevel, err = csmlog.ParseLevel(inputLogLevel) if err != nil { return fmt.Errorf("input log level %q is not valid", inputLogLevel) } } } - logging.UpdateLogLevel(logLevel, &updateMutex) + csmlog.SetLevel(logLevel) log.Infof("log level set to '%s'", logLevel) // set access zone network label interval @@ -916,7 +892,7 @@ func (s *service) updateDriverConfigParams(ctx context.Context, v *viper.Viper) return nil } -func (s *service) setAzReconcileInterval(log *logrus.Logger, v *viper.Viper) { +func (s *service) setAzReconcileInterval(log *csmlog.CsmLog, v *viper.Viper) { var azReconcileIntervalStr string if v.IsSet(constants.ParamAZReconcileInterval) { azReconcileIntervalStr = v.GetString(constants.ParamAZReconcileInterval) @@ -930,7 +906,7 @@ func (s *service) setAzReconcileInterval(log *logrus.Logger, v *viper.Viper) { interval, err := time.ParseDuration(azReconcileIntervalStr) if err != nil { - log.Error(err, fmt.Sprintf("parsing access zone reconcile interval %s, defaulting to %s", azReconcileIntervalStr, constants.DefaultAZReconcileInterval)) + log.Errorf(err.Error(), fmt.Sprintf("parsing access zone reconcile interval %s, defaulting to %s", azReconcileIntervalStr, constants.DefaultAZReconcileInterval)) interval = constants.DefaultAZReconcileInterval } log.Infof("access zone reconcile interval set to %s", interval) @@ -987,7 +963,7 @@ func (s *service) logStatistics() { "StackSys": memstats.StackSys, } // TODO: Replace logrus with log - logrus.WithFields(fields).Debugf("resource statistics counter: %d", s.statisticsCounter) + log.WithFields(fields).Debugf("resource statistics counter: %d", s.statisticsCounter) } } @@ -998,116 +974,24 @@ func (s *service) getIsiPathForVolumeFromClusterConfig(clusterConfig *IsilonClus return clusterConfig.IsiPath } -// Set cluster name in log messages and re-initialize the context -func setClusterContext(ctx context.Context, clusterName string) (context.Context, *logrus.Entry) { - return setLogFieldsInContext(ctx, clusterName, logging.ClusterName) -} - -// Set runID in log messages and re-initialize the context -func setRunIDContext(ctx context.Context, runID string) (context.Context, *logrus.Entry) { - return setLogFieldsInContext(ctx, runID, logging.RunID) -} - -var logMutex sync.Mutex - -// Common method to get log and context -func setLogFieldsInContext(ctx context.Context, logParam string, logType string) (context.Context, *logrus.Entry) { - logMutex.Lock() - defer logMutex.Unlock() - - fields := logrus.Fields{} - fields, ok := ctx.Value(logging.LogFields).(logrus.Fields) - if !ok { - fields = logrus.Fields{} - } - if fields == nil { - fields = logrus.Fields{} - } - fields[logType] = logParam - ulog, ok := ctx.Value(logging.PowerScaleLogger).(*logrus.Entry) - if !ok { - ulog = logging.GetLogger().WithFields(fields) - } - ulog = ulog.WithFields(fields) - ctx = context.WithValue(ctx, logging.PowerScaleLogger, ulog) - ctx = context.WithValue(ctx, logging.LogFields, fields) - return ctx, ulog -} - -// GetLogger creates custom logger handler -func GetLogger(ctx context.Context) (context.Context, *logrus.Entry) { - var rid string - fields := logrus.Fields{} - if ctx == nil { - return ctx, logging.GetLogger().WithFields(fields) - } - - headers, ok := metadata.FromIncomingContext(ctx) - if ok { - reqid, ok := headers[csictx.RequestIDKey] - if ok && len(reqid) > 0 { - rid = reqid[0] - } - } - - fields, _ = ctx.Value(logging.LogFields).(logrus.Fields) - if fields == nil { - fields = logrus.Fields{} - } - - if ok { - fields[logging.RequestID] = rid - } - - logMutex.Lock() - defer logMutex.Unlock() - l := logging.GetLogger() - logWithFields := l.WithFields(fields) - ctx = context.WithValue(ctx, logging.PowerScaleLogger, logWithFields) - ctx = context.WithValue(ctx, logging.LogFields, fields) - return ctx, logWithFields +// GetMessageWithReqID returns message with reqID information +func GetMessageWithReqID(ReqID string, format string, args ...interface{}) string { + str := fmt.Sprintf(format, args...) + return fmt.Sprintf(" ReqID=%s %s", ReqID, str) } -// GetRunIDLog function returns logger with runID -func GetRunIDLog(ctx context.Context) (context.Context, *logrus.Entry, string) { - var rid string - fields := logrus.Fields{} - if ctx == nil { - return ctx, logging.GetLogger().WithFields(fields), rid - } - - headers, ok := metadata.FromIncomingContext(ctx) - if ok { - reqid, ok := headers[csictx.RequestIDKey] - if ok && len(reqid) > 0 { - rid = reqid[0] - } else { - atomic.AddInt64(&runid, 1) - rid = fmt.Sprintf("%d", runid) - } +// LogMap logs the key-value entries of a given map +func LogMap(ctx context.Context, mapName string, m map[string]string) { + log := log.WithContext(ctx) + log.Debugf("map '%s':", mapName) + for key, value := range m { + log.Debugf(" [%s]='%s'", key, value) } - - fields, _ = ctx.Value(logging.LogFields).(logrus.Fields) - if fields == nil { - fields = logrus.Fields{} - } - - if ok { - fields[logging.RunID] = rid - } - - logMutex.Lock() - defer logMutex.Unlock() - l := logging.GetLogger() - log := l.WithFields(fields) - ctx = context.WithValue(ctx, logging.PowerScaleLogger, log) - ctx = context.WithValue(ctx, logging.LogFields, fields) - return ctx, log, rid } // getIsilonConfig returns the cluster config func (s *service) getIsilonConfig(ctx context.Context, clusterName *string) (*IsilonClusterConfig, error) { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) if *clusterName == "" { log.Infof("Request doesn't include cluster name. Use default cluster '%s'", s.defaultIsiClusterName) *clusterName = s.defaultIsiClusterName @@ -1125,7 +1009,6 @@ func (s *service) getIsilonConfig(ctx context.Context, clusterName *string) (*Is } func (s *service) GetNodeLabels() (map[string]string, error) { - log := logging.GetLogger() k8sclientset, err := k8sutils.CreateKubeClientSet(s.opts.KubeConfigPath) if err != nil { log.Errorf("init client failed: '%s'", err.Error()) @@ -1151,7 +1034,6 @@ var ( ) func (s *service) GetNodeLabelsWithName(nodeName string) (map[string]string, error) { - log := logging.GetLogger() k8sclientset, err := getKubeClientSet(s.opts.KubeConfigPath) if err != nil { log.Errorf("init client failed: '%s'", err.Error()) @@ -1168,8 +1050,6 @@ func (s *service) GetNodeLabelsWithName(nodeName string) (map[string]string, err } func (s *service) PatchNodeLabels(add map[string]string, remove []string) error { - log := logging.GetLogger() - node, err := s.k8sclient.CoreV1().Nodes().Get(context.TODO(), s.nodeID, v1.GetOptions{}) if err != nil { log.Errorf("failed to get current node details: '%s'", err.Error()) @@ -1216,7 +1096,7 @@ func (s *service) ProbeController(ctx context.Context, _ *commonext.ProbeControllerRequest) ( *commonext.ProbeControllerResponse, error, ) { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) if !strings.EqualFold(s.mode, "node") { log.Debugf("controllerProbe") @@ -1231,7 +1111,7 @@ func (s *service) ProbeController(ctx context.Context, rep := new(commonext.ProbeControllerResponse) rep.Ready = ready rep.Name = constants.PluginName - rep.VendorVersion = core.SemVer + rep.VendorVersion = Manifest["semver"] rep.Manifest = Manifest log.Debug(fmt.Sprintf("ProbeController returning: %v", rep.Ready.GetValue())) @@ -1245,7 +1125,7 @@ func (s *service) WithRP(key string) string { } func (s *service) validateIsiPath(ctx context.Context, volName string) (string, error) { - ctx, log := GetLogger(ctx) + log := log.WithContext(ctx) if s.k8sclient == nil { return "", errors.New("no k8s clientset") } @@ -1262,7 +1142,7 @@ func (s *service) validateIsiPath(ctx context.Context, volName string) (string, if pv.Spec.CSI.VolumeAttributes[ExportPathParam] != "" { exportPath := pv.Spec.CSI.VolumeAttributes[ExportPathParam] isiPath := isilonfs.GetIsiPathFromExportPath(exportPath) - log.Debug("Found IsiPath from PersistentVolume: ", isiPath) + log.Debugf("Found IsiPath from PersistentVolume: %v", isiPath) return isiPath, nil } } @@ -1275,7 +1155,7 @@ func (s *service) validateIsiPath(ctx context.Context, volName string) (string, return "", nil } - log.Debug("Checking StorageClass: ", pv.Spec.StorageClassName) + log.Debugf("Checking StorageClass: %v", pv.Spec.StorageClassName) sc, err := s.k8sclient.StorageV1().StorageClasses().Get(ctx, pv.Spec.StorageClassName, v1.GetOptions{}) if err != nil { @@ -1292,7 +1172,7 @@ func (s *service) validateIsiPath(ctx context.Context, volName string) (string, } func getExportPathFromExportID(ctx context.Context, isiConfig *IsilonClusterConfig, exportID int, accessZone string) (string, error) { - ctx, log, _ := GetRunIDLog(ctx) + log := log.WithContext(ctx) export, err := isiConfig.isiSvc.GetExportByIDWithZone(ctx, exportID, accessZone) if err != nil { log.Error("Failed to get export with error: " + err.Error()) diff --git a/service/service_test.go b/service/service_test.go index bc04b16d..2741ea01 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -29,11 +29,11 @@ import ( "testing" "time" - "github.com/akutz/gournal" + "github.com/dell/csi-powerscale/v2/common/constants" + "github.com/dell/csmlog" "github.com/container-storage-interface/spec/lib/go/csi" "github.com/cucumber/godog" - "github.com/dell/csi-isilon/v2/common/constants" - "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -100,16 +100,6 @@ func TestMain(m *testing.M) { os.Exit(status) } -func TestGetLoggerfunc(t *testing.T) { - ctx, _ := GetLogger(context.TODO()) - assert.NotNil(t, ctx) -} - -func TestGetRunIDLogfunc(t *testing.T) { - ctx, _, _ := GetRunIDLog(context.TODO()) - assert.NotNil(t, ctx) -} - func TestGetIsiPathForVolumeFromClusterConfig(t *testing.T) { o := Opts{ Path: "path", @@ -605,13 +595,6 @@ func TestLoadIsilonConfigs(t *testing.T) { time.Sleep(1 * time.Second) } -func TestSetRunIDContext(t *testing.T) { - ctx := context.Background() - runID := "test-run-123" - newCtx, _ := setRunIDContext(ctx, runID) - require.NotNil(t, newCtx) -} - func TestGetIsiClient(t *testing.T) { o := Opts{ CustomTopologyEnabled: true, @@ -621,7 +604,7 @@ func TestGetIsiClient(t *testing.T) { } ctx := context.Background() isiConfig := IsilonClusterConfig{} - logLevel := logrus.InfoLevel + logLevel := csmlog.InfoLevel _, err := s.GetIsiClient(ctx, &isiConfig, logLevel) assert.NotEqual(t, nil, err) } @@ -902,12 +885,6 @@ func TestSetNoProbeOnStart(_ *testing.T) { s.setNoProbeOnStart(ctx) } -func TestGetGournalLevel(t *testing.T) { - logLevel := logrus.InfoLevel - level := getGournalLevelFromLogrusLevel(logLevel) - assert.Equal(t, gournal.ParseLevel(logLevel.String()), level) -} - func TestValidateIsiPath(t *testing.T) { var mu sync.Mutex @@ -1123,8 +1100,6 @@ func TestSetAzReconcileInterval(t *testing.T) { v.Set(constants.ParamAZReconcileInterval, tt.intervalStr) } - log := logrus.New() - s.setAzReconcileInterval(log, v) assert.Equal(t, tt.expectedInterval, s.azReconcileInterval) }) @@ -1149,7 +1124,7 @@ func (m *mockReconciler) ReconcileNodeAzLabels(ctx context.Context) error { return m.reconcileNodeAzLabelsFunc(ctx) } -func (m *mockReconciler) setAzReconcileInterval(_ *logrus.Logger, _ *viper.Viper) {} +func (m *mockReconciler) setAzReconcileInterval(_ *csmlog.CsmLog, _ *viper.Viper) {} func TestGetReconcileInterval(t *testing.T) { expectedInterval := 5 * time.Second @@ -1288,3 +1263,34 @@ func TestService_reconcileNodeAzLabels(t *testing.T) { } }) } + +func TestGetMessageWithReqID(t *testing.T) { + tests := []struct { + name string + ReqID string + format string + args []interface{} + expected string + }{ + {"Basic message", "12345", "Process started", nil, " ReqID=12345 Process started"}, + {"Formatted message", "98765", "Error code: %d", []interface{}{404}, " ReqID=98765 Error code: 404"}, + {"Multiple arguments", "56789", "User %s logged in at %s", []interface{}{"Alice", "10:00 AM"}, " ReqID=56789 User Alice logged in at 10:00 AM"}, + {"Empty ReqID", "", "System rebooting", nil, " ReqID= System rebooting"}, + {"Empty format", "54321", "", nil, " ReqID=54321 "}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := GetMessageWithReqID(tt.ReqID, tt.format, tt.args...) + if got != tt.expected { + t.Errorf("Expected %q, got %q", tt.expected, got) + } + }) + } +} + +func TestLogMap(_ *testing.T) { + ctx := context.Background() + m := map[string]string{"key1": "value1", "key2": "value2"} + LogMap(ctx, "testMap", m) +} diff --git a/service/step_defs_test.go b/service/step_defs_test.go index 0c650349..be1838f8 100644 --- a/service/step_defs_test.go +++ b/service/step_defs_test.go @@ -1,7 +1,7 @@ package service /* - Copyright (c) 2019-2025 Dell Inc, or its subsidiaries. + Copyright (c) 2019-2026 Dell Inc, or its subsidiaries. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ import ( context2 "context" "errors" "fmt" - "log" "net" "net/http/httptest" "os" @@ -28,20 +27,21 @@ import ( "sync" "time" - "github.com/dell/csi-isilon/v2/common/constants" - ident "github.com/dell/csi-isilon/v2/common/utils/identifiers" - "github.com/dell/csi-isilon/v2/common/utils/logging" - "github.com/dell/csi-isilon/v2/service/mock/k8s" + "github.com/dell/csi-powerscale/v2/common/constants" + ident "github.com/dell/csi-powerscale/v2/common/utils/identifiers" + "github.com/dell/csmlog" + + "github.com/dell/csi-powerscale/v2/service/mock/k8s" csiext "github.com/dell/dell-csi-extensions/replication" "google.golang.org/grpc" "k8s.io/client-go/kubernetes/fake" - csi "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/cucumber/godog" commonext "github.com/dell/dell-csi-extensions/common" podmon "github.com/dell/dell-csi-extensions/podmon" "github.com/dell/gocsi" "github.com/dell/gofsutil" + csi "github.com/container-storage-interface/spec/lib/go/csi" + "github.com/cucumber/godog" "golang.org/x/net/context" "google.golang.org/grpc/metadata" @@ -146,6 +146,7 @@ const ( datadir2 = "test/tmp/datadir2" clusterName1 = "cluster1" logLevel = constants.DefaultLogLevel + imageVersion = "1.0.0" ) func (f *feature) aIsilonService() error { @@ -192,7 +193,7 @@ func (f *feature) aIsilonService() error { if f.server == nil { f.server = httptest.NewServer(handler) } - log.Printf("server url: %s\n", f.server.URL) + log.Infof("server url: %s\n", f.server.URL) clusterConfig.EndpointURL = f.server.URL // f.service.opts.EndpointURL = f.server.URL } else { @@ -204,6 +205,9 @@ func (f *feature) aIsilonService() error { f.service.isiClusters.Store(clusterName1, updatedClusterConfig) f.checkGoRoutines("end aIsilonService") f.service.logServiceStats() + + // Configure ManifestSemver + ManifestSemver = imageVersion return nil } @@ -500,11 +504,10 @@ func (f *feature) iSetPollingFeqTo(value string) error { func (f *feature) aValidGetPlugInfoResponseIsReturned() error { rep := f.getPluginInfoResponse - url := rep.GetManifest()["url"] - if rep.GetName() == "" || rep.GetVendorVersion() == "" || url == "" { + if rep.GetName() == "" || rep.GetVendorVersion() == "" { return errors.New("Expected GetPluginInfo to return name and version") } - log.Printf("Name %s Version %s URL %s", rep.GetName(), rep.GetVendorVersion(), url) + log.Infof("Name %s Version %s", rep.GetName(), rep.GetVendorVersion()) return nil } @@ -705,10 +708,10 @@ func (f *feature) iCallCreateVolume(name string) error { req.Name = name f.createVolumeResponse, f.err = f.service.CreateVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateVolume call failed: %s\n", f.err.Error()) + log.Infof("CreateVolume call failed: %s\n", f.err.Error()) } if f.createVolumeResponse != nil { - log.Printf("vol id %s\n", f.createVolumeResponse.GetVolume().VolumeId) + log.Infof("vol id %s\n", f.createVolumeResponse.GetVolume().VolumeId) stepHandlersErrors.ExportNotFoundError = false stepHandlersErrors.VolumeNotExistError = false } @@ -721,10 +724,10 @@ func (f *feature) iCallCreateVolumeWithPersistentMetadata(name string) error { req.Name = name f.createVolumeResponse, f.err = f.service.CreateVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateVolume call failed: %s\n", f.err.Error()) + log.Infof("CreateVolume call failed: %s\n", f.err.Error()) } if f.createVolumeResponse != nil { - log.Printf("vol id %s\n", f.createVolumeResponse.GetVolume().VolumeId) + log.Infof("vol id %s\n", f.createVolumeResponse.GetVolume().VolumeId) stepHandlersErrors.ExportNotFoundError = false stepHandlersErrors.VolumeNotExistError = false } @@ -739,10 +742,10 @@ func (f *feature) iCallCreateVolumeWithParams(name string, rangeInGiB int, acces stepHandlersErrors.VolumeNotExistError = true f.createVolumeResponse, f.err = f.service.CreateVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateVolume call failed: %s\n", f.err.Error()) + log.Infof("CreateVolume call failed: %s\n", f.err.Error()) } if f.createVolumeResponse != nil { - log.Printf("vol id %s\n", f.createVolumeResponse.GetVolume().VolumeId) + log.Infof("vol id %s\n", f.createVolumeResponse.GetVolume().VolumeId) stepHandlersErrors.ExportNotFoundError = false stepHandlersErrors.VolumeNotExistError = false } @@ -757,11 +760,9 @@ func (f *feature) iCallDeleteVolume(name string) error { req := f.deleteVolumeRequest req.VolumeId = name - ctx, log, _ := GetRunIDLog(context.Background()) - - f.deleteVolumeResponse, f.err = f.service.DeleteVolume(ctx, req) + f.deleteVolumeResponse, f.err = f.service.DeleteVolume(context.Background(), req) if f.err != nil { - log.Printf("DeleteVolume call failed: '%v'\n", f.err) + log.Infof("DeleteVolume call failed: '%v'\n", f.err) } return nil @@ -785,7 +786,7 @@ func (f *feature) aValidDeleteVolumeResponseIsReturned() error { } func (f *feature) iInduceError(errtype string) error { - log.Printf("set induce error %s\n", errtype) + log.Infof("set induce error %s\n", errtype) switch errtype { case "InstancesError": stepHandlersErrors.InstancesError = true @@ -1002,7 +1003,7 @@ func (f *feature) iCallControllerGetCapabilities(isHealthMonitorEnabled string) req := new(csi.ControllerGetCapabilitiesRequest) f.controllerGetCapabilitiesResponse, f.err = f.service.ControllerGetCapabilities(context.Background(), req) if f.err != nil { - log.Printf("ControllerGetCapabilities call failed: %s\n", f.err.Error()) + log.Infof("ControllerGetCapabilities call failed: %s\n", f.err.Error()) return f.err } return nil @@ -1102,9 +1103,8 @@ func (f *feature) iCallValidateVolumeCapabilitiesWithVoltypeAccess(voltype, acce capabilities := make([]*csi.VolumeCapability, 0) capabilities = append(capabilities, capability) req.VolumeCapabilities = capabilities - log.Printf("Calling ValidateVolumeCapabilities") - ctx, _, _ := GetRunIDLog(context.Background()) - f.validateVolumeCapabilitiesResponse, f.err = f.service.ValidateVolumeCapabilities(ctx, req) + log.Infof("Calling ValidateVolumeCapabilities") + f.validateVolumeCapabilitiesResponse, f.err = f.service.ValidateVolumeCapabilities(context.Background(), req) if f.err != nil { return nil } @@ -1220,14 +1220,15 @@ func getTypicalCapacityRequest(valid bool) *csi.GetCapacityRequest { return req } +// check if it works func (f *feature) iCallGetCapacity() error { header := metadata.New(map[string]string{"csi.requestid": "1"}) - ctx, _, _ := GetRunIDLog(context.Background()) - ctx = metadata.NewIncomingContext(ctx, header) + ctx := context.Background() + ctx = metadata.NewIncomingContext(context.Background(), header) req := getTypicalCapacityRequest(true) f.getCapacityResponse, f.err = f.service.GetCapacity(ctx, req) if f.err != nil { - log.Printf("GetCapacity call failed: %s\n", f.err.Error()) + log.Infof("GetCapacity call failed: %s\n", f.err.Error()) return nil } return nil @@ -1243,7 +1244,7 @@ func (f *feature) iCallGetCapacityWithParams(clusterName string) error { f.getCapacityResponse, f.err = f.service.GetCapacity(ctx, req) if f.err != nil { - log.Printf("GetCapacity call failed: %s\n", f.err.Error()) + log.Infof("GetCapacity call failed: %s\n", f.err.Error()) return nil } return nil @@ -1255,7 +1256,7 @@ func (f *feature) iCallGetCapacityWithInvalidAccessMode() error { req := getTypicalCapacityRequest(false) f.getCapacityResponse, f.err = f.service.GetCapacity(ctx, req) if f.err != nil { - log.Printf("GetCapacity call failed: %s\n", f.err.Error()) + log.Infof("GetCapacity call failed: %s\n", f.err.Error()) return nil } return nil @@ -1281,7 +1282,7 @@ func (f *feature) iCallNodeGetInfo() error { req := new(csi.NodeGetInfoRequest) f.nodeGetInfoResponse, f.err = f.service.NodeGetInfo(context.Background(), req) if f.err != nil { - log.Printf("NodeGetInfo call failed: %s\n", f.err.Error()) + log.Infof("NodeGetInfo call failed: %s\n", f.err.Error()) return f.err } return nil @@ -1298,7 +1299,7 @@ func (f *feature) iCallNodeGetInfoWithInvalidVolumeLimit(volumeLimit int64) erro f.service.opts.MaxVolumesPerNode = volumeLimit f.nodeGetInfoResponse, f.err = f.service.NodeGetInfo(context.Background(), req) if f.err != nil { - log.Printf("NodeGetInfo call failed: %s\n", f.err.Error()) + log.Infof("NodeGetInfo call failed: %s\n", f.err.Error()) } return nil } @@ -1310,7 +1311,7 @@ func (f *feature) iCallNodeGetCapabilities(isHealthMonitorEnabled string) error } f.nodeGetCapabilitiesResponse, f.err = f.service.NodeGetCapabilities(context.Background(), req) if f.err != nil { - log.Printf("NodeGetCapabilities call failed: %s\n", f.err.Error()) + log.Infof("NodeGetCapabilities call failed: %s\n", f.err.Error()) return f.err } return nil @@ -1393,10 +1394,10 @@ func (f *feature) iCallControllerPublishVolumeWithTo(accessMode, nodeID string) req = f.getControllerPublishVolumeRequest(accessMode, nodeID) f.publishVolumeRequest = req } - log.Printf("Calling controllerPublishVolume") + log.Infof("Calling controllerPublishVolume") f.publishVolumeResponse, f.err = f.service.ControllerPublishVolume(ctx, req) if f.err != nil { - log.Printf("PublishVolume call failed: %s\n", f.err.Error()) + log.Infof("PublishVolume call failed: %s\n", f.err.Error()) } f.publishVolumeRequest = nil return nil @@ -1459,7 +1460,7 @@ func (f *feature) iCallNodeUnpublishVolume() error { f.nodeUnpublishVolumeResponse, f.err = f.service.NodeUnpublishVolume(context.Background(), req) if f.err != nil { - log.Printf("NodePublishVolume call failed: %s\n", f.err.Error()) + log.Infof("NodePublishVolume call failed: %s\n", f.err.Error()) if strings.Contains(f.err.Error(), "Target Path is required") { // Rollback for the future calls f.nodeUnpublishVolumeRequest.TargetPath = datadir @@ -1470,7 +1471,7 @@ func (f *feature) iCallNodeUnpublishVolume() error { if err != nil { return nil } - log.Printf("vol id %s\n", f.nodeUnpublishVolumeRequest.VolumeId) + log.Infof("vol id %s\n", f.nodeUnpublishVolumeRequest.VolumeId) } return nil } @@ -1488,7 +1489,7 @@ func (f *feature) iCallEphemeralNodeUnpublishVolume() error { f.nodeUnpublishVolumeResponse, f.err = f.service.NodeUnpublishVolume(context.Background(), req) if f.err != nil { - log.Printf("NodePublishVolume call failed: %s\n", f.err.Error()) + log.Infof("NodePublishVolume call failed: %s\n", f.err.Error()) if strings.Contains(f.err.Error(), "Target Path is required") { // Rollback for the future calls f.nodeUnpublishVolumeRequest.TargetPath = datadir @@ -1499,7 +1500,7 @@ func (f *feature) iCallEphemeralNodeUnpublishVolume() error { if err != nil { return nil } - log.Printf("vol id %s\n", f.nodeUnpublishVolumeRequest.VolumeId) + log.Infof("vol id %s\n", f.nodeUnpublishVolumeRequest.VolumeId) } return nil } @@ -1848,10 +1849,10 @@ func (f *feature) iCallControllerPublishVolume(volID string, accessMode string, req.VolumeId = volID } - log.Printf("Calling controllerPublishVolume") + log.Infof("Calling controllerPublishVolume") f.publishVolumeResponse, f.err = f.service.ControllerPublishVolume(ctx, req) if f.err != nil { - log.Printf("PublishVolume call failed: %s\n", f.err.Error()) + log.Infof("PublishVolume call failed: %s\n", f.err.Error()) } f.publishVolumeRequest = nil return nil @@ -1870,7 +1871,7 @@ func (f *feature) iCallControllerGetVolume(volID string) error { fmt.Printf("Calling controllerGetVolume") f.controllerGetVolumeResponse, f.err = f.service.ControllerGetVolume(ctx, req) if f.err != nil { - log.Printf("Controller GetVolume call failed: %s\n", f.err.Error()) + log.Infof("Controller GetVolume call failed: %s\n", f.err.Error()) } if f.controllerGetVolumeResponse != nil { // check message and abnormal state returned in NodeGetVolumeStatsResponse.VolumeCondition @@ -1917,7 +1918,7 @@ func (f *feature) iCallNodeGetVolumeStats(volID string) error { f.nodeGetVolumeStatsResponse, f.err = f.service.NodeGetVolumeStats(ctx, req) if f.err != nil { - log.Printf("Node GetVolumeStats call failed: %s\n", f.err.Error()) + log.Infof("Node GetVolumeStats call failed: %s\n", f.err.Error()) } if f.nodeGetVolumeStatsResponse != nil { // check message and abnormal state returned in NodeGetVolumeStatsResponse.VolumeCondition @@ -1948,11 +1949,11 @@ func (f *feature) iCallControllerUnPublishVolume(volID string, accessMode string req.VolumeId = volID f.unpublishVolumeResponse, f.err = f.service.ControllerUnpublishVolume(context.Background(), req) if f.err != nil { - log.Printf("ControllerUnPublishVolume call failed: %s\n", f.err.Error()) + log.Infof("ControllerUnPublishVolume call failed: %s\n", f.err.Error()) } if f.unpublishVolumeResponse != nil { - log.Printf("a unpublishVolumeResponse has been returned\n") + log.Infof("a unpublishVolumeResponse has been returned\n") } return nil } @@ -1968,11 +1969,11 @@ func (f *feature) iCallNodeStageVolume(volID string, accessType string) error { f.nodeStageVolumeResponse, f.err = f.service.NodeStageVolume(context.Background(), req) if f.err != nil { - log.Printf("NodeStageVolume call failed: %s\n", f.err.Error()) + log.Infof("NodeStageVolume call failed: %s\n", f.err.Error()) } if f.nodeStageVolumeResponse != nil { - log.Printf("a NodeStageVolumeResponse has been returned\n") + log.Infof("a NodeStageVolumeResponse has been returned\n") } return nil @@ -1983,11 +1984,11 @@ func (f *feature) iCallNodeUnstageVolume(volID string) error { f.nodeUnstageVolumeRequest = req f.nodeUnstageVolumeResponse, f.err = f.service.NodeUnstageVolume(context.Background(), req) if f.err != nil { - log.Printf("NodeUnstageVolume call failed: %s\n", f.err.Error()) + log.Infof("NodeUnstageVolume call failed: %s\n", f.err.Error()) } if f.nodeStageVolumeResponse != nil { - log.Printf("a NodeUnstageVolumeResponse has been returned\n") + log.Infof("a NodeUnstageVolumeResponse has been returned\n") } return nil } @@ -2002,7 +2003,7 @@ func (f *feature) iCallListVolumesWithMaxEntriesStartingToken(arg1 int, arg2 str req.StartingToken = arg2 f.listVolumesResponse, f.err = f.service.ListVolumes(context.Background(), req) if f.err != nil { - log.Printf("ListVolumes call failed: %s\n", f.err.Error()) + log.Infof("ListVolumes call failed: %s\n", f.err.Error()) return nil } return nil @@ -2023,7 +2024,7 @@ func (f *feature) iCallDeleteSnapshot(snapshotID string) error { f.deleteSnapshotRequest = req _, err := f.service.DeleteSnapshot(context.Background(), f.deleteSnapshotRequest) if err != nil { - log.Printf("DeleteSnapshot call failed: %s\n", err.Error()) + log.Infof("DeleteSnapshot call failed: %s\n", err.Error()) f.err = err return nil } @@ -2043,10 +2044,10 @@ func (f *feature) iCallCreateSnapshot(srcVolumeID, name string) error { req := f.createSnapshotRequest f.createSnapshotResponse, f.err = f.service.CreateSnapshot(context.Background(), req) if f.err != nil { - log.Printf("CreateSnapshot call failed: %s\n", f.err.Error()) + log.Infof("CreateSnapshot call failed: %s\n", f.err.Error()) } if f.createSnapshotResponse != nil { - log.Printf("snapshot id %s\n", f.createSnapshotResponse.GetSnapshot().SnapshotId) + log.Infof("snapshot id %s\n", f.createSnapshotResponse.GetSnapshot().SnapshotId) } return nil @@ -2076,17 +2077,16 @@ func getControllerExpandVolumeRequest(volumeID string, requiredBytes int64) *csi } func (f *feature) iCallControllerExpandVolume(volumeID string, requiredBytes int64) error { - log.Printf("###") + log.Infof("###") f.controllerExpandVolumeRequest = getControllerExpandVolumeRequest(volumeID, requiredBytes) req := f.controllerExpandVolumeRequest - ctx, log, _ := GetRunIDLog(context.Background()) - f.controllerExpandVolumeResponse, f.err = f.service.ControllerExpandVolume(ctx, req) + f.controllerExpandVolumeResponse, f.err = f.service.ControllerExpandVolume(context.Background(), req) if f.err != nil { - log.Printf("ControllerExpandVolume call failed: %s\n", f.err.Error()) + log.Infof("ControllerExpandVolume call failed: %s\n", f.err.Error()) } if f.controllerExpandVolumeResponse != nil { - log.Printf("Volume capacity %d\n", f.controllerExpandVolumeResponse.CapacityBytes) + log.Infof("Volume capacity %d\n", f.controllerExpandVolumeResponse.CapacityBytes) } return nil } @@ -2133,10 +2133,10 @@ func (f *feature) iCallCreateVolumeFromSnapshot(srcSnapshotID, name string) erro req = f.setVolumeContent(true, srcSnapshotID) f.createVolumeResponse, f.err = f.service.CreateVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateVolume call failed: '%s'\n", f.err.Error()) + log.Infof("CreateVolume call failed: '%s'\n", f.err.Error()) } if f.createVolumeResponse != nil { - log.Printf("volume name '%s' created\n", name) + log.Infof("volume name '%s' created\n", name) } return nil } @@ -2148,10 +2148,10 @@ func (f *feature) iCallCreateVolumeFromVolume(srcVolumeName, name string) error req = f.setVolumeContent(false, srcVolumeName) f.createVolumeResponse, f.err = f.service.CreateVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateVolume call failed: '%s'\n", f.err.Error()) + log.Infof("CreateVolume call failed: '%s'\n", f.err.Error()) } if f.createVolumeResponse != nil { - log.Printf("volume name '%s' created\n", name) + log.Infof("volume name '%s' created\n", name) } return nil } @@ -2205,7 +2205,7 @@ func (f *feature) aIsilonServiceWithParams(user, mode string) error { if f.server == nil { f.server = httptest.NewServer(handler) } - log.Printf("server url: %s\n", f.server.URL) + log.Infof("server url: %s\n", f.server.URL) clusterConfig.EndpointURL = f.server.URL } else { f.server = nil @@ -2268,7 +2268,7 @@ func (f *feature) aIsilonservicewithIsiAuthTypeassessionbased() error { if f.server == nil { f.server = httptest.NewServer(handler) } - log.Printf("server url: %s\n", f.server.URL) + log.Infof("server url: %s\n", f.server.URL) clusterConfig.EndpointURL = f.server.URL } else { f.server = nil @@ -2331,10 +2331,10 @@ func (f *feature) aIsilonServiceWithParamsForCustomTopology(user, mode string) e if f.server == nil { f.server = httptest.NewServer(handler) } - log.Printf("server url: %s\n", f.server.URL) + log.Infof("server url: %s\n", f.server.URL) clusterConfig.EndpointURL = f.server.URL urlList := strings.Split(f.server.URL, ":") - log.Printf("urlList: %v", urlList) + log.Infof("urlList: %v", urlList) clusterConfig.EndpointPort = urlList[2] } else { f.server = nil @@ -2398,10 +2398,10 @@ func (f *feature) aIsilonServiceWithParamsForCustomTopologyNoLabel(user, mode st if f.server == nil { f.server = httptest.NewServer(handler) } - log.Printf("server url: %s\n", f.server.URL) + log.Infof("server url: %s\n", f.server.URL) clusterConfig.EndpointURL = f.server.URL urlList := strings.Split(f.server.URL, ":") - log.Printf("urlList: %v", urlList) + log.Infof("urlList: %v", urlList) clusterConfig.EndpointPort = urlList[2] } else { f.server = nil @@ -2610,18 +2610,16 @@ func (f *feature) iCallBeforeServe() error { func (f *feature) iCallCreateQuotaInIsiServiceWithSizeInBytes(softLimit, advisoryLimit, softgraceprd string, sizeinBytes int) error { clusterConfig := f.service.getIsilonClusterConfig(clusterName1) - ctx, _, _ := GetRunIDLog(context.Background()) - _, f.err = clusterConfig.isiSvc.CreateQuota(ctx, f.service.opts.Path, "volume1", softLimit, advisoryLimit, softgraceprd, int64(sizeinBytes), true) + _, f.err = clusterConfig.isiSvc.CreateQuota(context.Background(), f.service.opts.Path, "volume1", softLimit, advisoryLimit, softgraceprd, int64(sizeinBytes), true) return nil } func (f *feature) iCallGetExportRelatedFunctionsInIsiService() error { clusterConfig := f.service.getIsilonClusterConfig(clusterName1) - ctx, _, _ := GetRunIDLog(context.Background()) - _, f.err = clusterConfig.isiSvc.GetExports(ctx) - _, f.err = clusterConfig.isiSvc.GetExportByIDWithZone(ctx, 557, "System") - f.err = clusterConfig.isiSvc.DeleteQuotaByExportIDWithZone(ctx, "volume1", 557, "System") - _, _, f.err = clusterConfig.isiSvc.GetExportsWithLimit(ctx, "2") + _, f.err = clusterConfig.isiSvc.GetExports(context.Background()) + _, f.err = clusterConfig.isiSvc.GetExportByIDWithZone(context.Background(), 557, "System") + f.err = clusterConfig.isiSvc.DeleteQuotaByExportIDWithZone(context.Background(), "volume1", 557, "System") + _, _, f.err = clusterConfig.isiSvc.GetExportsWithLimit(context.Background(), "2") return nil } @@ -2661,7 +2659,7 @@ func (f *feature) iCallNodeGetInfowithinvalidnetworks() error { req := new(csi.NodeGetInfoRequest) f.nodeGetInfoResponse, f.err = f.service.NodeGetInfo(context.Background(), req) if f.err != nil { - log.Printf("NodeGetInfo call failed: %s\n", f.err.Error()) + log.Infof("NodeGetInfo call failed: %s\n", f.err.Error()) return nil } return nil @@ -2687,7 +2685,7 @@ func (f *feature) iCallCreateRemoteVolume() error { f.createRemoteVolumeRequest = req f.createRemoteVolumeResponse, f.err = f.service.CreateRemoteVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateRemoteVolume call failed: %s\n", f.err.Error()) + log.Infof("CreateRemoteVolume call failed: %s\n", f.err.Error()) } if f.createRemoteVolumeResponse != nil { stepHandlersErrors.ExportNotFoundError = false @@ -2713,7 +2711,7 @@ func (f *feature) iCallCreateRemoteVolumeWithParams(volhand string, keyreplremsy f.createRemoteVolumeRequest = req f.createRemoteVolumeResponse, f.err = f.service.CreateRemoteVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateRemoteVolume call failed: %s\n", f.err.Error()) + log.Infof("CreateRemoteVolume call failed: %s\n", f.err.Error()) } if f.createRemoteVolumeResponse != nil { stepHandlersErrors.ExportNotFoundError = false @@ -2743,7 +2741,7 @@ func (f *feature) iCallDeleteLocalVolume() error { f.deleteLocalVolumeRequest = req f.deleteLocalVolumeResponse, f.err = f.service.DeleteLocalVolume(context.Background(), req) if f.err != nil { - log.Printf("DeleteLocalVolume call failed: %s\n", f.err.Error()) + log.Infof("DeleteLocalVolume call failed: %s\n", f.err.Error()) } return nil } @@ -2759,7 +2757,7 @@ func (f *feature) iCallDeleteLocalVolumeWithParams(volhandle string) error { f.deleteLocalVolumeRequest = req f.deleteLocalVolumeResponse, f.err = f.service.DeleteLocalVolume(context.Background(), req) if f.err != nil { - log.Printf("DeleteLocalVolume call failed: %s\n", f.err.Error()) + log.Infof("DeleteLocalVolume call failed: %s\n", f.err.Error()) } return nil } @@ -2778,7 +2776,7 @@ func (f *feature) iCallCreateStorageProtectionGroup() error { f.createStorageProtectionGroupRequest = req f.createStorageProtectionGroupResponse, f.err = f.service.CreateStorageProtectionGroup(context.Background(), req) if f.err != nil { - log.Printf("CreateStorageProtectionGroup call failed: %s\n", f.err.Error()) + log.Infof("CreateStorageProtectionGroup call failed: %s\n", f.err.Error()) } return nil } @@ -2797,7 +2795,7 @@ func (f *feature) iCallCreateStorageProtectionGroupWithParams(volhand string, ke f.createStorageProtectionGroupRequest = req f.createStorageProtectionGroupResponse, f.err = f.service.CreateStorageProtectionGroup(context.Background(), req) if f.err != nil { - log.Printf("CreateStorageProtectionGroup call failed: %s\n", f.err.Error()) + log.Infof("CreateStorageProtectionGroup call failed: %s\n", f.err.Error()) } return nil } @@ -2828,7 +2826,7 @@ func (f *feature) iCallStorageProtectionGroupDelete(volume, systemName, clustern f.deleteStorageProtectionGroupRequest = req f.deleteStorageProtectionGroupResponse, f.err = f.service.DeleteStorageProtectionGroup(context.Background(), req) if f.err != nil { - log.Printf("DeleteStorageProtectionGroup call failed: %s\n", f.err.Error()) + log.Infof("DeleteStorageProtectionGroup call failed: %s\n", f.err.Error()) } return nil } @@ -2845,7 +2843,7 @@ func (f *feature) iCallNodeGetInfoWithNoFQDN() error { f.service.nodeIP = "192.0.2.0" f.nodeGetInfoResponse, f.err = f.service.NodeGetInfo(context.Background(), req) if f.err != nil { - log.Printf("NodeGetInfo call failed: %s\n", f.err.Error()) + log.Infof("NodeGetInfo call failed: %s\n", f.err.Error()) return f.err } return nil @@ -2867,7 +2865,7 @@ func (f *feature) iCallGetStorageProtectionGroupStatus() error { f.getStorageProtectionGroupStatusRequest = req f.getStorageProtectionGroupStatusResponse, f.err = f.service.GetStorageProtectionGroupStatus(context.Background(), req) if f.err != nil { - log.Printf("GetStorageProtectionGroupStatus call failed: %s\n", f.err.Error()) + log.Infof("GetStorageProtectionGroupStatus call failed: %s\n", f.err.Error()) } return nil } @@ -2883,7 +2881,7 @@ func (f *feature) iCallGetReplicationCapabilities() error { req := new(csiext.GetReplicationCapabilityRequest) f.getReplicationCapabilityResponse, f.err = f.service.GetReplicationCapabilities(context.Background(), req) if f.err != nil { - log.Printf("GetReplicationCapabilities call failed: %s\n", f.err.Error()) + log.Infof("GetReplicationCapabilities call failed: %s\n", f.err.Error()) return f.err } return nil @@ -2905,7 +2903,7 @@ func (f *feature) iCallGetStorageProtectionGroupStatusWithParams(id, localSystem f.getStorageProtectionGroupStatusRequest = req f.getStorageProtectionGroupStatusResponse, f.err = f.service.GetStorageProtectionGroupStatus(context.Background(), req) if f.err != nil { - log.Printf("GetStorageProtectionGroupStatus call failed: %s\n", f.err.Error()) + log.Infof("GetStorageProtectionGroupStatus call failed: %s\n", f.err.Error()) } return nil } @@ -2936,7 +2934,7 @@ func (f *feature) iCallExecuteAction(systemName, clusterNameOne, clusterNameTwo, f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -2974,7 +2972,7 @@ func (f *feature) iCallExecuteActionSuspend() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3005,7 +3003,7 @@ func (f *feature) iCallExecuteActionReprotect() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3036,7 +3034,7 @@ func (f *feature) iCallExecuteActionSync() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3067,7 +3065,7 @@ func (f *feature) iCallExecuteActionSyncFailoverUnplanned() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3098,7 +3096,7 @@ func (f *feature) iCallExecuteActionFailback() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3129,7 +3127,7 @@ func (f *feature) iCallExecuteActionFailbackDiscard() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3160,7 +3158,7 @@ func (f *feature) iCallExecuteActionSyncFailover() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3170,7 +3168,7 @@ func (f *feature) iCallExecuteActionBad() error { f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("ExecuteAction call failed: %s\n", f.err.Error()) + log.Infof("ExecuteAction call failed: %s\n", f.err.Error()) } return nil } @@ -3204,7 +3202,7 @@ func (f *feature) iCallExecuteActionFailbackWithParams(systemName, clusterNameOn f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("iCallExecuteActionFailbackWithParams call failed: %s\n", f.err.Error()) + log.Infof("iCallExecuteActionFailbackWithParams call failed: %s\n", f.err.Error()) } return nil } @@ -3217,7 +3215,7 @@ func (f *feature) iCallExecuteActionFailbackDiscardWithParams(systemName, cluste f.executeActionRequest = req f.executeActionResponse, f.err = f.service.ExecuteAction(context.Background(), req) if f.err != nil { - log.Printf("iCallExecuteActionFailbackDiscardWithParams call failed: %s\n", f.err.Error()) + log.Infof("iCallExecuteActionFailbackDiscardWithParams call failed: %s\n", f.err.Error()) } return nil } @@ -3256,7 +3254,7 @@ func (f *feature) iCallCreateRemoteVolumeBad() error { f.createRemoteVolumeRequest = req f.createRemoteVolumeResponse, f.err = f.service.CreateRemoteVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateRemoteVolume call failed: %s\n", f.err.Error()) + log.Infof("CreateRemoteVolume call failed: %s\n", f.err.Error()) } if f.createRemoteVolumeResponse != nil { stepHandlersErrors.ExportNotFoundError = false @@ -3281,7 +3279,7 @@ func (f *feature) iCallCreateStorageProtectionGroupBad() error { f.createStorageProtectionGroupRequest = req f.createStorageProtectionGroupResponse, f.err = f.service.CreateStorageProtectionGroup(context.Background(), req) if f.err != nil { - log.Printf("CreateStorageProtectionGroup call failed: %s\n", f.err.Error()) + log.Infof("CreateStorageProtectionGroup call failed: %s\n", f.err.Error()) } return nil } @@ -3353,7 +3351,7 @@ func (f *feature) iCallValidateVolumeHostConnectivity() error { f.err = errors.New(err.Error()) return nil } - log.Printf("Node id is: %v", csiNodeID) + log.Infof("Node id is: %v", csiNodeID) volIDs := make([]string, 0) @@ -3445,21 +3443,21 @@ func (f *feature) iCallProbeController() error { } func (f *feature) iCallDynamicLogChange(file string) error { - log.Printf("level before change: %s", logging.GetCurrentLogLevel()) + log.Infof("level before change: %s", csmlog.GetLevel()) DriverConfigParamsFile = "mock/loglevel/" + file - log.Printf("wait for config change %s", DriverConfigParamsFile) + log.Infof("wait for config change %s", DriverConfigParamsFile) f.iCallBeforeServe() time.Sleep(10 * time.Second) return nil } func (f *feature) aValidDynamicLogChangeOccurs(_, expectedLevel string) error { - log.Printf("level after change: %s", logging.GetCurrentLogLevel()) - if logging.GetCurrentLogLevel().String() != expectedLevel { - err := fmt.Errorf("level was expected to be %s, but was %s instead", expectedLevel, logging.GetCurrentLogLevel().String()) + log.Infof("level after change: %s", csmlog.GetLevel()) + if csmlog.GetLevel().String() != expectedLevel { + err := fmt.Errorf("level was expected to be %s, but was %s instead", expectedLevel, csmlog.GetLevel().String()) return err } - log.Printf("Reverting log changes made") + log.Infof("Reverting log changes made") DriverConfigParamsFile = "mock/loglevel/logConfig.yaml" f.iCallBeforeServe() time.Sleep(10 * time.Second) @@ -3473,10 +3471,9 @@ func (f *feature) iSetNoProbeOnStart(value string) error { func (f *feature) iCallGetSnapshotNameFromIsiPathWith(exportPath string) error { clusterConfig := f.service.getIsilonClusterConfig(clusterName1) - ctx, _, _ := GetRunIDLog(context.Background()) - _, f.err = clusterConfig.isiSvc.GetSnapshotNameFromIsiPath(ctx, exportPath, "System", "/ifs") + _, f.err = clusterConfig.isiSvc.GetSnapshotNameFromIsiPath(context.Background(), exportPath, "System", "/ifs") if f.err != nil { - log.Printf("inside iCallGetSnapshotNameFromIsiPath error %s\n", f.err.Error()) + log.Infof("inside iCallGetSnapshotNameFromIsiPath error %s\n", f.err.Error()) } return nil } @@ -3490,17 +3487,15 @@ func (f *feature) iCallGetSnapshotIsiPathComponents() error { func (f *feature) iCallGetSubDirectoryCount() error { clusterConfig := f.service.getIsilonClusterConfig(clusterName1) - ctx, _, _ := GetRunIDLog(context.Background()) - _, _ = clusterConfig.isiSvc.GetSubDirectoryCount(ctx, "/ifs/data/csi-isilon", "csi-isilon") + _, _ = clusterConfig.isiSvc.GetSubDirectoryCount(context.Background(), "/ifs/data/csi-isilon", "csi-isilon") return nil } func (f *feature) iCallDeleteSnapshotIsiService() error { clusterConfig := f.service.getIsilonClusterConfig(clusterName1) - ctx, _, _ := GetRunIDLog(context.Background()) - f.err = clusterConfig.isiSvc.DeleteSnapshot(ctx, 64, "") + f.err = clusterConfig.isiSvc.DeleteSnapshot(context.Background(), 64, "") if f.err != nil { - log.Printf("inside iCallDeleteSnapshotIsiService error %s\n", f.err.Error()) + log.Infof("inside iCallDeleteSnapshotIsiService error %s\n", f.err.Error()) } return nil } @@ -3634,10 +3629,10 @@ func (f *feature) iCallCreateROVolumeFromSnapshot(name string) error { req.Name = name f.createVolumeResponse, f.err = f.service.CreateVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateVolume call failed: %s\n", f.err.Error()) + log.Infof("CreateVolume call failed: %s\n", f.err.Error()) } if f.createVolumeResponse != nil { - log.Printf("volume name '%s' created\n", name) + log.Infof("volume name '%s' created\n", name) } return nil } @@ -3647,13 +3642,13 @@ func (f *feature) iCallCreateVolumeFromSnapshotMultiReader(srcSnapshotID, name s f.createVolumeRequest = req req.Name = name req = f.setVolumeContent(true, srcSnapshotID) - log.Printf("called iCallCreateVolumeFromSnapshotMultiReader") + log.Infof("called iCallCreateVolumeFromSnapshotMultiReader") f.createVolumeResponse, f.err = f.service.CreateVolume(context.Background(), req) if f.err != nil { - log.Printf("CreateVolume call failed: '%s'\n", f.err.Error()) + log.Infof("CreateVolume call failed: '%s'\n", f.err.Error()) } if f.createVolumeResponse != nil { - log.Printf("volume name '%s' created\n", name) + log.Infof("volume name '%s' created\n", name) } return nil } @@ -3666,11 +3661,9 @@ func (f *feature) iCallDeleteVolumeFromSnapshot(id string) error { req := f.deleteVolumeRequest req.VolumeId = id - ctx, log, _ := GetRunIDLog(context.Background()) - - f.deleteVolumeResponse, f.err = f.service.DeleteVolume(ctx, req) + f.deleteVolumeResponse, f.err = f.service.DeleteVolume(context.Background(), req) if f.err != nil { - log.Printf("DeleteVolume call failed: '%v'\n", f.err) + log.Infof("DeleteVolume call failed: '%v'\n", f.err) } return nil } @@ -3683,7 +3676,7 @@ func (f *feature) aValidDeleteSnapshotResponseIsReturned() error { } func (f *feature) iCallControllerPublishVolumeOnSnapshot(volID, accessMode, nodeID, path string) error { - log.Printf("iCallControllerPublishVolume called with %s and %s", accessMode, nodeID) + log.Infof("iCallControllerPublishVolume called with %s and %s", accessMode, nodeID) header := metadata.New(map[string]string{"csi.requestid": "1"}) ctx := metadata.NewIncomingContext(context.Background(), header) req := f.publishVolumeRequest @@ -3697,10 +3690,10 @@ func (f *feature) iCallControllerPublishVolumeOnSnapshot(volID, accessMode, node req.VolumeId = volID } - log.Printf("Calling controllerPublishVolume with request %v", req) + log.Infof("Calling controllerPublishVolume with request %v", req) f.publishVolumeResponse, f.err = f.service.ControllerPublishVolume(ctx, req) if f.err != nil { - log.Printf("PublishVolume call failed: %s\n", f.err.Error()) + log.Infof("PublishVolume call failed: %s\n", f.err.Error()) } f.publishVolumeRequest = nil return nil @@ -3754,7 +3747,7 @@ func (f *feature) iCallQueryArrayStatus(apiPort string) error { url := "http://" + "127.0.0.1:" + apiPort + arrayStatus + "/" + "cluster1" _, err := f.service.queryArrayStatus(ctx, url) if err != nil { - log.Printf("queryArrayStatus failed: %s", err) + log.Infof("queryArrayStatus failed: %s", err) } return nil } diff --git a/service/step_handlers_test.go b/service/step_handlers_test.go index ec6c5dc8..5ca15b1f 100644 --- a/service/step_handlers_test.go +++ b/service/step_handlers_test.go @@ -26,11 +26,10 @@ import ( "sync" "time" - "github.com/dell/csi-isilon/v2/service/mock/k8s" + "github.com/dell/csi-powerscale/v2/service/mock/k8s" - isiapi "github.com/dell/goisilon/api" + isiapi "github.com/dell/gopowerscale/api" "github.com/gorilla/mux" - log "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" ) @@ -128,7 +127,7 @@ var ( func getHandler() http.Handler { handler := http.HandlerFunc( func(w http.ResponseWriter, r *http.Request) { - log.Printf("handler called: %s %s", r.Method, r.URL) + log.Infof("handler called: %s %s", r.Method, r.URL) if isilonRouter == nil { getRouter().ServeHTTP(w, r) } @@ -657,7 +656,7 @@ func writeError(w http.ResponseWriter, message string, httpStatus int, _ codes.C encoder := json.NewEncoder(w) err := encoder.Encode(resp) if err != nil { - log.Printf("error encoding json: %s\n", err.Error()) + log.Infof("error encoding json: %s\n", err.Error()) } } @@ -1172,15 +1171,15 @@ func MockK8sAPI() { } func noderesponse(w http.ResponseWriter, req *http.Request) { - log.Printf("request in noderesponse -> %+v", req) + log.Infof("request in noderesponse -> %+v", req) param1 := req.URL.Query().Get("nodeId") fakeNode := k8s.GetFakeNode() fn, err := json.Marshal(fakeNode) if err != nil { fmt.Printf("Error fake node: %s", err) } - log.Printf("wrote fn for %v", param1) - log.Printf("labels sent were %+v", fakeNode.GetLabels()) + log.Infof("wrote fn for %v", param1) + log.Infof("labels sent were %+v", fakeNode.GetLabels()) w.Header().Add("Content-Type", "application/json") w.Header().Add("Content-Type", "v=v1") w.Write(fn) diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index 0a12d1c1..21df9453 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -24,14 +24,14 @@ import ( "testing" "time" + "github.com/dell/csi-powerscale/v2/common/constants" + "github.com/dell/csi-powerscale/v2/common/k8sutils" "github.com/Showmax/go-fqdn" - "github.com/dell/csi-isilon/v2/common/constants" - "github.com/dell/csi-isilon/v2/common/k8sutils" + "github.com/dell/csi-powerscale/v2/provider" + csiutils "github.com/dell/gocsi/utils/csi" csi "github.com/container-storage-interface/spec/lib/go/csi" "github.com/cucumber/godog" - "github.com/dell/csi-isilon/v2/provider" - csiutils "github.com/dell/gocsi/utils/csi" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/integration/step_defs_test.go b/test/integration/step_defs_test.go index f21e9ab8..58eaaee1 100644 --- a/test/integration/step_defs_test.go +++ b/test/integration/step_defs_test.go @@ -27,17 +27,17 @@ import ( "strings" "time" + "github.com/dell/csi-powerscale/v2/common/constants" + fromctx "github.com/dell/csi-powerscale/v2/common/utils/fromcontext" + ident "github.com/dell/csi-powerscale/v2/common/utils/identifiers" + isilonfs "github.com/dell/csi-powerscale/v2/common/utils/powerscale-fs" + strutil "github.com/dell/csi-powerscale/v2/common/utils/string-utils" + csiutils "github.com/dell/csi-powerscale/v2/csi-utils" + "github.com/dell/csi-powerscale/v2/service" + isi "github.com/dell/gopowerscale" + apiv1 "github.com/dell/gopowerscale/api/v1" csi "github.com/container-storage-interface/spec/lib/go/csi" "github.com/cucumber/godog" - "github.com/dell/csi-isilon/v2/common/constants" - fromctx "github.com/dell/csi-isilon/v2/common/utils/fromcontext" - ident "github.com/dell/csi-isilon/v2/common/utils/identifiers" - isilonfs "github.com/dell/csi-isilon/v2/common/utils/powerscale-fs" - strutil "github.com/dell/csi-isilon/v2/common/utils/string-utils" - csiutils "github.com/dell/csi-isilon/v2/csi-utils" - "github.com/dell/csi-isilon/v2/service" - isi "github.com/dell/goisilon" - apiv1 "github.com/dell/goisilon/api/v1" "gopkg.in/yaml.v3" ) @@ -154,7 +154,6 @@ func (f *feature) aBasicVolumeRequest(name string, size int64) error { func (f *feature) iCallCreateVolume() error { time.Sleep(RetrySleepTime) ctx := context.Background() - ctx, _, _ = service.GetRunIDLog(ctx) volResp, err := f.createVolume(f.createVolumeRequest) if err != nil { fmt.Printf("CreateVolume: '%s'\n", err.Error()) @@ -619,7 +618,6 @@ func (f *feature) checkNodeExistsForOneExport(am *csi.VolumeCapability_AccessMod func (f *feature) checkIsilonClientExistsForOneExport(nodeIP string, exportID int, accessZone string) error { isiClient, _ = createIsilonClient() ctx := context.Background() - ctx, _, _ = service.GetRunIDLog(ctx) export, _ := isiClient.GetExportByIDWithZone(ctx, exportID, accessZone) if export == nil { panic(fmt.Sprintf("failed to get export by id '%d' and zone '%s'\n", exportID, accessZone)) @@ -691,7 +689,6 @@ func (f *feature) nodeUnstageVolume(req *csi.NodeUnstageVolumeRequest) error { func (f *feature) checkIsilonClientNotExistsForOneExport(nodeIP string, exportID int, accessZone string) error { isiClient, _ = createIsilonClient() ctx := context.Background() - ctx, _, _ = service.GetRunIDLog(ctx) export, _ := isiClient.GetExportByIDWithZone(ctx, exportID, accessZone) if export == nil { panic(fmt.Sprintf("failed to get export by id '%d' and zone '%s'\n", exportID, accessZone)) @@ -1065,7 +1062,6 @@ func (f *feature) iCallCreateVolumeFromVolume(newVolume, srcVolume string, size func (f *feature) createAVolume(req *csi.CreateVolumeRequest, voltype string) error { time.Sleep(SleepTime) ctx := context.Background() - ctx, _, _ = service.GetRunIDLog(ctx) client := csi.NewControllerClient(grpcClient) volResp, err := client.CreateVolume(ctx, req) if err != nil { @@ -1148,7 +1144,6 @@ func (f *feature) getMountVolumeRequest(name string) *csi.CreateVolumeRequest { func (f *feature) iCreateVolumesInParallel(nVols int) error { ctx := context.Background() - ctx, _, _ = service.GetRunIDLog(ctx) idchan := make(chan string, nVols) errchan := make(chan error, nVols) t0 := time.Now() @@ -1305,7 +1300,6 @@ func (f *feature) iNodeStageVolumesInParallel(nVols int) error { func (f *feature) checkIsilonClientsExist(nVols int) error { ctx := context.Background() - ctx, _, _ = service.GetRunIDLog(ctx) for i := 0; i < nVols; i++ { volName := fmt.Sprintf("scale%d", i) volID := f.volNameID[volName] @@ -1321,7 +1315,6 @@ func (f *feature) checkIsilonClientsExist(nVols int) error { func (f *feature) checkIsilonClientsNotExist(nVols int) error { ctx := context.Background() - ctx, _, _ = service.GetRunIDLog(ctx) for i := 0; i < nVols; i++ { volName := fmt.Sprintf("scale%d", i) volID := f.volNameID[volName]