Skip to content

Commit

Permalink
fix: disable azure byon (#87)
Browse files Browse the repository at this point in the history
## Motivation
Disable for now until we supported it.
  • Loading branch information
maxsxu authored Dec 7, 2024
1 parent e8ee73b commit d6e32bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cloud/resource_cloud_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func resourceCloudEnvironment() *schema.Resource {
"network": {
Type: schema.TypeList,
Required: true,
MaxItems: 1,
Description: descriptions["network"],
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -254,6 +255,16 @@ func resourceCloudEnvironmentCreate(ctx context.Context, d *schema.ResourceData,
return diag.FromErr(fmt.Errorf("ERROR_CREATE_CLOUD_ENVIRONMENT: " + "One of network.id or network.cidr must be set"))
}

if cloudEnvironment.Spec.Network.ID != "" {
cc, err := clientSet.CloudV1alpha1().CloudConnections(namespace).Get(ctx, cloudConnectionName, metav1.GetOptions{})
if err != nil {
return diag.FromErr(err)
}
if cc.Spec.ConnectionType == cloudv1alpha1.ConnectionTypeAzure {
return diag.FromErr(fmt.Errorf("ERROR_CREATE_CLOUD_ENVIRONMENT: Azure doesn't support specify network id yet. Please use network cidr"))
}
}

expandDns := func() error {
for _, l := range dns {
if l == nil {
Expand Down

0 comments on commit d6e32bc

Please sign in to comment.