BindTSIGKey: add secretTemplate for Secret labels/annotations #12
Reference in New Issue
Block a user
Delete Branch "benvin/tsigkey-secret-annotations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
spec.secretTemplate.{annotations,labels}toBindTSIGKey, stamped onto the operator-managed Secret both at generation and reconciled on change.Why
The generated TSIG Secret only carried the managed-by label, so the emberstack reflector could not mirror it to another namespace (reflection requires
reflection-allowedannotations on the source). This blocked "manage the external-dns TSIG key inbind-internal, reflect it into theexternaldnsnamespace" — external-dns must present exactly the key the primary'sallow-updateaccepts.Changes
SecretMetadata{Annotations,Labels}+BindTSIGKeySpec.SecretTemplateapplySecretTemplatemerges the managed-by label + template metadata on create, and reconciles it onto the existing Secret when the CR changes.importExistingsecrets are skipped (owned by an external manager).applySecretTemplate; README + sample updated.Test
make generate && make build && go test ./...— all green;go vet/gofmtclean.The operator-generated TSIG Secret previously carried only the managed-by label, so it could not be mirrored to another namespace by emberstack reflector (which requires reflection-allowed annotations on the source). Add spec.secretTemplate.{annotations,labels}, applied both when the Secret is first generated and reconciled onto the existing Secret when the CR changes (imported secrets are left untouched so we don't fight their external manager). This lets the external-dns TSIG key be managed in bind-internal and reflected into the externaldns namespace.