stefanprodan / timoni

Timoni is a package manager for Kubernetes, powered by CUE and inspired by Helm.
https://timoni.sh
Apache License 2.0
1.44k stars 64 forks source link

Metadata is missing finalizers field #375

Closed jmgilman closed 2 months ago

jmgilman commented 3 months ago

The metadata schema currently does not support adding the finalizers field (which is valid). I ran into this when generating Application resources for Argo CD:

#Application: appv1alpha1.#Application & {
    #config:    config.#Config
    apiVersion: "argoproj.io/v1alpha1"
    kind:       "Application"
    metadata: #config.metadata & {
        if #config.cascadeDelete {
            finalizers: [
                "resources-finalizer.argocd.argoproj.io",
            ]
        }
    }
    // ....
}

If you want to enable cascading deletes in Argo, you must declare a finalizer upfront. While this might be a bit of an edge case, I don't see a reason for not supporting it in the definition:

#Metadata: {
    // ....
    finalizers?: [...string]
}