Removed generateName in upload YAML functionality (#2498)
* Fixed an edge case for generateName in upload YAML * Minor fix Signed-off-by: Amit Kumar Das <amitkumar.das@mayadata.io>
This commit is contained in:
parent
2d2ea63899
commit
105932fac2
|
|
@ -7,7 +7,7 @@ const useStyles = makeStyles((theme) => ({
|
||||||
background: theme.palette.cards.background,
|
background: theme.palette.cards.background,
|
||||||
height: '16rem',
|
height: '16rem',
|
||||||
width: '11.875rem',
|
width: '11.875rem',
|
||||||
borderRadius: '3rem',
|
borderRadius: 3,
|
||||||
fontSize: '0.875rem',
|
fontSize: '0.875rem',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,10 @@ const TuneWorkflow: React.FC = () => {
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
data.text().then((yamlText) => {
|
data.text().then((yamlText) => {
|
||||||
const parsedYaml = YAML.parse(yamlText);
|
const parsedYaml = YAML.parse(yamlText);
|
||||||
delete parsedYaml.metadata.generateName;
|
// Edge case to remove the generateName Field
|
||||||
|
if (parsedYaml.metadata.generateName) {
|
||||||
|
delete parsedYaml.metadata.generateName;
|
||||||
|
}
|
||||||
parsedYaml.metadata.name = workflowData.name;
|
parsedYaml.metadata.name = workflowData.name;
|
||||||
const modifiedYAML = changeEngineName(parsedYaml);
|
const modifiedYAML = changeEngineName(parsedYaml);
|
||||||
setYamlFile(modifiedYAML);
|
setYamlFile(modifiedYAML);
|
||||||
|
|
@ -126,7 +129,13 @@ const TuneWorkflow: React.FC = () => {
|
||||||
if (yaml === 'none' || yaml === '') {
|
if (yaml === 'none' || yaml === '') {
|
||||||
fetchYaml(link);
|
fetchYaml(link);
|
||||||
} else {
|
} else {
|
||||||
const modifiedYAML = changeEngineName(YAML.parse(yaml));
|
const parsedYaml = YAML.parse(yaml);
|
||||||
|
// Edge case to remove the generateName Field
|
||||||
|
if (parsedYaml.metadata.generateName) {
|
||||||
|
delete parsedYaml.metadata.generateName;
|
||||||
|
}
|
||||||
|
parsedYaml.metadata.name = workflowData.name;
|
||||||
|
const modifiedYAML = changeEngineName(parsedYaml);
|
||||||
workflow.setWorkflowDetails({
|
workflow.setWorkflowDetails({
|
||||||
yaml: modifiedYAML,
|
yaml: modifiedYAML,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue