Skip to content

Commit

Permalink
fix(settings): loosen generic container registry validation (#1679)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctjhoa authored Sep 19, 2024
1 parent 2c35601 commit 96fa2bf
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,15 @@ export function ContainerRegistryForm({
rules={{
required: 'Please enter a registry url.',
validate: (input) =>
// eslint-disable-next-line no-useless-escape
input?.match(/^(http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:?#[\]@!\$&'\(\)\*\+,;=.]+$/gm) !== null ||
'URL must be valid and start with «http(s)://»',
match(watchKind)
.with('GENERIC_CR', () =>
// eslint-disable-next-line no-useless-escape
input?.match(/^(http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:\/?#[\]@!\$&'\(\)\*\+,;=.]+$/gm)
)
.otherwise(() =>
// eslint-disable-next-line no-useless-escape
input?.match(/^(http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:?#[\]@!\$&'\(\)\*\+,;=.]+$/gm)
) !== null || 'URL must be valid and start with «http(s)://»',
}}
render={({ field, fieldState: { error } }) => (
<InputText
Expand Down

0 comments on commit 96fa2bf

Please sign in to comment.