Skip to content

Commit

Permalink
Merge pull request #2092 from yuwenma/stricter-test-resourceID
Browse files Browse the repository at this point in the history
fix: replace mockgcp dynamic resourceID to id marker
  • Loading branch information
google-oss-prow[bot] authored Jun 22, 2024
2 parents 93d018f + dc02bee commit 8edc244
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
labels:
url: http://hooks.example.com/notification
username: user
resourceID: "1718837116591979324"
resourceID: ${notificationChannelID}
sensitiveLabels:
password:
valueFrom:
Expand All @@ -41,5 +41,5 @@ status:
reason: UpToDate
status: "True"
type: Ready
name: projects/${projectId}/notificationChannels/1718837116591979324
name: projects/${projectId}/notificationChannels/${notificationChannelID}
observedGeneration: 3
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
projectRef:
external: ${projectId}
region: us-central1
resourceID: projects/${projectNumber}/locations/us-central1/tensorboards/1718837895702041590
resourceID: projects/${projectNumber}/locations/us-central1/tensorboards/${tensorboardId}
status:
blobStoragePathPrefix: cloud-ai-platform-4c7152f6-07a9-47d6-8f51-4299e2fdff92
conditions:
Expand All @@ -28,6 +28,6 @@ status:
status: "True"
type: Ready
createTime: "1970-01-01T00:00:00Z"
name: projects/${projectNumber}/locations/us-central1/tensorboards/1718837895702041590
name: projects/${projectNumber}/locations/us-central1/tensorboards/${tensorboardId}
observedGeneration: 3
updateTime: "1970-01-01T00:00:00Z"
10 changes: 10 additions & 0 deletions tests/e2e/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ func normalizeKRMObject(u *unstructured.Unstructured, project testgcp.GCPProject
return strings.ReplaceAll(s, id, "${alertPolicyId}")
})
}
if typeName == "tensorboards" {
visitor.stringTransforms = append(visitor.stringTransforms, func(path string, s string) string {
return strings.ReplaceAll(s, id, "${tensorboardId}")
})
}
if typeName == "notificationChannels" {
visitor.stringTransforms = append(visitor.stringTransforms, func(path string, s string) string {
return strings.ReplaceAll(s, id, "${notificationChannelID}")
})
}
}
}

Expand Down

0 comments on commit 8edc244

Please sign in to comment.