Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#1170 from gemmahou/276980291
Browse files Browse the repository at this point in the history
Recover disabled integration test-update test yaml
  • Loading branch information
gemmahou authored Feb 2, 2024
2 parents 77167cd + 48ae3d8 commit 11356bb
Show file tree
Hide file tree
Showing 38 changed files with 131 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
spec:
region: us-west3
ipCidrRange: 10.2.0.0/16
ipCidrRange: 10.180.0.0/10
networkRef:
name: computeregionnetworkendpointgroup-dep-psc
purpose: PRIVATE_SERVICE_CONNECT
Expand Down
2 changes: 2 additions & 0 deletions pkg/test/controller/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ func ReplaceTestVars(t *testing.T, b []byte, uniqueId string, project testgcp.GC
s = strings.Replace(s, fmt.Sprintf("projects/${%s}", testgcp.TestDependentOrgProjectId), fmt.Sprintf("projects/%s", testgcp.GetDependentOrgProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("${%s}", testgcp.TestDependentOrgProjectId), fmt.Sprintf("\"%s\"", testgcp.GetDependentOrgProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("projects/${%s}", testgcp.TestDependentFolderProjectId), fmt.Sprintf("projects/%s", testgcp.GetDependentFolderProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("projects/${%s}", testgcp.TestDependentFolder2ProjectId), fmt.Sprintf("projects/%s", testgcp.GetDependentFolder2ProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("${%s}", testgcp.TestDependentFolderProjectId), fmt.Sprintf("\"%s\"", testgcp.GetDependentFolderProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("${%s}", testgcp.TestDependentFolder2ProjectId), fmt.Sprintf("\"%s\"", testgcp.GetDependentFolder2ProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("projects/${%s}", testgcp.TestDependentNoNetworkProjectId), fmt.Sprintf("projects/%s", testgcp.GetDependentNoNetworkProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("${%s}", testgcp.TestDependentNoNetworkProjectId), fmt.Sprintf("\"%s\"", testgcp.GetDependentNoNetworkProjectID(t)), -1)
s = strings.Replace(s, fmt.Sprintf("organizations/${%s}", testgcp.IAMIntegrationTestsOrganizationID.Key), fmt.Sprintf("organizations/%s", testgcp.IAMIntegrationTestsOrganizationID.Get()), -1)
Expand Down
6 changes: 6 additions & 0 deletions pkg/test/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ var (
const (
TestDependentOrgProjectId = "TEST_DEPENDENT_ORG_PROJECT_ID"
TestDependentFolderProjectId = "TEST_DEPENDENT_FOLDER_PROJECT_ID"
TestDependentFolder2ProjectId = "TEST_DEPENDENT_FOLDER_2_PROJECT_ID"
TestDependentNoNetworkProjectId = "TEST_DEPENDENT_NO_NETWORK_PROJECT_ID" // A dependent project with default network disabled
IsolatedTestOrgName = "ISOLATED_TEST_ORG_NAME"
TestBillingAccountIDForBillingResources = "BILLING_ACCOUNT_ID_FOR_BILLING_RESOURCES"
Expand All @@ -80,6 +81,7 @@ const (
var (
testDependentOrgProjectId = os.Getenv(TestDependentOrgProjectId)
testDependentFolderProjectId = os.Getenv(TestDependentFolderProjectId)
testDependentFolder2ProjectId = os.Getenv(TestDependentFolder2ProjectId)
testDependentNoNetworkProjectId = os.Getenv(TestDependentNoNetworkProjectId)
isolatedTestOrgName = os.Getenv(IsolatedTestOrgName)
testBillingAccountIDForBillingResources = os.Getenv(TestBillingAccountIDForBillingResources)
Expand Down Expand Up @@ -171,6 +173,10 @@ func GetDependentFolderProjectID(t *testing.T) string {
return testDependentFolderProjectId
}

func GetDependentFolder2ProjectID(t *testing.T) string {
return testDependentFolder2ProjectId
}

func GetDependentNoNetworkProjectID(t *testing.T) string {
return testDependentNoNetworkProjectId
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
name: project-${uniqueId}
spec:
name: project-${uniqueId}
resourceID: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: "Dependent Project"
organizationRef:
external: ${TEST_ORG_ID}
billingAccountRef:
Expand All @@ -27,6 +30,8 @@ apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
name: apigee.googleapis.com
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
spec:
projectRef:
name: "project-${uniqueId}"
Expand All @@ -35,6 +40,8 @@ apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
name: compute.googleapis.com
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
spec:
projectRef:
name: "project-${uniqueId}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
name: project-${uniqueId}
spec:
name: project-${uniqueId}
resourceID: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: "Dependent Project"
organizationRef:
external: ${TEST_ORG_ID}
billingAccountRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
location: global
iap:
oauth2ClientIdRef:
external: iapidentityawareproxyclient-${uniqueId}
name: iapidentityawareproxyclient-${uniqueId}
oauth2ClientSecret:
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ metadata:
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
name: iapclient-${uniqueId}
spec:
name: ComputeProjectMetadata
resourceID: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: "Dependent Project"
organizationRef:
external: ${TEST_ORG_ID}
billingAccountRef:
Expand All @@ -74,15 +77,16 @@ apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/project-id: iapclient-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
cnrm.cloud.google.com/deletion-policy: "abandon"
name: iap.googleapis.com
---
apiVersion: iap.cnrm.cloud.google.com/v1beta1
kind: IAPBrand
metadata:
name: iapbrand-${uniqueId}
annotations:
cnrm.cloud.google.com/project-id: iapclient-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
spec:
applicationTitle: "test brand"
# This is not a valid support email, but works from testing perspective
Expand All @@ -93,7 +97,7 @@ kind: IAPIdentityAwareProxyClient
metadata:
name: iapidentityawareproxyclient-${uniqueId}
annotations:
cnrm.cloud.google.com/project-id: iapclient-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
spec:
displayName: "Test Client"
brandRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
location: global
iap:
oauth2ClientIdRef:
external: iapidentityawareproxyclient-${uniqueId}
name: iapidentityawareproxyclient-${uniqueId}
oauth2ClientSecret:
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
protocol: HTTP
iap:
oauth2ClientIdRef:
external: iapidentityawareproxyclient-${uniqueId}
name: iapidentityawareproxyclient-${uniqueId}
oauth2ClientSecret:
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ spec:
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
name: iapclient-${uniqueId}
spec:
name: ComputeProjectMetadata
resourceID: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: "Dependent Project"
organizationRef:
external: ${TEST_ORG_ID}
billingAccountRef:
Expand All @@ -38,15 +41,16 @@ apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/project-id: iapclient-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
cnrm.cloud.google.com/deletion-policy: "abandon"
name: iap.googleapis.com
---
apiVersion: iap.cnrm.cloud.google.com/v1beta1
kind: IAPBrand
metadata:
name: iapbrand-${uniqueId}
annotations:
cnrm.cloud.google.com/project-id: iapclient-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
spec:
applicationTitle: "test brand"
# This is not a valid support email, but works from testing perspective
Expand All @@ -57,7 +61,7 @@ kind: IAPIdentityAwareProxyClient
metadata:
name: iapidentityawareproxyclient-${uniqueId}
annotations:
cnrm.cloud.google.com/project-id: iapclient-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
spec:
displayName: "Test Client"
brandRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
protocol: HTTP
iap:
oauth2ClientIdRef:
external: iapidentityawareproxyclient-${uniqueId}
name: iapidentityawareproxyclient-${uniqueId}
oauth2ClientSecret:
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeProjectMetadata
metadata:
annotations:
cnrm.cloud.google.com/project-id: metadata-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: computeprojectmetadata-${uniqueId}
spec:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
labels:
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
name: metadata-${uniqueId}
spec:
resourceID: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: "Dependent Project"
organizationRef:
external: ${TEST_ORG_ID}
name: ComputeProjectMetadata
billingAccountRef:
external: ${TEST_BILLING_ACCOUNT_ID}
---
apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/project-id: metadata-${uniqueId}
name: compute.googleapis.com
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
cnrm.cloud.google.com/deletion-policy: "abandon"
name: compute.googleapis.com

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeProjectMetadata
metadata:
annotations:
cnrm.cloud.google.com/project-id: metadata-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: computeprojectmetadata-${uniqueId}
spec:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ kind: ComputeRegionNetworkEndpointGroup
metadata:
name: computeregionnetworkendpointgroup-${uniqueId}
annotations:
cnrm.cloud.google.com/project-id: project-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
spec:
region: us-west3
networkEndpointType: PRIVATE_SERVICE_CONNECT
pscTargetService: https://www.googleapis.com/compute/v1/projects/project-${uniqueId}/regions/us-west3/serviceAttachments/computeserviceattachment-${uniqueId}
pscTargetService: "us-west3-cloudkms.googleapis.com"
networkRef:
name: default
subnetworkRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
annotations:
cnrm.cloud.google.com/deletion-policy: "abandon"
name: project-${uniqueId}
spec:
resourceID: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: "Dependent Project"
organizationRef:
external: ${TEST_ORG_ID}
name: project-${uniqueId}
billingAccountRef:
external: ${TEST_BILLING_ACCOUNT_ID}
---
Expand All @@ -38,7 +41,7 @@ kind: ComputeNetwork
metadata:
name: default
annotations:
cnrm.cloud.google.com/project-id: project-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
cnrm.cloud.google.com/deletion-policy: "abandon"
cnrm.cloud.google.com/management-conflict-prevention-policy: "none"
spec:
Expand All @@ -48,11 +51,11 @@ apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeSubnetwork
metadata:
annotations:
cnrm.cloud.google.com/project-id: project-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: computesubnetwork-${uniqueId}
spec:
region: us-west3
ipCidrRange: 10.2.0.0/16
ipCidrRange: 10.180.0.0/10
networkRef:
name: default
purpose: PRIVATE_SERVICE_CONNECT
Expand All @@ -62,7 +65,7 @@ kind: ComputeSubnetwork
metadata:
name: default
annotations:
cnrm.cloud.google.com/project-id: project-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
cnrm.cloud.google.com/deletion-policy: "abandon"
cnrm.cloud.google.com/management-conflict-prevention-policy: "none"
spec:
Expand All @@ -75,7 +78,7 @@ apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeBackendService
metadata:
annotations:
cnrm.cloud.google.com/project-id: project-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: computebackendservice-${uniqueId}
spec:
location: us-west3
Expand All @@ -87,7 +90,7 @@ apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeForwardingRule
metadata:
annotations:
cnrm.cloud.google.com/project-id: project-${uniqueId}
cnrm.cloud.google.com/project-id: ${TEST_DEPENDENT_ORG_PROJECT_ID}
name: computeforwardingrule-${uniqueId}
spec:
location: us-west3
Expand Down
Loading

0 comments on commit 11356bb

Please sign in to comment.