feat: add generic signer extensions - #2175
Conversation
PR Summary by Qodofeat: signer-agnostic InitContainers, Volumes, VolumeMounts and Auth for Fulcio/CTlog
AI Description
Diagram
High-Level Assessment
Files changed (19)
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2175 +/- ##
==========================================
- Coverage 57.12% 56.42% -0.71%
==========================================
Files 286 286
Lines 16129 16295 +166
==========================================
- Hits 9214 9194 -20
- Misses 5970 6131 +161
- Partials 945 970 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review by Qodo
1.
|
Add signer-agnostic pod customization fields to FulcioSpec and CTlogSpec, enabling users to inject init containers, volumes, volume mounts, and authentication credentials regardless of which signer backend is active. API changes: - InitContainerSpec in common.go — curated corev1.Container subset - InitContainers, Volumes, VolumeMounts on FulcioSpec and CTlogSpec - Auth on FulcioSigner and CTlogSigner - SecureSign.SetDefaults() calls Signer.SetDefaults() for both components Controller changes: - User-defined resources applied in shared deployment path before signer type branching — works in file mode, not gated behind any backend - CTLog operator-managed "keys" volume set after user volumes so operator always wins on reserved names - Auth volume renamed to "signer-auth" to avoid user volume collisions - Shared helpers in ensure/pod_spec.go: HasVolume, EnsureVolumeDefaultMode, ReconcileInitContainers - Fulcio ensureCommonDeployment extracted for shared scaffolding Housekeeping: - Remove dead FindConfigMap, HasMountPath functions - Remove duplicate v1alpha1 CRD entries from CSV - v1alpha1 conversion preserves new fields via MarshalData annotations - Roundtrip fuzzer generates roundtrip-safe values for extension fields Test coverage: - CTLog deployment tests: volumes, init containers, auth, operator volume precedence - Fulcio deployment tests: volumes, init containers, auth in file mode - ReconcileInitContainers unit tests - EnsureVolumeDefaultMode unit tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bbd4fb6 to
6f9e6c1
Compare
Summary
Add signer-agnostic pod customization fields to
FulcioSpecandCTlogSpec, enabling users to inject init containers, volumes, volume mounts, and authentication credentials regardless of which signer backend is active. This lays the groundwork for PKCS#11/HSM support (separate follow-up PR) and any future signer backends (KMS, Tink).API Changes
InitContainerSpecincommon.go— curatedcorev1.Containersubset (name, image, command, args, env, envFrom, volumeMounts, resources, securityContext, imagePullPolicy). Shared by both Fulcio and CTLog.InitContainers []InitContainerSpeconFulcioSpecandCTlogSpec— top-level, pod-wideVolumes []corev1.VolumeonFulcioSpecandCTlogSpec— additional pod volumesVolumeMounts []corev1.VolumeMountonFulcioSpecandCTlogSpec— main server container mountsAuth *AuthonFulcioSignerandCTlogSigner— env vars and secret mounts for the server container (uniform placement on both Signers)SecureSign.SetDefaults()callsSigner.SetDefaults()for both Fulcio and CTLog sosigner.type: fileis explicit on the parent CRController Changes
InitContainers/Volumes/VolumeMounts/Authapplied in shared deployment path before branching on signer type — works in file mode, not gated behind any specific backendinternal/utils/kubernetes/ensure/pod_spec.go:HasVolume,HasMountPath,EnsureVolumeDefaultMode,ReconcileInitContainersensureCommonDeploymentto prevent divergence between file and future signer modesHousekeeping
FindConfigMapfunction (no callers)MarshalDataannotationsReview Comments Addressed
(#2128):
hasVolume/ensureVolumeDefaultModeto shared packageFindConfigMapPKCS11InitContainerSpec→InitContainerSpec, move tocommon.goInitContainers/Volumes/Authignored in Fulcio file modeTest plan
make buildandmake testpasssigner.type: filedefaulted, new fields available inoc explaininitContainers/volumesin file mode — fields applied to podcosign sign + verifypasses (file mode regression)Jira: SECURESIGN-5014
🤖 Generated with Claude Code