Skip to content

Invert regexp operator #25931

Open
Open
@IgnacioHeredia

Description

@IgnacioHeredia

Proposal

I want to have a constraint that makes the job avoid clients with batch (substring) in their metadata tags (string) field.
The issue is loosely related to #6610.

test, batch, demo --> avoid
test, demo --> fine

Attempted Solutions

  1. I've tried this:

      constraint {
        attribute = "${meta.tags}"
        operator  = "regexp"
        value     = "^(?!.*batch).*$"
      }

    But it looks the Go engine does not support negative lookaheads for performance reasons (ref).

  2. One option would be to negate the regexp operator, but regexp_not does not seem to exist in Nomad.

Is there any way to achieve this in Nomad? I've ended up moving batch to a different individual metadata field, but I would like to know if it's possible just in case for next time.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Needs Roadmapping

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions