Skip to content

Commit fef20f3

Browse files
fix: normalization on taskSpawner
1 parent de84111 commit fef20f3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/webhook/handler.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,9 @@ func (h *WebhookHandler) createTask(ctx context.Context, spawner *v1alpha1.TaskS
392392

393393
// Build unique task name from delivery info
394394
idVal, _ := templateVars["ID"].(string)
395-
taskName := fmt.Sprintf("%s-%s-%s", spawner.Name, eventType, idVal)
395+
// Sanitize event type for Kubernetes naming (replace underscores with hyphens)
396+
sanitizedEventType := strings.ReplaceAll(eventType, "_", "-")
397+
taskName := fmt.Sprintf("%s-%s-%s", spawner.Name, sanitizedEventType, idVal)
396398
if len(taskName) > 63 {
397399
taskName = strings.TrimRight(taskName[:63], "-.")
398400
}

0 commit comments

Comments
 (0)