Skip to content

Container Location regex: need to support additional segments or domains. #128

@elenaviter

Description

@elenaviter

Description

Scope

Ability to configure, in Stacks, images from the private artifactory which could have complex data organization structure.

Details

Existing Container Location regex works fine with regular domain/subdomain:version formats of docker image location.

However it does not work for data organization in our artifactory.
Example of the url that does work:

  • dc-if/flowforge/node-red:1.13.3

Examples of the location string which does not work:

  • {COMPANY}.jfrog.io/tenant-dev/dc-if/flowforge/node-red:1.13.3
  • {tenant-dev/dc-if/flowforge/node-red:1.13.3

Suggestion

@hardillb could you have a look on regex like this to use?
'^([a-z0-9][a-z0-9\\-]*(\\.[a-z0-9\\-]+)*\\/)+[a-z0-9\\-]+(?:\\/[a-z0-9\\-]+)*(?::[0-9]+\\.[0-9]+\\.[0-9]+)?$'

let validate = '^([a-z0-9][a-z0-9\\-]*(\\.[a-z0-9\\-]+)*\\/)+[a-z0-9\\-]+(?:\\/[a-z0-9\\-]+)*(?::[0-9]+\\.[0-9]+\\.[0-9]+)?$';
let validator = new RegExp(validate);

let val1 = "aiola.jfrog.io/aiola-dev/dc-if/flowforge/node-red:1.13.3";
let val2 = "dc-if/flowforge/node-red:1.13.3";
let val3 = "aiola-dev/dc-if/flowforge/node-red:1.13.3";
let val4 = "flowforge/node-red:1.13.3";

console.log(validator.test(val1)); // Should be true
console.log(validator.test(val2)); // Should be true
console.log(validator.test(val3)); // Should be true
console.log(validator.test(val4)); // Should be true

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or request that needs to be turned into Epic/Story detailsneeds-triageNeeds looking at to decide what to do

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions