Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

INT-9927: propagate run service metadata to entity #630

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/steps/cloud-run/__snapshots__/converters.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,15 @@ exports[`#createCloudRunServiceEntity should convert to entity 1`] = `
"function": [
"workload-management",
],
"metaClientName": "cloud-console",
"metaCreator": "[email protected]",
"metaIngress": "all",
"metaIngressStatus": "all",
"metaLastModifier": "[email protected]",
"metaLaunchStage": "BETA",
"metaMaxScale": "100",
"metaSandbox": "gvisor",
"metaUserImage": "us-docker.pkg.dev/cloudrun/container/hello",
"name": "example-cloud-run-service",
"webLink": "https://console.cloud.google.com/run/detail/us-central1/example-cloud-run-service",
}
Expand Down
27 changes: 27 additions & 0 deletions src/steps/cloud-run/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ exports[`#fetchCloudRunConfigurations should collect data 1`] = `
"function": [
"workload-management",
],
"metaClientName": "cloud-console",
"metaCreator": "[email protected]",
"metaIngress": "all",
"metaIngressStatus": "all",
"metaLastModifier": "[email protected]",
"metaLaunchStage": "BETA",
"metaMaxScale": "100",
"metaSandbox": "gvisor",
"metaUserImage": "us-docker.pkg.dev/cloudrun/container/hello",
"name": "example-cloud-run-service",
"webLink": "https://console.cloud.google.com/run/detail/us-central1/example-cloud-run-service",
},
Expand Down Expand Up @@ -368,6 +377,15 @@ exports[`#fetchCloudRunRoutes should collect data 1`] = `
"function": [
"workload-management",
],
"metaClientName": "cloud-console",
"metaCreator": "[email protected]",
"metaIngress": "all",
"metaIngressStatus": "all",
"metaLastModifier": "[email protected]",
"metaLaunchStage": "BETA",
"metaMaxScale": "100",
"metaSandbox": "gvisor",
"metaUserImage": "us-docker.pkg.dev/cloudrun/container/hello",
"name": "example-cloud-run-service",
"webLink": "https://console.cloud.google.com/run/detail/us-central1/example-cloud-run-service",
},
Expand Down Expand Up @@ -594,6 +612,15 @@ exports[`#fetchCloudRunServices should collect data 1`] = `
"function": [
"workload-management",
],
"metaClientName": "cloud-console",
"metaCreator": "[email protected]",
"metaIngress": "all",
"metaIngressStatus": "all",
"metaLastModifier": "[email protected]",
"metaLaunchStage": "BETA",
"metaMaxScale": "100",
"metaSandbox": "gvisor",
"metaUserImage": "us-docker.pkg.dev/cloudrun/container/hello",
"name": "example-cloud-run-service",
"webLink": "https://console.cloud.google.com/run/detail/us-central1/example-cloud-run-service",
},
Expand Down
3 changes: 3 additions & 0 deletions src/steps/cloud-run/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export function createCloudRunServiceEntity(
webLink = `/run?project=${projectId}`;
}

const metadataProperties = parseMetadata(data);

return createIntegrationEntity({
entityData: {
source: data,
Expand All @@ -66,6 +68,7 @@ export function createCloudRunServiceEntity(
category: ['infrastructure'],
createdOn: parseTimePropertyValue(data.metadata?.creationTimestamp),
webLink: getGoogleCloudConsoleWebLink(webLink),
...metadataProperties.filteredProperties,
},
},
});
Expand Down
6 changes: 3 additions & 3 deletions src/steps/cloud-run/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('#fetchCloudRunServices', () => {
).toMatchGraphObjectSchema({
_class: ['Service'],
schema: {
additionalProperties: false,
additionalProperties: true,
properties: {
_type: { const: 'google_cloud_run_service' },
_rawData: {
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('#fetchCloudRunRoutes', () => {
).toMatchGraphObjectSchema({
_class: ['Service'],
schema: {
additionalProperties: false,
additionalProperties: true,
properties: {
_type: { const: 'google_cloud_run_service' },
_rawData: {
Expand Down Expand Up @@ -204,7 +204,7 @@ describe('#fetchCloudRunConfigurations', () => {
).toMatchGraphObjectSchema({
_class: ['Service'],
schema: {
additionalProperties: false,
additionalProperties: true,
properties: {
_type: { const: 'google_cloud_run_service' },
_rawData: {
Expand Down