mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Querry candidate zones for EBS when zone/zones not passed
Signed-off-by: Deep Debroy <ddebroy@docker.com>
This commit is contained in:
parent
3994829cb0
commit
11821e23b4
@ -2127,13 +2127,13 @@ func (c *Cloud) DetachDisk(diskName KubernetesVolumeID, nodeName types.NodeName)
|
||||
|
||||
// CreateDisk implements Volumes.CreateDisk
|
||||
func (c *Cloud) CreateDisk(volumeOptions *VolumeOptions) (KubernetesVolumeID, error) {
|
||||
allZones, err := c.getCandidateZonesForDynamicVolume()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error querying for all zones: %v", err)
|
||||
}
|
||||
|
||||
var createAZ string
|
||||
if !volumeOptions.ZonePresent && !volumeOptions.ZonesPresent {
|
||||
// querry for candidate zones only if zone parameters absent
|
||||
allZones, err := c.getCandidateZonesForDynamicVolume()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error querying for all zones: %v", err)
|
||||
}
|
||||
createAZ = volumeutil.ChooseZoneForVolume(allZones, volumeOptions.PVCName)
|
||||
}
|
||||
if !volumeOptions.ZonePresent && volumeOptions.ZonesPresent {
|
||||
|
Loading…
Reference in New Issue
Block a user