Skip to content

Commit

Permalink
fix pipeline yaml edit flow
Browse files Browse the repository at this point in the history
  • Loading branch information
debsmita1 committed Dec 21, 2020
1 parent 36558f2 commit eaab40c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import * as _ from 'lodash';
import { RouteComponentProps } from 'react-router-dom';
import { Helmet } from 'react-helmet';
import { Formik, FormikBag } from 'formik';
Expand Down Expand Up @@ -49,9 +50,7 @@ const PipelineBuilderPage: React.FC<PipelineBuilderPageProps> = (props) => {
if (values.editorType === EditorType.YAML) {
try {
pipeline = safeLoad(values.yamlData);
if (!pipeline.metadata?.namespace) {
pipeline.metadata.namespace = ns;
}
pipeline = _.merge({}, existingPipeline || {}, pipeline);
} catch (err) {
actions.setStatus({ submitError: `Invalid YAML - ${err}` });
return null;
Expand Down

0 comments on commit eaab40c

Please sign in to comment.