From e834b8e6cfc29a25e3174d9722aa7c9412692be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?p=C3=BDrus?= Date: Fri, 27 Sep 2024 14:58:57 +0200 Subject: [PATCH] fix global config requirement for node-service --- pkg/csi/cinder/openstack/openstack.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/csi/cinder/openstack/openstack.go b/pkg/csi/cinder/openstack/openstack.go index 6bcfe43762..4cccd2fb98 100644 --- a/pkg/csi/cinder/openstack/openstack.go +++ b/pkg/csi/cinder/openstack/openstack.go @@ -176,8 +176,8 @@ func CreateOpenStackProvider(cloudName string, noClient bool) (IOpenStack, error return nil, err } logcfg(cfg) - _, cloudNameDefined := cfg.Global[cloudName] - if !cloudNameDefined { + global := cfg.Global[cloudName] + if global == nil && !noClient { return nil, fmt.Errorf("GetConfigFromFiles cloud name \"%s\" not found in configuration files: %s", cloudName, configFiles) } @@ -196,14 +196,14 @@ func CreateOpenStackProvider(cloudName string, noClient bool) (IOpenStack, error return NoopInstances[cloudName], nil } - provider, err := client.NewOpenStackClient(cfg.Global[cloudName], "cinder-csi-plugin", userAgentData...) + provider, err := client.NewOpenStackClient(global, "cinder-csi-plugin", userAgentData...) if err != nil { return nil, err } epOpts := gophercloud.EndpointOpts{ - Region: cfg.Global[cloudName].Region, - Availability: cfg.Global[cloudName].EndpointType, + Region: global.Region, + Availability: global.EndpointType, } // Init Nova ServiceClient