Skip to content

Commit

Permalink
Fix bug with K8s resource labels (#4147) [ci fast]
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
  • Loading branch information
bentsherman committed Aug 3, 2023
1 parent 6b46b50 commit 3f4b855
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class K8sTaskHandler extends TaskHandler implements FusionAwareTask {
}
final resLabels = task.config.getResourceLabels()
if( resLabels )
resLabels.putAll(resLabels)
result.putAll(resLabels)
result.'nextflow.io/app' = 'nextflow'
result.'nextflow.io/runName' = getRunName()
result.'nextflow.io/taskName' = task.getName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,9 @@ class K8sTaskHandlerTest extends Specification {
handler.getRunName() >> 'pedantic-joe'
task.getName() >> 'hello-world-1'
task.getProcessor() >> proc
task.getConfig() >> Mock(TaskConfig)
task.getConfig() >> Mock(TaskConfig) {
getResourceLabels() >> [mylabel: 'myvalue']
}
proc.getName() >> 'hello-proc'
exec.getSession() >> sess
sess.getUniqueId() >> uuid
Expand All @@ -873,7 +875,9 @@ class K8sTaskHandlerTest extends Specification {
[label: 'app', value: 'nextflow'],
[label: 'x', value: 'hello_world']
]]

and:
labels.mylabel == 'myvalue'
and:
labels.app == 'nextflow'
labels.foo == 'bar'
labels.x == 'hello_world'
Expand Down

0 comments on commit 3f4b855

Please sign in to comment.