Skip to content

Commit

Permalink
Add dns name verify to hook SA name/ns (#876)
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknelson committed May 22, 2020
1 parent d8cf3c8 commit 83fb7b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/app/plan/components/Wizard/HooksFormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,28 @@ const AddEditHooksFormContainer = withFormik<
if (values.clusterType === 'source') {
if (!values.srcServiceAccountName) {
errors.srcServiceAccountName = 'Required';
} else if (!utils.testDNS1123(values.srcServiceAccountName)) {
errors.srcServiceAccountName = utils.DNS1123Error(values.srcServiceAccountName);
}

if (!values.srcServiceAccountNamespace) {
errors.srcServiceAccountNamespace = 'Required';
} else if (!utils.testDNS1123(values.srcServiceAccountNamespace)) {
errors.srcServiceAccountNamespace = utils.DNS1123Error(values.srcServiceAccountNamespace);
}
}

if (values.clusterType === 'destination') {
if (!values.destServiceAccountName) {
errors.destServiceAccountName = 'Required';
} else if (!utils.testDNS1123(values.destServiceAccountName)) {
errors.destServiceAccountName = utils.DNS1123Error(values.destServiceAccountName);
}

if (!values.destServiceAccountNamespace) {
errors.destServiceAccountNamespace = 'Required';
} else if (!utils.testDNS1123(values.destServiceAccountNamespace)) {
errors.destServiceAccountNamespace = utils.DNS1123Error(values.destServiceAccountNamespace);
}
}

Expand Down
8 changes: 0 additions & 8 deletions src/app/plan/components/Wizard/HooksStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@ import {
Bullseye,
EmptyState,
EmptyStateVariant,
EmptyStateBody,
Title,
Button,
EmptyStateIcon,
InputGroup,
TextInput,
Flex,
FlexItem,
FlexModifiers,
} from '@patternfly/react-core';
import { SearchIcon } from '@patternfly/react-icons';
import { AddEditMode } from '../../../common/add_edit_state';
import HooksFormContainer from './HooksFormContainer';
import { max } from 'moment';
import { IMigHook } from '../../../../client/resources/conversions';

const classNames = require('classnames');
Expand Down

0 comments on commit 83fb7b5

Please sign in to comment.