Skip to content

feat: platform secrets as sealed secrets#2978

Open
ferruhcihan wants to merge 107 commits intomainfrom
APL-523
Open

feat: platform secrets as sealed secrets#2978
ferruhcihan wants to merge 107 commits intomainfrom
APL-523

Conversation

@ferruhcihan
Copy link
Collaborator

@ferruhcihan ferruhcihan commented Feb 24, 2026

📌 Summary

PRs: apl-api | apl-tasks

🔍 Reviewer Notes

🧹 Checklist

  • Code is readable, maintainable, and robust.
  • Unit tests added/updated

Copy link
Contributor

@CasLubbers CasLubbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really impressive with the work you did! It was/is thought review

Copy link
Contributor

@CasLubbers CasLubbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work you did some nice improvements. I can understand it much better right now.

const applySealedSecretResource = async (manifest: SealedSecretManifest): Promise<void> => {
await k8s.custom().patchNamespacedCustomObject(
{
group: 'bitnami.com',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice this is already really clean! I would only make constants out of the group, version and plural. And maybe fieldManager we also use that in the applyAsApps for ArgoCD

cert.validity.notAfter = new Date()
cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 10)

const attrs = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a good contender to move out of the function and create a constant with good naming

]
cert.setSubject(attrs)
cert.setIssuer(attrs)
cert.setExtensions([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here this object can get out of this function and get a good name

* - apps.X -> X-secrets
* - topLevel -> topLevel-secrets
*/
const deriveSecretName = (secretPath: string): string => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! this was that hardcoded map right?


// Read all YAML files in the sealedsecrets subdirectory
const files = await deps.readdir(sealedSecretsDir)
for (const file of files) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for loop can also be in a separate function with something like: applySealedSecretsFromFiles? Then you'll directly see what it is and does

}
}

public async applyRecoveryManifests(): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is a bit tricky. It will work for now, but what if we want to add other items then secrets to the recovery?

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.

3 participants