@@ -50,6 +50,12 @@ func (envConfig *CloudEnvironmentConfig) QuickValidateConfig(ctx context.Context
5050 hasCompatibilityMode := false
5151 hasBuiltInDomain := false
5252 for _ , org := range envConfig .Organizations {
53+ if _ , ok := orgNames [org .Name ]; ok {
54+ validationError (ctx , & success , "Organization names must be unique" )
55+ continue
56+ }
57+
58+ orgNames [org .Name ] = nil
5359 if org .SingleOrganizationCompatibilityMode {
5460 if hasCompatibilityMode {
5561 validationError (ctx , & success , "Only one organization can have `singleOrganizationCompatibilityMode` set to true" )
@@ -76,13 +82,7 @@ func (envConfig *CloudEnvironmentConfig) QuickValidateConfig(ctx context.Context
7682 hasBuiltInDomain = true
7783 }
7884
79- if _ , ok := orgNames [org .Name ]; ok {
80- validationError (ctx , & success , "Organization names must be unique" )
81- }
82-
83- orgNames [org .Name ] = nil
84-
85- if ! hasBuiltInDomain && envConfig .Cloud .Compute .DnsLabel == "" {
85+ if ! envConfig .Cloud .PrivateNetworking && ! hasBuiltInDomain && envConfig .Cloud .Compute .DnsLabel == "" {
8686 validationError (ctx , & success , "`cloud.compute.dnsLabel` must be set" )
8787 }
8888
@@ -251,6 +251,15 @@ func quickValidateComputeConfig(ctx context.Context, success *bool, cloudConfig
251251 validationError (ctx , success , "The `objectId` field must be a GUID" )
252252 }
253253 }
254+
255+ if cloudConfig .PrivateNetworking {
256+ if cloudConfig .Compute .DnsLabel != "" {
257+ validationError (ctx , success , "`cloud.compute.dnsLabel` must not be set when `cloud.privateNetworking` is enabled" )
258+ }
259+ if cloudConfig .DnsZone != nil && cloudConfig .DnsZone .Name != "" {
260+ validationError (ctx , success , "`cloud.dnsZone` must not be set when `cloud.privateNetworking` is enabled" )
261+ }
262+ }
254263}
255264
256265func quickValidateNodePoolConfig (ctx context.Context , success * bool , np * NodePoolConfig , minNodeCount int ) {
0 commit comments