Merge pull request '修正 OpenSandbox SPIRE 父身份格式' (#25) from fix/opensandbox-spire-parent into main
This commit was merged in pull request #25.
This commit is contained in:
@@ -19,7 +19,7 @@ Lifecycle 请求把稳定的 repository/task SPIFFE ID 放入 task environment
|
||||
集群内的 `opensandbox-identity` controller 读取 BatchSandbox allocation 得到实际
|
||||
Pod UID,然后创建:
|
||||
|
||||
- parent:`spiffe://ddupan.top/spire/agent/k8s_psat/sandbox-kata/pod/<pod-uid>`;
|
||||
- parent:`spiffe://ddupan.top/spire/agent/k8s_psat/sandbox-kata/<pod-uid>`;
|
||||
- workload:`spiffe://ddupan.top/ci/<owner>/<repository>/<task>`;
|
||||
- selector:`unix:uid:2000`。
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ def identity_entry(
|
||||
"className": SPIRE_CLASS_NAME,
|
||||
"parentID": (
|
||||
f"spiffe://{SPIFFE_TRUST_DOMAIN}/spire/agent/k8s_psat/"
|
||||
f"{SPIRE_CLUSTER_NAME}/pod/{pod_uid}"
|
||||
f"{SPIRE_CLUSTER_NAME}/{pod_uid}"
|
||||
),
|
||||
"spiffeID": spiffe_id,
|
||||
"selectors": [f"unix:uid:{RUNNER_UID}"],
|
||||
|
||||
@@ -49,5 +49,5 @@ def test_entry_binds_exact_pod_agent_and_runner_uid():
|
||||
pod_uid="pod-uid",
|
||||
spiffe_id="spiffe://ddupan.top/ci/org/repo/test",
|
||||
)
|
||||
assert entry["spec"]["parentID"].endswith("/sandbox-kata/pod/pod-uid")
|
||||
assert entry["spec"]["parentID"].endswith("/sandbox-kata/pod-uid")
|
||||
assert entry["spec"]["selectors"] == ["unix:uid:2000"]
|
||||
|
||||
Reference in New Issue
Block a user