Skip to content

Commit

Permalink
feat: add job_state as label
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Arya committed Oct 8, 2024
1 parent 038ef6e commit 0e38e29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/dagger/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
labelURN = "urn"
labelName = "name"
labelNamespace = "namespace"
labelJobState = "job_state"

orchestratorLabelValue = "entropy"
)
Expand Down
6 changes: 6 additions & 0 deletions modules/dagger/driver_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (dd *daggerDriver) planCreate(exr module.ExpandedResource, act module.Actio
conf.JarURI = dd.conf.JarURI
conf.State = StateDeployed
conf.JobState = JobStateRunning
exr.Resource.Labels[labelJobState] = conf.JobState

exr.Resource.Spec.Configs = modules.MustJSON(conf)

Expand Down Expand Up @@ -128,6 +129,11 @@ func (dd *daggerDriver) planChange(exr module.ExpandedResource, act module.Actio

exr.Resource.Spec.Configs = modules.MustJSON(curConf)

if act.Labels != nil {
exr.Resource.Labels = act.Labels
}
exr.Resource.Labels[labelJobState] = curConf.JobState

err = dd.validateHelmReleaseConfigs(exr, *curConf)
if err != nil {
return nil, err
Expand Down

0 comments on commit 0e38e29

Please sign in to comment.