Skip to content

add test/tw/gen-tls-cert pipeline#389

Draft
toabctl wants to merge 3 commits into
chainguard-dev:mainfrom
toabctl:gen-tls-cert-pipeline
Draft

add test/tw/gen-tls-cert pipeline#389
toabctl wants to merge 3 commits into
chainguard-dev:mainfrom
toabctl:gen-tls-cert-pipeline

Conversation

@toabctl

@toabctl toabctl commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a reusable test/tw/gen-tls-cert pipeline that fabricates self-signed RSA X.509 cert/key pairs for melange test setup.
  • Targets the ~340 stereo packages that currently inline openssl req -x509 ... inside test/daemon-check-output setup blocks (webhook serving certs, dummy TLS for exporters, etc.).
  • Inputs: cn (required), san, key-out, cert-out, days, key-bits. The pipeline declares needs.packages: [openssl] so callers don't have to add it.

Example caller usage in a stereo package's test:

- uses: test/tw/gen-tls-cert
  with:
    cn: webhook.svc
    san: "DNS:webhook.svc,DNS:webhook.svc.cluster.local"
    key-out: /tmp/k8s-webhook-server/serving-certs/tls.key
    cert-out: /tmp/k8s-webhook-server/serving-certs/tls.crt

Adoption in stereo is a separate sweep — this PR adds the pipeline only.

Test plan

  • make yam-check clean
  • make test-manual (covers minimal / SAN+custom-paths / key-bits=4096 in tests/manual/gen-tls-cert.yaml)
  • CI green on this PR

toabctl and others added 3 commits May 28, 2026 22:02
A reusable pipeline for fabricating self-signed RSA X.509 cert/key pairs
during melange test setup. Replaces the ad-hoc `openssl req -x509 ...`
boilerplate that ~340 stereo packages currently inline inside
`test/daemon-check-output` setup blocks (webhook serving certs, dummy
TLS for exporters, etc.).

Inputs:
- cn (required), san, key-out, cert-out, days, key-bits

Includes a manual test under tests/manual/gen-tls-cert.yaml exercising
the minimal, SAN+custom-paths, and key-bits=4096 cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
These are throwaway test certs — no reason to default to a 365-day
validity. Callers that need longer-lived certs (e.g. clock-skew
exercises) can still override via the `days` input.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 day is uncomfortably close to expiry for tests that sit idle in a
debug shell or get re-run shortly after build. 7 days keeps the
"throwaway" intent while giving more headroom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant