Merge remote-tracking branch 'origin/master' into fix/1784-managed-repository-materialization

This commit is contained in:
Codex
2026-07-12 01:07:09 +02:00
7 changed files with 579 additions and 53 deletions
@@ -76,6 +76,16 @@ function normalizeAdmissionPolicySpec(value) {
if (Object.prototype.hasOwnProperty.call(spec, "matchConstraints")) {
const matchConstraints = { ...record(spec.matchConstraints) };
if (!Object.prototype.hasOwnProperty.call(matchConstraints, "matchPolicy")) matchConstraints.matchPolicy = "Equivalent";
for (const selector of ["namespaceSelector", "objectSelector"]) {
if (isEmptyRecord(matchConstraints[selector])) delete matchConstraints[selector];
}
if (Array.isArray(matchConstraints.resourceRules)) {
matchConstraints.resourceRules = matchConstraints.resourceRules.map((value) => {
const rule = { ...record(value) };
if (rule.scope === "*") delete rule.scope;
return rule;
});
}
spec.matchConstraints = matchConstraints;
}
return spec;
@@ -91,6 +101,10 @@ function normalizeAdmissionBindingSpec(value) {
return spec;
}
function isEmptyRecord(value) {
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).length === 0;
}
function evaluatePacAdmissionState(inputValue) {
const input = record(inputValue);
const policy = record(input.policy);