Enhance certificate management and simplify controller logic#6
Merged
Conversation
…ture Signed-off-by: Marc Schäfer <git@marcschaeferger.de>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This pull request introduces several improvements and refactors across documentation, CI/CD workflows, and the codebase. The most significant change is the addition of a new
internal/certificatespackage, which provides an HTTP handler for exposing TLS certificate information from Kubernetes Secrets. The PR also restructures and updates the Go files overview documentation, enhances Go module caching in GitHub Actions workflows, refines documentation for doc-coauthoring and reader testing, and simplifies parts of the controller, Kubernetes client, and leader-election/readiness logic.Major codebase addition:
internal/certificates/certificates.gofile, which implements logic to fetch, parse, and expose TLS certificate data from Kubernetes Secrets via an HTTP handler at/api/v1/certificates. This includes robust error handling, JSON response formatting, and utility functions for certificate analysis.CERTIFICATE_SECRETSand config-filecertificateSecrets.docs/GO_FILES_OVERVIEW.mdto document the newinternal/certificatespackage and its files.Controller, config, and Kubernetes client refactoring:
Controller and leader-election simplification:
Kubernetes client and CRD validation cleanup:
CI/CD workflow improvements:
Go module and build cache optimization:
.github/workflows/ci.ymland.github/workflows/continuous-security.ymlto useactions/cachefor both modules and build artifacts, improving workflow performance. [1] [2] [3]cache: trueoption fromactions/setup-go. [1] [2] [3] [4]Artifact metadata and SBOM upload fixes:
artifact-metadata: writepermission in.github/workflows/build-publish.ymland corrects the SBOM upload conditional. [1] [2]PR metadata workflow removal:
.github/workflows/pr-metadata.yml, which previously applied PR labels and policy checks automatically.Documentation and organization:
Go files overview and folder reorganization:
docs/GO_FILES_OVERVIEW.mdto reflect the migration of tools fromhack/totools/, adds missing documentation for new and existing files, and improves descriptions for clarity and accuracy. [1] [2] [3] [4]Doc-coauthoring and reader testing improvements:
.agent/skills/doc-coauthoring/SKILL.mdwith additional steps, improved instructions, and clearer formatting for brainstorming, iterative refinement, and reader testing. [1] [2] [3] [4] [5] [6] [7] [8]These changes collectively enhance the maintainability, performance, and clarity of the project, while adding a key API endpoint for certificate visibility.
Type of Change
Affected Components
Select all that apply:
Behavior Changes
Does this PR change runtime behavior?
If yes, describe in detail:
This PR changes runtime behavior by adding the
/api/v1/certificatesHTTP endpoint, adding certificate secret configuration throughCERTIFICATE_SECRETSand config-filecertificateSecrets, simplifying leader-election/readiness handling, removing startup CRD validation, and changing Kubernetes client QPS/Burst behavior so defaults are no longer forced when unset.Implementation Details
Explain key design decisions:
internal/certificatespackage to keep certificate parsing, Secret fetching, and JSON response formatting separate from the HTTP server wiring.actions/cacheusage was added for Go module and build caches instead of relying onactions/setup-gocache behavior.Trade-offs:
Testing
Automated
envtest)Coverage:
Manual Testing
Describe how this was validated:
Tested with Pangolin 1.18.2 and acme.acme_http_endpoint in PangolinTest scenarios:
Security Considerations
Explain if relevant:
The new certificate endpoint exposes certificate and private key PEM data from configured Kubernetes TLS Secrets. Secret references are explicitly configured via environment variable or config file. Private key material is returned by the endpoint but is not logged. Access control for this endpoint should be reviewed because it exposes sensitive TLS key material to callers that can reach the controller HTTP server.
Performance Impact
Details:
Backward Compatibility
Documentation
Checklist
task cipasses locallyNotice
The PR description was completed with AI assistance based on the repository PR template.
Summary was fully generated by Copilot.
The pull request implementation itself is 100% human-authored. Additionally, the PR was reviewed by CodeRabbit AI.