seqeralabs / seqera-kit

Python implementation and field-tool for automated pipeline launching through Tower CLI (beta)
Apache License 2.0
25 stars 6 forks source link

[feature] add support for labels #125

Closed alvaromartmart closed 6 months ago

alvaromartmart commented 6 months ago

It is possible to create labels with e.g. tw labels add --name=foo --value=bar --workspace=myorg/myworkspace.

However this seems currently not supported by seqerakit with the equivalent

labels:
  - name: 'foo'
    value: 'bar'
    workspace: 'myorg/myworkspace'
ejseqera commented 6 months ago

Added in #128, you can now create labels. For example:

In a yaml as such:

labels:
  - name: 'foo'
    value: 'seqerakit'
    workspace: 'scidev/testing'
    overwrite: True
$ seqerakit labels.yml
DEBUG:root: Overwrite is set to 'True' for labels

DEBUG:root: Running command: tw -o json labels list -w scidev/testing
INFO:root:Checking if name foo exists in Seqera Platform...
DEBUG:root: Running command: tw labels add --name foo --value seqerakit --workspace scidev/testing

And to demonstrate overwrite functionality when label exists:

$ seqerakit labels.yml
DEBUG:root: Overwrite is set to 'True' for labels

DEBUG:root: Running command: tw -o json labels list -w scidev/testing
INFO:root:Checking if name foo exists in Seqera Platform...
DEBUG:root: The attempted labels resource already exists. Overwriting.

DEBUG:root: Running command: tw labels delete --id 83861403170431 -w scidev/testing
DEBUG:root: Running command: tw labels add --name foo --value seqerakit --workspace scidev/testing