Skip to content

Commit

Permalink
Add finalizer to avoid premature CRD Deletion (#5788)
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Raposo <rafaelraposo@spotify.com>
  • Loading branch information
RRap0so authored Oct 9, 2024
1 parent 604be4a commit d062824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flyteadmin/pkg/workflowengine/impl/prepare_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ func PrepareFlyteWorkflow(data interfaces.ExecutionData, flyteWorkflow *v1alpha1
acceptAtWrapper := v1.NewTime(data.ExecutionParameters.AcceptedAt)
flyteWorkflow.AcceptedAt = &acceptAtWrapper

// Add finalizer
flyteWorkflow.Finalizers = append(flyteWorkflow.Finalizers, "flyte-finalizer")

// add permissions from auth and security context. Adding permissions from auth would be removed once all clients
// have migrated over to security context
addPermissions(data.ExecutionParameters.ExecutionConfig.SecurityContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,5 @@ func TestPrepareFlyteWorkflow(t *testing.T) {
OutputLocationPrefix: "s3://bucket/key",
},
})
assert.Equal(t, flyteWorkflow.Finalizers, []string{"flyte-finalizer"})
}

0 comments on commit d062824

Please sign in to comment.