Wizard: make Satellite CA cert optional
Users do not need to fill in the satellite certificate, omitting parts of code that require it.
This commit is contained in:
parent
2ee812efe0
commit
4c82ae8749
2 changed files with 2 additions and 12 deletions
|
|
@ -50,7 +50,7 @@ const SatelliteRegistration = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SatelliteRegistrationCommand />
|
<SatelliteRegistrationCommand />
|
||||||
<FormGroup label="Certificate authority (CA) for Satellite" isRequired>
|
<FormGroup label="Certificate authority (CA) for Satellite">
|
||||||
<FileUpload
|
<FileUpload
|
||||||
id="text-file-with-restrictions-example"
|
id="text-file-with-restrictions-example"
|
||||||
type="text"
|
type="text"
|
||||||
|
|
@ -59,7 +59,6 @@ const SatelliteRegistration = () => {
|
||||||
onDataChange={handleDataChange}
|
onDataChange={handleDataChange}
|
||||||
onTextChange={handleTextChange}
|
onTextChange={handleTextChange}
|
||||||
onClearClick={handleClear}
|
onClearClick={handleClear}
|
||||||
isRequired={true}
|
|
||||||
dropzoneProps={{
|
dropzoneProps={{
|
||||||
accept: {
|
accept: {
|
||||||
'application/x-pem-file': ['.pem'],
|
'application/x-pem-file': ['.pem'],
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import {
|
||||||
selectLanguages,
|
selectLanguages,
|
||||||
selectKeyboard,
|
selectKeyboard,
|
||||||
selectTimezone,
|
selectTimezone,
|
||||||
selectSatelliteCaCertificate,
|
|
||||||
selectSatelliteRegistrationCommand,
|
selectSatelliteRegistrationCommand,
|
||||||
selectImageTypes,
|
selectImageTypes,
|
||||||
UserWithAdditionalInfo,
|
UserWithAdditionalInfo,
|
||||||
|
|
@ -177,7 +176,6 @@ export function useRegistrationValidation(): StepValidation {
|
||||||
const registrationCommand = useAppSelector(
|
const registrationCommand = useAppSelector(
|
||||||
selectSatelliteRegistrationCommand
|
selectSatelliteRegistrationCommand
|
||||||
);
|
);
|
||||||
const caCertificate = useAppSelector(selectSatelliteCaCertificate);
|
|
||||||
|
|
||||||
const { isFetching: isFetchingKeyInfo, isError: isErrorKeyInfo } =
|
const { isFetching: isFetchingKeyInfo, isError: isErrorKeyInfo } =
|
||||||
useShowActivationKeyQuery(
|
useShowActivationKeyQuery(
|
||||||
|
|
@ -212,20 +210,13 @@ export function useRegistrationValidation(): StepValidation {
|
||||||
|
|
||||||
if (registrationType === 'register-satellite') {
|
if (registrationType === 'register-satellite') {
|
||||||
const errors = {};
|
const errors = {};
|
||||||
if (caCertificate === '') {
|
|
||||||
Object.assign(errors, {
|
|
||||||
certificate:
|
|
||||||
'Valid certificate must be present if you are registering Satellite.',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const tokenErrors = validateSatelliteToken(registrationCommand);
|
const tokenErrors = validateSatelliteToken(registrationCommand);
|
||||||
Object.assign(errors, tokenErrors);
|
Object.assign(errors, tokenErrors);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
errors: errors,
|
errors: errors,
|
||||||
disabledNext:
|
disabledNext:
|
||||||
Object.keys(errors).some((key) => key !== 'expired') ||
|
Object.keys(errors).some((key) => key !== 'expired') ||
|
||||||
!caCertificate ||
|
|
||||||
!registrationCommand,
|
!registrationCommand,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue