Skip to content

Commit

Permalink
Add dynamic test
Browse files Browse the repository at this point in the history
  • Loading branch information
gemmahou committed Jun 25, 2024
1 parent c23ad31 commit 1ef07ff
Show file tree
Hide file tree
Showing 10 changed files with 311 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
- external
properties:
external:
description: 'Allowed value: string of the format `projects/{{project}}/locations/global/certificates/{{value}}`,
description: 'Allowed value: string of the format `projects/{{project}}/locations/{{location}}/certificates/{{value}}`,
where {{value}} is the `name` field of a `CertificateManagerCertificate`
resource.'
type: string
Expand All @@ -96,7 +96,10 @@ spec:
description: |-
A reference to the CertificateMap resource uri that identifies a
certificate map associated with the given target proxy. This field
can only be set for global target proxies.
can only be set for global target proxies. This field is only supported
for EXTERNAL and EXTERNAL_MANAGED load balancing schemes.
For INTERNAL_MANAGED, use certificateManagerCertificates instead.
sslCertificates and CertificateMap fields can not be defined together.
oneOf:
- not:
required:
Expand Down Expand Up @@ -185,7 +188,7 @@ spec:
- external
properties:
external:
description: 'Allowed value: string of the format `projects/{{project}}/locations/global/serverTlsPolicies/{{value}}`,
description: 'Allowed value: string of the format `projects/{{project}}/locations/{{location}}/serverTlsPolicies/{{value}}`,
where {{value}} is the `name` field of a `NetworkSecurityServerTLSPolicy`
resource.'
type: string
Expand Down
9 changes: 6 additions & 3 deletions config/servicemappings/compute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2446,7 +2446,7 @@ spec:
kind: CertificateManagerCertificate
version: v1beta1
group: certificatemanager.cnrm.cloud.google.com
valueTemplate: projects/{{project}}/locations/global/certificates/{{value}}
valueTemplate: projects/{{project}}/locations/{{location}}/certificates/{{value}}
- tfField: ssl_certificates
description: |-
A list of ComputeSSLCertificate resources that are used to
Expand Down Expand Up @@ -2474,7 +2474,10 @@ spec:
description: |-
A reference to the CertificateMap resource uri that identifies a
certificate map associated with the given target proxy. This field
can only be set for global target proxies.
can only be set for global target proxies. This field is only supported
for EXTERNAL and EXTERNAL_MANAGED load balancing schemes.
For INTERNAL_MANAGED, use certificateManagerCertificates instead.
sslCertificates and CertificateMap fields can not be defined together.
gvk:
kind: CertificateManagerCertificateMap
version: v1beta1
Expand All @@ -2496,7 +2499,7 @@ spec:
kind: NetworkSecurityServerTLSPolicy
version: v1beta1
group: networksecurity.cnrm.cloud.google.com
valueTemplate: "projects/{{project}}/locations/global/serverTlsPolicies/{{value}}"
valueTemplate: "projects/{{project}}/locations/{{location}}/serverTlsPolicies/{{value}}"
dclBasedResource: true
containers:
- type: project
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeTargetHTTPSProxy
metadata:
name: computetargethttpsproxy-${uniqueId}
spec:
description: "test description"
urlMapRef:
name: computeurlmap-${uniqueId}
certificateManagerCertificates:
- name: certificatemanagercertificates-${uniqueId}
quicOverride: DISABLE
location: global
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeHealthCheck
metadata:
name: computehealthcheck-${uniqueId}
spec:
checkIntervalSec: 10
httpHealthCheck:
port: 80
location: global
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeBackendService
metadata:
name: computebackendservice-${uniqueId}
spec:
healthChecks:
- healthCheckRef:
name: computehealthcheck-${uniqueId}
location: global
loadBalancingScheme: "INTERNAL_MANAGED"
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeURLMap
metadata:
name: computeurlmap-${uniqueId}
spec:
defaultService:
backendServiceRef:
name: computebackendservice-${uniqueId}
location: global
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeURLMap
metadata:
name: computeurlmap-2-${uniqueId}
spec:
defaultService:
backendServiceRef:
name: computebackendservice-${uniqueId}
location: global
---
apiVersion: v1
kind: Secret
metadata:
name: secret-${uniqueId}
stringData:
privateKey: |
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC85P3bkYbiUpX0
e8Aext5wyEY8CqOFVELbqJlQkLyhJY673mVYlJflmFuIXo3PX3bAMZX9UCHcvGPx
Fi1yfvl4PFApNwqi4OV35OgIYhK08VZtHqtvKwu5moVURdU5O+nZAh6Aid+u+cYL
iPtCmJzvOsUH0fMnH7Qel4TI7iCR3Ml8Qr+AyaiVSAmspfn2j7T5GP4mrcS1xDEv
V9UFUlLHQ2+mhHV5imccyv+skpmRRRnbETzqGu2mI/o4RhBOLTSuZ/gadkXlB8YY
PTG6hBe1HtO75eEqJtciHFwPhHM8tfVBLTjQ9e+Yw8sNvhiVRDpXdGzjYkO+SQPA
gxdm+fxrAgMBAAECggEAV4/A24TQpV4KFBw/WSTvnRFBeXinB1mhamhztWR6hCrA
SPcVPKQY632eRI8sJmpGxl3V/Ogl4khT/cA9jfstEl7G++v/WrRsupCaPLSVnlnX
KdsTNgOauk1WK9P5PMA4rPcuA4Cl91riQpubeWn8KWsxRWg90i+Ak8PB8lBsOaB1
QzjigWlrRWSpodaw0MBIMZFDL2BYK8H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atemanager.cnrm.cloud.google.com/v1beta1
kind: CertificateManagerCertificate
metadata:
name: certificatemanagercertificates-${uniqueId}
spec:
scope: "ALL_REGIONS"
location : "global"
projectRef:
external: ${projectId}
description: ALL_REGIONS scoped self-managed certificate
selfManaged:
pemCertificate: |-
-----BEGIN CERTIFICATE-----
MIIDDzCCAfegAwIBAgIUDOiCLH9QNMMYnjPZVf4VwO9blsEwDQYJKoZIhvcNAQEL
BQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wIBcNMjIwODI0MDg0MDUxWhgPMzAy
MTEyMjUwODQwNTFaMBYxFDASBgNVBAMMC2V4YW1wbGUuY29tMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvOT925GG4lKV9HvAHsbecMhGPAqjhVRC26iZ
UJC8oSWOu95lWJSX5ZhbiF6Nz192wDGV/VAh3Lxj8RYtcn75eDxQKTcKouDld+To
CGIStPFWbR6rbysLuZqFVEXVOTvp2QIegInfrvnGC4j7Qpic7zrFB9HzJx+0HpeE
yO4gkdzJfEK/gMmolUgJrKX59o+0+Rj+Jq3EtcQxL1fVBVJSx0NvpoR1eYpnHMr/
rJKZkUUZ2xE86hrtpiP6OEYQTi00rmf4GnZF5QfGGD0xuoQXtR7Tu+XhKibXIhxc
D4RzPLX1QS040PXvmMPLDb4YlUQ6V3Rs42JDvkkDwIMXZvn8awIDAQABo1MwUTAd
BgNVHQ4EFgQURuo1CCZZAUv7xi02f2nC5tRbf18wHwYDVR0jBBgwFoAURuo1CCZZ
AUv7xi02f2nC5tRbf18wDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC
AQEAqx3tDxurnYr9EUPhF5/LlDPYM+VI7EgrKdRnuIqUlZI0tm3vOGME0te6dBTC
YLNaHLW3m/4Tm4M2eg0Kpz6CxJfn3109G31dCi0xwzSDHf5TPUWvqIVhq5WRgMIf
n8KYBlQSmqdJBRztUIQH/UPFnSbxymlS4s5qwDgTH5ag9EEBcnWsQ2LZjKi0eqve
MaqAvvB+j8RGZzYY4re94bSJI42zIZ6nMWPtXwRuDc30xl/u+E0jWIgWbPwSd6Km
3wnJnGiU2ezPGq3zEU+Rc39VVIFKQpciNeYuF3neHPJvYOf58qW2Z8s0VH0MR1x3
3DoO/e30FIr9j+PRD+s5BPKF2A==
-----END CERTIFICATE-----
pemPrivateKey:
valueFrom:
secretKeyRef:
name: secret-${uniqueId}
key: privateKey
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeTargetHTTPSProxy
metadata:
name: computetargethttpsproxy-${uniqueId}
spec:
description: "test description"
urlMapRef:
name: computeurlmap-2-${uniqueId}
certificateManagerCertificates:
- name: certificatemanagercertificates-${uniqueId}
quicOverride: ENABLE
location: global
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeTargetHTTPSProxy
metadata:
name: computetargethttpsproxy-${uniqueId}
spec:
description: "test description"
urlMapRef:
name: computeurlmap-${uniqueId}
certificateMapRef:
name: certificatemap-${uniqueId}
quicOverride: DISABLE
location: global
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeHealthCheck
metadata:
name: computehealthcheck-${uniqueId}
spec:
checkIntervalSec: 10
httpHealthCheck:
port: 80
location: global
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeBackendService
metadata:
name: computebackendservice-${uniqueId}
spec:
healthChecks:
- healthCheckRef:
name: computehealthcheck-${uniqueId}
location: global
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeURLMap
metadata:
name: computeurlmap-${uniqueId}
spec:
defaultService:
backendServiceRef:
name: computebackendservice-${uniqueId}
location: global
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeURLMap
metadata:
name: computeurlmap-2-${uniqueId}
spec:
defaultService:
backendServiceRef:
name: computebackendservice-${uniqueId}
location: global
---
apiVersion: certificatemanager.cnrm.cloud.google.com/v1beta1
kind: CertificateManagerCertificateMap
metadata:
name: certificatemap-${uniqueId}
spec:
projectRef:
external: ${projectId}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeTargetHTTPSProxy
metadata:
name: computetargethttpsproxy-${uniqueId}
spec:
description: "test description"
urlMapRef:
name: computeurlmap-2-${uniqueId}
certificateMapRef:
name: certificatemap-${uniqueId}
quicOverride: ENABLE
location: global
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ sslCertificates and certificateManagerCertificates fields can not be defined tog
<p><code class="apitype">object</code></p>
<p>{% verbatim %}A reference to the CertificateMap resource uri that identifies a
certificate map associated with the given target proxy. This field
can only be set for global target proxies.{% endverbatim %}</p>
can only be set for global target proxies. This field is only supported
for EXTERNAL and EXTERNAL_MANAGED load balancing schemes.
For INTERNAL_MANAGED, use certificate_manager_certificates instead.
sslCertificates and CertificateMap fields can not be defined together.{% endverbatim %}</p>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 1ef07ff

Please sign in to comment.