Skip to content

Commit

Permalink
fix: use the lagoon task name for advanced tasks to allow cancellatio…
Browse files Browse the repository at this point in the history
…ns to work properly
  • Loading branch information
shreddedbacon committed Oct 31, 2023
1 parent 6300ef9 commit df20fc0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/messenger/tasks_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,13 @@ func (m *Messenger) createAdvancedTask(namespace string, jobSpec *lagoonv1beta1.
func createAdvancedTask(namespace string, jobSpec *lagoonv1beta1.LagoonTaskSpec, m *Messenger, additionalLabels map[string]string) error {
opLog := ctrl.Log.WithName("handlers").WithName("LagoonTasks")
// create the advanced task
taskName := fmt.Sprintf("lagoon-advanced-task-%s", helpers.RandString(6))
if jobSpec.Task.TaskName != "" {
taskName = jobSpec.Task.TaskName
}
task := lagoonv1beta1.LagoonTask{
ObjectMeta: metav1.ObjectMeta{
Name: "lagoon-advanced-task-" + helpers.RandString(6),
Name: taskName,
Namespace: namespace,
Labels: map[string]string{
"lagoon.sh/taskType": lagoonv1beta1.TaskTypeAdvanced.String(),
Expand Down

0 comments on commit df20fc0

Please sign in to comment.