Unverified Commit 7f23a743 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #65258 from ddebroy/ddebroy-ebs1

Automatic merge from submit-queue (batch tested with PRs 65164, 65258). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Query candidate zones for EBS when zone/zones not passed **What this PR does / why we need it**: This PR skips invoking `getCandidateZonesForDynamicVolume` to query EC2 zones of instances when zone/zones is present. /sig storage **Release note**: ``` none ```
parents db80cdf3 11821e23
...@@ -2134,13 +2134,13 @@ func (c *Cloud) DetachDisk(diskName KubernetesVolumeID, nodeName types.NodeName) ...@@ -2134,13 +2134,13 @@ func (c *Cloud) DetachDisk(diskName KubernetesVolumeID, nodeName types.NodeName)
// CreateDisk implements Volumes.CreateDisk // CreateDisk implements Volumes.CreateDisk
func (c *Cloud) CreateDisk(volumeOptions *VolumeOptions) (KubernetesVolumeID, error) { 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 var createAZ string
if !volumeOptions.ZonePresent && !volumeOptions.ZonesPresent { 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) createAZ = volumeutil.ChooseZoneForVolume(allZones, volumeOptions.PVCName)
} }
if !volumeOptions.ZonePresent && volumeOptions.ZonesPresent { if !volumeOptions.ZonePresent && volumeOptions.ZonesPresent {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment