Skip to content

Commit 88bf945

Browse files
committed
Modify the suggested pipeline version name to be a valid K8s name
This is more important for the Kubernetes pipeline store. Signed-off-by: mprahl <[email protected]>
1 parent 765de9f commit 88bf945

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

frontend/src/pages/NewPipelineVersion.tsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,12 @@ export class NewPipelineVersion extends Page<NewPipelineVersionProps, NewPipelin
474474
const currDate = new Date();
475475
this.setState({
476476
pipelineVersionName:
477-
pipelineResponse.display_name + '_version_at_' + currDate.toISOString(),
477+
pipelineResponse.display_name +
478+
'-version-at-' +
479+
currDate
480+
.toISOString()
481+
.toLowerCase()
482+
.replace(/:/g, '-'),
478483
});
479484
}
480485

@@ -490,7 +495,15 @@ export class NewPipelineVersion extends Page<NewPipelineVersionProps, NewPipelin
490495
// Suggest a version name based on pipeline name
491496
const currDate = new Date();
492497
this.setState(
493-
{ pipelineVersionName: value + '_version_at_' + currDate.toISOString() },
498+
{
499+
pipelineVersionName:
500+
value +
501+
'-version-at-' +
502+
currDate
503+
.toISOString()
504+
.toLowerCase()
505+
.replace(/:/g, '-'),
506+
},
494507
this._validate.bind(this),
495508
);
496509
}
@@ -511,7 +524,14 @@ export class NewPipelineVersion extends Page<NewPipelineVersionProps, NewPipelin
511524
pipelineSelectorOpen: false,
512525
// Suggest a version name based on pipeline name
513526
pipelineVersionName:
514-
(pipeline && pipeline.display_name + '_version_at_' + currDate.toISOString()) || '',
527+
(pipeline &&
528+
pipeline.display_name +
529+
'-version-at-' +
530+
currDate
531+
.toISOString()
532+
.toLowerCase()
533+
.replace(/:/g, '-')) ||
534+
'',
515535
},
516536
() => this._validate(),
517537
);

0 commit comments

Comments
 (0)