Skip to content

Commit

Permalink
[cinder-csi-plugin]: fix global config requirement for node-service (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kayrus authored Oct 1, 2024
1 parent d069b1e commit 333a126
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/csi/cinder/openstack/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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
Expand Down

0 comments on commit 333a126

Please sign in to comment.