Skip to content

Commit bfa7758

Browse files
authored
Merge pull request #8103 from upodroid/scale-e2e-ar-migration
enable artifact registry for scale e2e projects
2 parents ee35cec + 53706cc commit bfa7758

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

infra/gcp/terraform/boskos/iam.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,16 @@ module "folder_iam" {
4646
]
4747
}
4848

49+
conditional_bindings = [
50+
{
51+
role = "roles/admin" # Similar to Owner but can use IAM Conditions
52+
title = "admin-scale-projects-only"
53+
description = "Admin access to scale boskos projects only"
54+
expression = "resource.name.startsWith(\"k8s-infra-e2e-boskos-scale\")"
55+
members = [
56+
57+
]
58+
}
59+
]
60+
4961
}

infra/gcp/terraform/boskos/main.tf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,20 @@ resource "google_folder" "boskos" {
2020
}
2121

2222
locals {
23-
boskos_projects = [
23+
boskos_e2e_projects = [
2424
for i in range("001", "160") : format("k8s-infra-e2e-boskos-%03d", i)
2525
]
26+
boskos_scale_e2e_projects = [
27+
for i in range("01", "30") : format("k8s-infra-e2e-boskos-scale-%02d", i)
28+
]
29+
boskos_gpu_e2e_projects = [
30+
for i in range("01", "10") : format("k8s-infra-e2e-boskos-gpu-%02d", i)
31+
]
32+
boskos_projects = concat(
33+
local.boskos_e2e_projects,
34+
local.boskos_scale_e2e_projects,
35+
local.boskos_gpu_e2e_projects
36+
)
2637
}
2738

2839
module "project" {
@@ -102,6 +113,12 @@ import {
102113
id = each.value
103114
}
104115

116+
import {
117+
for_each = toset(local.boskos_projects)
118+
to = module.artifact_registry[each.key].google_artifact_registry_repository.repo
119+
id = "projects/${each.value}/locations/us/repositories/gcr.io"
120+
}
121+
105122
import {
106123
for_each = toset(local.boskos_projects)
107124
to = google_compute_project_metadata.default[each.key]

0 commit comments

Comments
 (0)