FlowFuse / FlowFuse/driver-k8s

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

Open
#128 3 comments 0 reactions 0 assignees View on GitHub
needs-triage type:feature
Dominant language
JavaScript
Stars
2
Forks
3
Avg merge
1d 4h
Merged PRs (30d)
10

Description

### Description

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

### Details
Existing [Container Location regex](https://github.com/FlowFuse/driver-k8s/blob/main/kubernetes.js#L712) 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]+)?$'`

```js
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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.