diff --git a/internal/resources/akscluster/akscluster_mapper.go b/internal/resources/akscluster/akscluster_mapper.go index 3e7d4451a..815982c07 100644 --- a/internal/resources/akscluster/akscluster_mapper.go +++ b/internal/resources/akscluster/akscluster_mapper.go @@ -290,12 +290,6 @@ func constructNetworkConfig(data []any) (*models.VmwareTanzuManageV1alpha1Aksclu networkConfig.PodCidrs = helper.SetPrimitiveList[string](v.([]any)) } - // Validation. DNS Server Ip or service CIDR cannot be set is network plugin is 'kubenet' - //TODO: this does not look like a valid requirement so far. Need an extra check - //if networkConfig.NetworkPlugin == "kubenet" && (networkConfig.DNSServiceIP != "" || networkConfig.ServiceCidrs != nil) { - // return networkConfig, errors.New("can not set network_config.dns_service_ip or network_config.service_cidr when network_config.network_plugin is set to kubenet") - //} - return networkConfig, nil } diff --git a/internal/resources/akscluster/akscluster_mapper_test.go b/internal/resources/akscluster/akscluster_mapper_test.go index 2d4acc6b8..74de0eb3e 100644 --- a/internal/resources/akscluster/akscluster_mapper_test.go +++ b/internal/resources/akscluster/akscluster_mapper_test.go @@ -27,21 +27,6 @@ func Test_ConstructAKSCluster(t *testing.T) { assert.Equal(t, expected.Spec, result.Spec, "unexpected spec") } -func Test_ConstructAKSCluster_withInvalidNetworkConfig(t *testing.T) { - t.Skip("Skip before we are sure that we have a valid requirements") - tests := []*schema.ResourceData{ - schema.TestResourceDataRaw(t, akscluster.ClusterSchema, aTestClusterDataMap(withNetworkPlugin("kubenet"))), - schema.TestResourceDataRaw(t, akscluster.ClusterSchema, aTestClusterDataMap(withNetworkPlugin("kubenet"), withoutNetworkDNSServiceIP)), - schema.TestResourceDataRaw(t, akscluster.ClusterSchema, aTestClusterDataMap(withNetworkPlugin("kubenet"), withoutNetworkServiceCIDR)), - } - - for _, d := range tests { - _, err := akscluster.ConstructCluster(d) - assert.NotNil(t, err) - assert.Equal(t, err.Error(), "can not set network_config.dns_service_ip or network_config.service_cidr when network_config.network_plugin is set to kubenet") - } -} - func Test_FlattenToMap_nilSpec(t *testing.T) { got := akscluster.ToAKSClusterMap(nil, nil) assert.Equal(t, []any{}, got)