-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controller fails on empty manifest files from a Helm Chart #2622
Comments
Hi @mphammer, Could you please provide and |
Case 1 is actually pretty common in Helm charts. In fact, we coincidentally test this case in the SDK's helm-operator e2e test (check out the ingress template generated from this command in the test). So I'm fairly certain the Helm operator supports disabling entire resources. Your error seems to indicate that the release contained no resources at all. And in that case, it would make sense to fail an installation. For case 2, this looks like a legitimate bug. My guess is that it is originating from here. We parse each YAML document in the release manifest and assume that we'll find the object meta. In the case of your chart it looks like there are some empty documents, which parse "successfully", but result in an empty object. Any chance you would be interested in submitting a PR to add some extra sanity checks in that function to make sure that we have a non-empty GVK? |
Hi @camilamacedo86, Sorry for the late response. These errors were not from the stable repo but from a custom helm chart. Here are examples of the Charts:
Values.yaml:
templates/service-exposed.yaml (this file will be empty):
templates/service.yaml:
Case 2:
Values.yaml:
templates/services.yaml (there will be an empty manifest):
And by Thanks for taking a look into this! :) |
/assign |
Hi @joelanford, thanks for the information and the "kind/bug" label. I don't currently have the cycles to work on this issue. Thanks @bharathi-tenneti for taking this up! If you need more information from me I will do my best to assist you. |
@mphammer
Was curious, whether you have seen similar error while creation.
P.S
|
@mphammer @bharathi-tenneti Just want to re-iterate my previous comment that I think something slightly different is happening with case 1 than what is described in the issue. The error message you got ( I think we can fix case 2 by checking to make sure the GVK is not empty. |
Hello I'm seeing similar issue:
based on logs, operator can not process Deployments. Looks like operator does create deployments objects but can not watch them. and of cause chart can be deployed via helm without any errors. |
@joelanford we have a partner seeking operator certification that is also seeing case 2. In their particular case, the chart installs and also renders fine using helm3. Putting the same chart into an operator yields case 2, which we believe occurs when the deployment templates get rendered. The following conditional code appears to be tripping up the helm-operator:
The chart name is |
@jsm84 Can you please recheck the charts link from above, will try to reproduce. |
@bharathi-tenneti Sorry about that. That link is a helm repo, and not browser accessible. The following helm commands will add the repo, and then fetch the chart in tar.gz format:
|
@jsm84 What is your helm version and sdk version? |
helm chart is helm2 this chart works find with helm3 and helm2 |
@depohmel Really? If so, that was an unexpected breakage. Do you have details? |
Unfortunately yes, it looks for Charts.lock with is available only in helm 3 since requirements were moved to Chart.yaml. I can create the issue tomorrow with details. |
@joelanford FIled #2806 |
@depohmel @mphammer Can you please try this repo for SDK, and let us know if it fixes Case 2 for you? |
@bharathi-tenneti i'm getting this error, right after fully rendered chart
|
good news that I can see Deployments in logs now. |
@depohmel Great, so did I understand correctly, that your issue is getting fixed when you use SDK repo from this branch? |
Yes, one of them :) there is still another error :( |
@depohmel That seems like a completely separate issue. Can you file a separate GitHub issue for that one? |
OK I've found the bug in the chart that @depohmel is using. It's the exact case 2. There was a template file, v0services.yaml inside the chart that had the following lines:
I've removed the comment and the latter |
Bug Report
What did you do?
For each of the following cases I did these steps:
$ operator-sdk new my-operator --type=helm --helm-chart <local_helm_chart_path>
$ kubectl create -f deploy/crds/<resource>_crd.yaml
$ operator-sdk run --local
kubectl create -f deploy/crds/<resource>_cr.yaml
Case 1: A file containing a resource is empty due to a conditional
Case 2: There is an empty manifest from
---
markersWhat did you expect to see?
What did you see instead? Under which circumstances?
Some of the resources were deployed but I saw the following error messages repeatedly printed...
Case 1:
Case 2:
Environment
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: