Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spicedb] Apply migrations in the ArgoCD PreSync hook #18911

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions install/installer/pkg/components/spicedb/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ func migrations(ctx *common.RenderContext) ([]runtime.Object, error) {
Labels: common.CustomizeLabel(ctx, Component, common.TypeMetaBatchJob),
Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaBatchJob, func() map[string]string {
// Because we are using ArgoCD to deploy, we need to add these annotations so:
// 1. it knows when to apply it (during the "Sync" hook, the same phase the all other manifests are applied)
// 1. it knows when to apply it (during the "PreSync" hook, before other manifests are applied)
// 2. that it should remove it once it is done
// - this is necessary so it does not show up as "ouf of sync" once the "TTLSecondsAfterFinished" option kicks in
// - if we would not remove the job at all, we would have a name clash an future updates ("field is immutable")
// docs: https://argo-cd.readthedocs.io/en/stable/user-guide/resource_hooks/#usage
return map[string]string{
"argocd.argoproj.io/hook": "Sync",
"argocd.argoproj.io/hook": "PreSync",
"argocd.argoproj.io/hook-delete-policy": "HookSucceeded",
}
}),
Expand Down
Loading