Skip to content

Commit 01d955d

Browse files
committed
fix: registry is updated without password
1 parent 57660f8 commit 01d955d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/dockerRegistry/Docker.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import { KeyboardEventHandler, useEffect, useState } from 'react'
1818
import {
1919
showError,
2020
Progressing,
21-
TippyCustomized,
22-
TippyTheme,
2321
sortCallback,
2422
ErrorScreenNotAuthorized,
2523
Reload,
@@ -439,7 +437,7 @@ const DockerForm = ({
439437
registryUrl: { value: registryUrl, error: '' },
440438
username: { value: username, error: '' },
441439
password: {
442-
value: id && !password ? DEFAULT_SECRET_PLACEHOLDER : regPass,
440+
value: id && username && !password ? DEFAULT_SECRET_PLACEHOLDER : regPass,
443441
error: '',
444442
},
445443
repositoryList: {
@@ -1024,12 +1022,12 @@ const DockerForm = ({
10241022
if (
10251023
registryStorageType === RegistryStorageType.OCI_PRIVATE &&
10261024
authenticationType === RegistryCredentialsType.USERNAME_PASSWORD &&
1027-
(!customState.username.value || !(customState.password.value || id))
1025+
(!customState.username.value || !(customState.password.value || (id && username)))
10281026
) {
10291027
setCustomState((st) => ({
10301028
...st,
10311029
username: { ...st.username, error: st.username.value ? '' : 'Mandatory' },
1032-
password: { ...st.password, error: id || st.password.value ? '' : 'Mandatory' },
1030+
password: { ...st.password, error: (id && username) || st.password.value ? '' : 'Mandatory' },
10331031
}))
10341032
error = true
10351033
}
@@ -1664,7 +1662,7 @@ const DockerForm = ({
16641662
selectedDockerRegistryType.value === RegistryType.QUAY ||
16651663
selectedDockerRegistryType.value === RegistryType.OTHER) && (
16661664
<PasswordField
1667-
shouldShowDefaultPlaceholderOnBlur={!!id}
1665+
shouldShowDefaultPlaceholderOnBlur={!!id && !!username}
16681666
name="password"
16691667
required
16701668
value={customState.password.value}

0 commit comments

Comments
 (0)