Skip to content

Commit

Permalink
Handled duplicate image pull secrets issue in D & DC edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
lokanandaprabhu authored and openshift-cherrypick-robot committed Dec 18, 2024
1 parent b50c51c commit 769ff2b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,12 @@ export const convertEditFormToDeployment = (
containers: getUpdatedContainers(containers, fromImageStreamTag, isi, imageName, envs),
imagePullSecrets: [
...(deployment.spec.template.spec.imagePullSecrets ?? []),
...(imagePullSecret ? [{ name: imagePullSecret }] : []),
...(imagePullSecret &&
!(deployment.spec.template.spec.imagePullSecrets ?? []).some(
(secret) => secret.name === imagePullSecret,
)
? [{ name: imagePullSecret }]
: []),
],
},
},
Expand Down

0 comments on commit 769ff2b

Please sign in to comment.