github.com/openshift/installer@v1.4.17/pkg/asset/machines/ibmcloud/zones.go (about)

     1  package ibmcloud
     2  
     3  import (
     4  	"context"
     5  
     6  	configv1 "github.com/openshift/api/config/v1"
     7  	"github.com/openshift/installer/pkg/asset/installconfig/ibmcloud"
     8  )
     9  
    10  // AvailabilityZones returns a list of supported zones for the specified region.
    11  func AvailabilityZones(region string, serviceEndpoints []configv1.IBMCloudServiceEndpoint) ([]string, error) {
    12  	ctx := context.TODO()
    13  
    14  	client, err := ibmcloud.NewClient(serviceEndpoints)
    15  	if err != nil {
    16  		return nil, err
    17  	}
    18  
    19  	return client.GetVPCZonesForRegion(ctx, region)
    20  }