When I restore a helm based deployment to a different namespace, all subsequent helm commands fail due to invalid metadata.
❯ helm upgrade releasename bitnami/chart-name
Error: UPGRADE FAILED: rendered manifests contain a resource that already exists. Unable to continue with update: ServiceAccount "Chart-neme" in namespace "recovery-test" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "recovery-test": current value is "default"
I can delete the ServiceAcc and recreate it, but that does not solve the problem with the invalid annotations. I tried to change all occurrences by hand but ended up with unwanted side effects on the default namespace and the live application.
Is there any documentation how to use the transform function to replace the metadata fields?