(task Task[T])
| 125 | type CloudupModelBuilderContext = ModelBuilderContext[CloudupSubContext] |
| 126 | |
| 127 | func (c *ModelBuilderContext[T]) AddTask(task Task[T]) { |
| 128 | task = c.setLifecycleOverride(task) |
| 129 | key := buildTaskKey(task) |
| 130 | |
| 131 | existing, found := c.Tasks[key] |
| 132 | if found { |
| 133 | klog.Fatalf("found duplicate tasks with name %q: %v and %v", key, task, existing) |
| 134 | } |
| 135 | c.Tasks[key] = task |
| 136 | } |
| 137 | |
| 138 | // EnsureTask ensures that the specified task is configured. |
| 139 | // It adds the task if it does not already exist. |