export function updateImagePullSecrets()

in src/utilities/manifestUpdateUtils.ts [215:241]


export function updateImagePullSecrets(
   inputObject: any,
   newImagePullSecrets: string[],
   override: boolean = false
) {
   if (!inputObject?.spec || !newImagePullSecrets) return

   const newImagePullSecretsObjects = Array.from(
      newImagePullSecrets,
      (name) => {
         return {name}
      }
   )
   let existingImagePullSecretObjects: any = getImagePullSecrets(inputObject)

   if (override) {
      existingImagePullSecretObjects = newImagePullSecretsObjects
   } else {
      existingImagePullSecretObjects = existingImagePullSecretObjects || []

      existingImagePullSecretObjects = existingImagePullSecretObjects.concat(
         newImagePullSecretsObjects
      )
   }

   setImagePullSecrets(inputObject, existingImagePullSecretObjects)
}