Skip to content

Commit

Permalink
Merge pull request #4835 from yaacov/kubevirt-dont-error-on-template-…
Browse files Browse the repository at this point in the history
…before-loading

kubevirt: Don't show error message before templates are loaded
  • Loading branch information
openshift-merge-robot committed Mar 27, 2020
2 parents 64a539f + 683b002 commit b30ffdf
Showing 1 changed file with 6 additions and 4 deletions.
@@ -1,5 +1,4 @@
import * as _ from 'lodash';
import { List } from 'immutable';
import {
asValidationObject,
ValidationErrorType,
Expand Down Expand Up @@ -44,7 +43,6 @@ import { vmSettingsOrder } from '../initial-state/vm-settings-tab-initial-state'
import { TemplateValidations } from '../../../../utils/validations/template/template-validations';
import { combineIntegerValidationResults } from '../../../../utils/validations/template/utils';
import { getValidationUpdate } from './utils';

import { getTemplateValidations } from '../../selectors/template';

const validateVm: VmSettingsValidator = (field, options) => {
Expand Down Expand Up @@ -82,10 +80,14 @@ const validateUserTemplate: VmSettingsValidator = (field, options) => {
return null;
}

const userTemplate = iGetLoadedCommonData(state, id, VMWizardProps.userTemplates, List()).find(
const userTemplatesList = iGetLoadedCommonData(state, id, VMWizardProps.userTemplates);
if (!userTemplatesList) {
return null;
}

const userTemplate = userTemplatesList.find(
(template) => iGetName(template) === userTemplateName,
);

if (!userTemplate) {
return asValidationObject(
"Can't verify template, template is missing",
Expand Down

0 comments on commit b30ffdf

Please sign in to comment.