Skip to content

Commit 225af2e

Browse files
committed
fix for oci public validation
1 parent 04f3a63 commit 225af2e

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/components/dockerRegistry/Docker.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -718,19 +718,22 @@ function DockerForm({
718718
selectedDockerRegistryType.value === RegistryType.OTHER
719719
) {
720720
let error = false
721-
if (
722-
(!isPublic && !customState.username.value) ||
723-
!(customState.password.value || id) ||
724-
!customState.registryUrl.value
725-
) {
726-
setCustomState((st) => ({
727-
...st,
728-
username: { ...st.username, error: st.username.value ? '' : 'Mandatory' },
729-
password: { ...st.password, error: id || st.password.value ? '' : 'Mandatory' },
730-
registryUrl: { ...st.registryUrl, error: st.registryUrl.value ? '' : 'Mandatory' },
731-
}))
732-
error = true
721+
if (registryStorageType === RegistryStorageType.OCI_PRIVATE) {
722+
if (
723+
!customState.username.value ||
724+
!(customState.password.value || id) ||
725+
!customState.registryUrl.value
726+
) {
727+
setCustomState((st) => ({
728+
...st,
729+
username: { ...st.username, error: st.username.value ? '' : 'Mandatory' },
730+
password: { ...st.password, error: id || st.password.value ? '' : 'Mandatory' },
731+
registryUrl: { ...st.registryUrl, error: st.registryUrl.value ? '' : 'Mandatory' },
732+
}))
733+
error = true
734+
}
733735
}
736+
734737
if (
735738
selectedDockerRegistryType.value === RegistryType.OTHER &&
736739
state.advanceSelect.value === CERTTYPE.SECURE_WITH_CERT

0 commit comments

Comments
 (0)