Skip to content

Commit 1cfa49a

Browse files
authored
fix: add admin rbac for pr-preview namespace (#492)
1 parent 39ac602 commit 1cfa49a

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

.github/workflows/build-and-test.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ on:
1717

1818
permissions: {}
1919

20-
# Controls concurrent workflow runs:
21-
# - Groups runs by PR head ref
22-
# - Cancels in-progress runs when new commits are pushed
20+
# Per-PR group + suffix: runs that should supersede each other use "ci"; unrelated
21+
# label events (e.g. CLA bot) use "noise" so they do not cancel an in-progress push
22+
# or pr-preview run. Push / synchronize / reopen always use "ci"; so do labeled
23+
# events that match docker-build (pr-preview-*, docker). Those now share one group
24+
# and cancel each other (fixing label-pr-preview vs synchronize split).
2325
concurrency:
2426
group: >-
25-
build-and-test-${{ github.head_ref || github.run_id }}-${{
26-
github.event.action == 'labeled' &&
27-
startsWith(github.event.label.name, 'pr-preview-') &&
28-
'label-pr-preview' ||
29-
github.event.action == 'labeled' &&
30-
github.event.label.name != 'docker' &&
31-
'label-other' ||
32-
'main'
27+
build-and-test-${{ github.event.pull_request.number || github.run_id }}-${{
28+
github.event.action != 'labeled' && 'ci' ||
29+
github.event.action == 'labeled' && (startsWith(github.event.label.name, 'pr-preview-') || github.event.label.name == 'docker') && 'ci' ||
30+
'noise'
3331
}}
3432
cancel-in-progress: true
3533

.github/workflows/pr-preview-deploy.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ jobs:
6363
NAMESPACE: 'kms-ci-${{ github.actor }}-${{ inputs.pr_number }}'
6464
TKMS_INFRA_CHART_VERSION: '0.3.2'
6565
SYNC_SECRETS_CHART_VERSION: '0.2.1'
66-
KMS_CORE_ENCLAVE_IMAGE_NAME: 'ghcr.io/zama-ai/kms/core-service-enclave'
67-
KMS_CORE_IMAGE_NAME: 'ghcr.io/zama-ai/kms/core-service'
68-
KMS_CORE_CLIENT_IMAGE_NAME: 'ghcr.io/zama-ai/kms/core-client'
66+
KMS_CORE_ENCLAVE_IMAGE_NAME: 'hub.zama.org/ghcr/zama-ai/kms/core-service-enclave'
67+
KMS_CORE_IMAGE_NAME: 'hub.zama.org/ghcr/zama-ai/kms/core-service'
68+
KMS_CORE_CLIENT_IMAGE_NAME: 'hub.zama.org/ghcr/zama-ai/kms/core-client'
6969
KMS_CORE_IMAGE_TAG: ${{ inputs.image_tag }}
7070
KMS_CORE_CLIENT_IMAGE_TAG: ${{ inputs.image_tag }}
71-
IMAGE_REPO: 'ghcr.io/zama-ai/kms'
71+
IMAGE_REPO: 'hub.zama.org/ghcr/zama-ai/kms'
7272
TLS: 'true'
7373
FHE_PARAMS: 'Test'
7474
DEPLOYMENT_TYPE: ${{ inputs.deployment_type }}
@@ -216,6 +216,17 @@ jobs:
216216
kubectl create namespace "${NAMESPACE}"
217217
fi
218218
219+
# ======================================================================
220+
# RBAC: Tailscale group kms-dev-access (same pattern as zws-dev k8s-access)
221+
# ======================================================================
222+
- name: Grant kms-dev-access RBAC on preview namespace
223+
run: |
224+
kubectl create rolebinding kms-dev-binding \
225+
--clusterrole=admin \
226+
--group=kms-dev-access \
227+
-n "${NAMESPACE}" \
228+
--dry-run=client -o yaml | kubectl apply -f -
229+
219230
- name: Checkout Project KMS
220231
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
221232
with:
@@ -285,7 +296,7 @@ jobs:
285296
286297
:rocket: And launch your tests:
287298
\`\`\`bash
288-
cargo nextest run --test ${TEST_NAME} --profile ci --no-fail-fast
299+
cargo nextest run --test ${TEST_NAME} --profile ci --no-fail-fast --features="kind_tests"
289300
\`\`\`
290301
291302
You can connect to the core-client with:

0 commit comments

Comments
 (0)