Skip to content

Commit

Permalink
Merge pull request #234 from uselagoon/advanced-task-name-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon authored Nov 1, 2023
2 parents 6300ef9 + df20fc0 commit 68f8f17
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 68f8f17

Please sign in to comment.