Skip to content

Commit

Permalink
fix global config requirement for node-service (#2683)
Browse files Browse the repository at this point in the history
Co-authored-by: pýrus <[email protected]>
  • Loading branch information
k8s-infra-cherrypick-robot and kayrus authored Oct 1, 2024
1 parent 05bbdfe commit d87b745
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 d87b745

Please sign in to comment.