Skip to content

Conversation

bkreitch
Copy link
Contributor

Check the error returned by genManifest function when three way merge is performed. This fixes the cases when chart produces incorrect manifest (for example a Deployment without image in initContainers):

...
initContainers:
  - name: nginx-init
...

Currently manifest with an error is just being dropped from comparison and appears as being removed in the diff:

$ helm diff upgrade dummy . --three-way-merge

default, dummy, Deployment (apps) has been removed:
- apiVersion: apps/v1
- kind: Deployment
- metadata:
-   creationTimestamp: "2022-10-21T08:22:50Z"
-   labels:
-     app.kubernetes.io/instance: dummy
-     app.kubernetes.io/managed-by: Helm
...

Now with the fix it will display the proper error:

Error: unable to generate manifests: cannot patch "dummy" with kind Deployment: Deployment.apps "dummy" is invalid: spec.template.spec.initContainers[0].image: Required value
Error: plugin "diff" exited with error

@bkreitch
Copy link
Contributor Author

bkreitch commented Dec 1, 2022

@databus23 Hi, could you please review it?

@databus23 databus23 merged commit 704355f into databus23:master Dec 9, 2022
@databus23
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants