Skip to content

Commit

Permalink
Merge pull request #53 from mareklibra/baseDNS.example
Browse files Browse the repository at this point in the history
Add example of base DNS domain
  • Loading branch information
mareklibra authored Jun 30, 2020
2 parents e9c684a + 1d16b46 commit 777807b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions src/components/clusterConfiguration/BasicNetworkFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,28 @@ type BasicNetworkFieldsProps = {
};

const BasicNetworkFields: React.FC<BasicNetworkFieldsProps> = ({ hostSubnets }) => {
const { validateField } = useFormikContext<ClusterConfigurationValues>();
const { validateField, values } = useFormikContext<ClusterConfigurationValues>();
const { name: clusterName, baseDnsDomain, hostSubnet } = values;

const baseDnsHelperText = (
<>
The base domain of the cluster. All DNS records must be sub-domains of this base and include
the cluster name. This cannot be changed later. The full cluster address will be:{' '}
<strong>
{clusterName || '[Cluster Name]'}.{baseDnsDomain || '[example.com]'}
</strong>
</>
);

const subnet = hostSubnet ? ` (${hostSubnet})` : '';

return (
<>
<InputField
label="Base DNS Domain"
name="baseDnsDomain"
helperText="The base domain of the cluster. All DNS records must be sub-domains of this base and include the cluster name."
helperText={baseDnsHelperText}
placeholder="example.com"
isRequired
/>
<SelectField
Expand Down Expand Up @@ -43,7 +58,7 @@ const BasicNetworkFields: React.FC<BasicNetworkFieldsProps> = ({ hostSubnets })
<InputField
label="API Virtual IP"
name="apiVip"
helperText="Virtual IP used to reach the OpenShift cluster API. Make sure that the VIP's are unique and not used by any other device on your network."
helperText={`Virtual IP used to reach the OpenShift cluster API. Make sure that the VIP's are unique and not used by any other device on your network${subnet}.`}
isRequired
isDisabled={!hostSubnets.length}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/formik/validationSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const ipBlockValidationSchema = Yup.string().matches(IP_ADDRESS_BLOCK_REG
});

export const dnsNameValidationSchema = Yup.string().matches(DNS_NAME_REGEX, {
message: 'Value "${value}" is not valid DNS name.', // eslint-disable-line no-template-curly-in-string
message: 'Value "${value}" is not valid DNS name. Example: basedomain.example.com', // eslint-disable-line no-template-curly-in-string
excludeEmptyString: true,
});

Expand Down

0 comments on commit 777807b

Please sign in to comment.