Skip to content

Commit 601684a

Browse files
authored
[OCTRL-1091] Add TaskID to the TaskReference CRD (#835)
[control-operator] taskID added to the TaskReference
1 parent 61587af commit 601684a

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

control-operator/api/v1alpha1/environment_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ type EnvironmentStatus struct {
8080

8181
type TaskReference struct {
8282
Name string `json:"name"`
83+
TaskID string `json:"taskID,omitempty"`
8384
Env []v1.EnvVar `json:"env"`
8485
ArgsCLI []string `json:"argsCLI"`
8586
ArgsTransition map[string]string `json:"argsTransition"`

control-operator/config/crd/bases/aliecs.alice.cern_environments.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,6 +4100,8 @@ spec:
41004100
type: array
41014101
name:
41024102
type: string
4103+
taskID:
4104+
type: string
41034105
required:
41044106
- argsCLI
41054107
- argsTransition

control-operator/internal/controller/environment_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ func (r *EnvironmentReconciler) runTasksFromReferenceOnNode(ctx context.Context,
110110
task.Spec.State = environment.Spec.State
111111

112112
task.Labels = labels(environment, nodename)
113+
if taskReference.TaskID != "" {
114+
task.Labels["taskID"] = taskReference.TaskID
115+
}
113116

114117
if err := controllerutil.SetControllerReference(environment, task, r.Scheme); err != nil {
115118
log.Error(err, "failed to set controller reference", "task", task.Name)

0 commit comments

Comments
 (0)