Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 8623329

Browse files
oodamienghillert
authored andcommitted
Update Stream deployment properties validation key
Update regex Update tests
1 parent 5af34c5 commit 8623329

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

ui/src/app/streams/stream-deploy/stream-deploy.validator.spec.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ describe('StreamsDefinitionValidator', () => {
4545
'aaa111.121321aaa',
4646
'aaa111.1213_21aaa',
4747
'aaa111.1213-21aaa',
48-
'aaaa.aaaa.aaaa'
48+
'aaaa.aaaa.aaaa',
49+
'metrics.schedule-interval',
50+
'applicationMetrics.destination'
4951
].forEach((mock) => {
5052
const control: FormControl = new FormControl(mock);
5153
expect(StreamDeployValidator.key(control)).toBeNull();
@@ -76,7 +78,9 @@ describe('StreamsDefinitionValidator', () => {
7678
'version.file',
7779
'deployer.*.foo',
7880
'deployer.file.foo',
79-
'spring.cloud.dataflow.skipper.platformName'
81+
'spring.cloud.dataflow.skipper.platformName',
82+
'app.*.spring.cloud.stream.bindings.applicationMetrics.destination',
83+
'app.*.spring.cloud.stream.metrics.schedule-interval'
8084
].forEach((mock) => {
8185
const control: FormControl = new FormControl(mock);
8286
expect(StreamDeployValidator.keyProperty(control)).toBeNull();
@@ -108,6 +112,14 @@ describe('StreamsDefinitionValidator', () => {
108112
result = StreamDeployValidator.validateDeploymentProperties(formControl);
109113
expect(result).toBe(undefined);
110114

115+
formControl.setValue('app.*.spring.cloud.stream.bindings.applicationMetrics.destination=metrics');
116+
result = StreamDeployValidator.validateDeploymentProperties(formControl);
117+
expect(result).toBe(undefined);
118+
119+
formControl.setValue('app.*.spring.cloud.stream.metrics.schedule-interval=PT10S');
120+
result = StreamDeployValidator.validateDeploymentProperties(formControl);
121+
expect(result).toBe(undefined);
122+
111123
formControl.setValue('baz');
112124
result = StreamDeployValidator.validateDeploymentProperties(formControl);
113125
expect(result.validateDeploymentProperties.reason).toBe('Invalid deployment property "baz" must contain a single "=".');

ui/src/app/streams/stream-deploy/stream-deploy.validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class StreamDeployValidator {
1818
/**
1919
* PropertyKey regex
2020
*/
21-
static propertyKeyRegex = /^(deployer|app|version)(\.\*)?([.][a-zA-Z0-9]{2,50}?)*$/;
21+
static propertyKeyRegex = /^(deployer|app|version)(\.\*)?([.][a-zA-Z0-9-\-\_]{2,50}?)*$/;
2222
/**
2323
* PropertyKey regex
2424
*/

0 commit comments

Comments
 (0)