Skip to content

feat(gitops-values-validation): accept a full self-service path in secretsManagerPath (PTFM-26625) - #89

Merged
nterlemes-kp merged 1 commit into
mainfrom
fix/ptfm-26625-accept-selfservice-secret-paths
Oct 27, 2026
Merged

nterlemes-kp merged 1 commit into
mainfrom
fix/ptfm-26625-accept-selfservice-secret-paths

Conversation

@nterlemes-kp

@nterlemes-kp nterlemes-kp commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

PTFM-26625

The legacy-secrets migration points services at the secrets kp writes. A service on platform-managed-chart 0.1.318 or later names its secret by leaf (secret: env). An older chart has no short form, so the migration names it in full and keeps the chart as it is, so the service doesn't restart:

DB_PASSWORD:
  secretsManagerPath: selfservice/k8s/dev/my-app/my-svc/env
  property: DB_PASSWORD

Those charts copy secretsManagerPath into the ExternalSecret as is, so this renders and syncs (checked on 0.1.213: the ExternalSecret reads selfservice/k8s/dev/…). But every published schema pins the field to ^k8s/(app/…/)?(dev|prod|…)/(common|main|…)/, so gitops-values-validation refuses it: about 270 errors across 8 of this week's migration PRs.

What changed

After download, every secretsManagerPath pattern that starts with ^k8s/ also accepts selfservice/k8s/<env>/<application>/<service or _shared>/<secret>, the layout kp writes. The disk cache keeps the schema as published. Other secretsManagerPath patterns, like the Okta one that already expects selfservice/, are left alone.

Tests:

  • a full self-service path passes on a 0.1.225 schema (it fails without this change, with the CI error above);
  • a malformed one (unknown environment, missing level) is still refused;
  • a unit test of the widened pattern.

Run against the 9 failing migration branches (api-platform, cargo, cloud-platform, compliance, defense, maritime-models, maritime-web, mobile, notifications): no errors left.

After merge

The repos pick this up with a rev bump of kp-pre-commit-hooks in their .pre-commit-config.yaml. The migration PRs carry that bump.

…cretsManagerPath (PTFM-26625)

Charts before 0.1.318 pass secretsManagerPath to the ExternalSecret as is, so selfservice/k8s/<env>/<application>/<service>/<secret> works at runtime, but their published schemas only allow k8s/ paths. The legacy-secrets migration keeps those services on their chart and points them at self-service this way, without a restart. The hook now widens each such pattern after download; a malformed self-service path is still refused.
@nterlemes-kp
nterlemes-kp requested review from a team as code owners October 27, 2026 13:03
@nterlemes-kp
nterlemes-kp merged commit a1e7a8a into main Oct 27, 2026
2 checks passed
@nterlemes-kp
nterlemes-kp deleted the fix/ptfm-26625-accept-selfservice-secret-paths branch October 27, 2026 13:07
@seyfer

seyfer commented Nov 12, 2026

Copy link
Copy Markdown

@nterlemes-kp @leo-dur is it fine that this repo is public?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants