Skip to content

Commit

Permalink
ca-secrets: Annotate secrets that are created by spin-operator
Browse files Browse the repository at this point in the history
Eventually we will want to upgrade caBundles to new versions as
certificates expire/are rotated/new ca's form. We should however only do
that when we manage the resource that is created.

Here we introduce a managed-by annotation that we can use to ensure that
we don't replace user-managed secret bundles in the future.
  • Loading branch information
endocrimes committed Aug 19, 2024
1 parent 8627742 commit 34d1d8b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/controller/spinapp_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ func (r *SpinAppReconciler) ensureCASecret(ctx context.Context, caSecretName, na
ObjectMeta: metav1.ObjectMeta{
Name: caSecretName,
Namespace: namespace,
Annotations: map[string]string{
"app.kubernetes.io/managed-by": "spin-operator.spinkube.dev",
},
},
StringData: map[string]string{"ca-certificates.crt": cacerts.CACertificates()},
}
Expand Down

0 comments on commit 34d1d8b

Please sign in to comment.