Skip to content

Commit

Permalink
Merge pull request #1042 from sgratch/add-validation-for-openstack-ca…
Browse files Browse the repository at this point in the history
…cert-field

🐞 Support validation for the openStack CA certificate field
  • Loading branch information
yaacov authored Mar 31, 2024
2 parents 19ca22b + 4a43e73 commit 6a154d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
"Error": "Error",
"Error: Insecure Skip Verify must be a boolean value.": "Error: Insecure Skip Verify must be a boolean value.",
"Error: Name is required and must be a unique within a namespace and valid Kubernetes name (i.e., must contain no more than 253 characters, consists of lower case alphanumeric characters , '-' or '.' and starts and ends with an alphanumeric character).": "Error: Name is required and must be a unique within a namespace and valid Kubernetes name (i.e., must contain no more than 253 characters, consists of lower case alphanumeric characters , '-' or '.' and starts and ends with an alphanumeric character).",
"Error: The format of the provided CA certificate is invalid. Ensure the CA certificate format is valid.": "Error: The format of the provided CA certificate is invalid. Ensure the CA certificate format is valid.",
"Error: this field must be set to a boolean value.": "Error: this field must be set to a boolean value.",
"ESXi": "ESXi",
"Expiration date": "Expiration date",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ export const OpenstackCredentialsEdit: React.FC<EditComponentProps> = ({ secret,
successAndNotSkipped: t("The provider's CA certificate will be validated."),
};

const cacertHelperTextMsgs = {
error: t(
'Error: The format of the provided CA certificate is invalid. Ensure the CA certificate format is valid.',
),
success: t(
'A CA certificate to be trusted when connecting to the OpenStack Identity (Keystone) endpoint. Ensure the CA certificate format is valid. To use a CA certificate, drag the file to the text box or browse for it. To use the system CA certificate, leave the field empty.',
),
};

const insecureSkipVerifyHelperTextPopover = (
<ForkliftTrans>
Note: If <strong>Skip certificate validation</strong> is selected, migrations from this
Expand Down Expand Up @@ -278,16 +269,16 @@ export const OpenstackCredentialsEdit: React.FC<EditComponentProps> = ({ secret,
: t('CA certificate - leave empty to use system CA certificates')
}
fieldId="cacert"
helperText={cacertHelperTextMsgs.success}
validated={state.validation.cacert}
helperTextInvalid={cacertHelperTextMsgs.error}
helperText={state.validation.cacert.msg}
validated={state.validation.cacert.type}
helperTextInvalid={state.validation.cacert.msg}
>
<CertificateUpload
id="cacert"
type="text"
filenamePlaceholder="Drag and drop a file or upload one"
value={cacert}
validated={state.validation.cacert}
validated={state.validation.cacert.type}
onDataChange={(value) => handleChange('cacert', value)}
onTextChange={(value) => handleChange('cacert', value)}
onClearClick={() => handleChange('cacert', '')}
Expand Down

0 comments on commit 6a154d7

Please sign in to comment.