From e84c53ab67d9a181494599ff89235b25e2f82158 Mon Sep 17 00:00:00 2001 From: Andy Sadler Date: Fri, 10 Oct 2025 11:57:11 -0500 Subject: [PATCH] repository-validator: format manifests We're introducing yamllint checks to the manifests in this repository (redhat-appstudio#8461). Repository validator's manifests have formatting issues that yamllint calls out, so fix these warnings. This is split from redhat-appstudio#8461 since repository validator's formatted manifests don't exactly line up with their pre-formatted versions. Part-of: KFLUXINFRA-2285 Signed-off-by: Andy Sadler --- components/repository-validator/base/namespace.yaml | 2 +- .../base/validating-admission-policy.yaml | 10 +++++----- .../repository-validator/staging/kustomization.yaml | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/repository-validator/base/namespace.yaml b/components/repository-validator/base/namespace.yaml index 3b870173908..528db4b340f 100644 --- a/components/repository-validator/base/namespace.yaml +++ b/components/repository-validator/base/namespace.yaml @@ -4,4 +4,4 @@ metadata: name: repository-validator labels: app.kubernetes.io/name: repository-validator - app.kubernetes.io/component: admission-policy \ No newline at end of file + app.kubernetes.io/component: admission-policy diff --git a/components/repository-validator/base/validating-admission-policy.yaml b/components/repository-validator/base/validating-admission-policy.yaml index 1c9f4cf0590..32e39f8c977 100644 --- a/components/repository-validator/base/validating-admission-policy.yaml +++ b/components/repository-validator/base/validating-admission-policy.yaml @@ -26,16 +26,16 @@ spec: variables.allowedPrefixes[0] == "*" validations: - expression: | - variables.allowAll || - variables.allowedPrefixes.exists(prefix, + variables.allowAll || + variables.allowedPrefixes.exists(prefix, prefix != "" && object.spec.url.startsWith(prefix) ) messageExpression: | - 'Repository URL "' + object.spec.url + - '" is not allowed on this cluster. Contact support.' + 'Repository URL "' + object.spec.url + + '" is not allowed on this cluster. Contact support.' reason: Forbidden auditAnnotations: - key: "repository-url-validation" valueExpression: | - 'Repository URL: ' + object.spec.url + + 'Repository URL: ' + object.spec.url + ', Allowed prefixes: [' + variables.allowedPrefixes.join(', ') + ']' diff --git a/components/repository-validator/staging/kustomization.yaml b/components/repository-validator/staging/kustomization.yaml index 3f0bcbe6020..9aa10bfce6a 100644 --- a/components/repository-validator/staging/kustomization.yaml +++ b/components/repository-validator/staging/kustomization.yaml @@ -1,6 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - https://github.com/redhat-appstudio/internal-infra-deployments/components/repository-validator/staging?ref=f15be7d510b152f7b7f3d0f3f921c7c9c73cadd4 + - https://github.com/redhat-appstudio/internal-infra-deployments/components/repository-validator/staging?ref=f15be7d510b152f7b7f3d0f3f921c7c9c73cadd4 - ../base -