Skip to content
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

helm overrideValues will not work for booleans #6115

Closed
xrow opened this issue Oct 27, 2022 · 10 comments
Closed

helm overrideValues will not work for booleans #6115

xrow opened this issue Oct 27, 2022 · 10 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. language/helm Issue is related to a Helm operator project lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/support Indicates an issue that is a support question.
Milestone

Comments

@xrow
Copy link

xrow commented Oct 27, 2022

Bug Report

What did you do?

When susing the helm operator sdk I have an issue with override vars not being strings.

My watches looks like this

---
- version: v1
  group: xrow.com
  kind: Ibexa
  chart: /opt/helm/helm-charts/ibexa
  watchDependentResources: false
  overrideValues:
    installation.enabled: true

What did you expect to see?

no issue when using my operator

What did you see instead? Under which circumstances?

From the pod log from the operator:

{"level":"error","ts":1666869259.3604903,"logger":"helm.controller","msg":"Failed to sync release","namespace":"test1","name":"ibexa","apiVersion":"xrow.com/v1","kind":"Ibexa","release":"ibexa","error":"failed to get candidate release: values don't meet the specifications of the schema(s) in the following chart(s):\nibexa:\n- installation.enabled: Invalid type. Expected: boolean, given: string\n","stacktrace":"github.com/operator-framework/operator-sdk/internal/helm/controller.HelmOperatorReconciler.Reconcile\n\t/workspace/internal/helm/controller/reconcile.go:218\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:234"}

Environment

Operator type:

language helm

Kubernetes cluster type:

OpenShift 3.11

$ operator-sdk version

1.25.0

$ kubectl version

not applicable

Possible Solution

make false, true, False, True not quoted or keep the type somehow.

Additional context

My chart has a schema json that can validate the values

such as

    "installation": {
      "type": "object",
      "properties": {
          "enabled": {
              "type": "boolean"
          },
          "package": {
              "type": "string"
          },
          "script": {
              "type": "string"
          }
      }
    },
@xrow
Copy link
Author

xrow commented Oct 27, 2022

OverrideValues map[string]string

A map of strings per default.

@varshaprasad96 varshaprasad96 added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 31, 2022
@varshaprasad96
Copy link
Member

@xrow As you have pointed out correctly, this is because the overrideValues option takes in a map of strings as key/value type (https://github.com/operator-framework/operator-sdk/blob/v1.25.0/internal/helm/controller/reconcile.go#L54). This seems a reasonable feature, we may have to look into the implementation details as the override values can also be environment variables.

/kind feature

@jmrodri jmrodri added language/helm Issue is related to a Helm operator project triage/support Indicates an issue that is a support question. labels Oct 31, 2022
@jmrodri jmrodri added this to the Backlog milestone Oct 31, 2022
@everettraven
Copy link
Contributor

/unassign jmrodri

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 23, 2023
@skattoju
Copy link

skattoju commented Apr 3, 2023

In the context of "hybrid" helm operators, can OverrideValues be more than a map of strings somehow ? If i am packaging a helm chart as an operator, is anything additional a hybrid operator can do limited to adding a different controller ? .. If so, the only way to override non string values is by specifying things in spec of the "helm" cr ? I wanted to check if I have some incorrect assumptions.

@skattoju
Copy link

skattoju commented Apr 3, 2023

Trying to do something like this so that OverrideValues don't have to be set in spec : https://github.com/skattoju/airflow-hybrid-operator/blob/afd9e854876fe487ce503285a34c5935c8bb064e/watches.yaml#L9

@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 4, 2023
@skattoju
Copy link

skattoju commented May 4, 2023

@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci openshift-ci bot closed this as completed Jun 3, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jun 3, 2023

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

holyspectral added a commit to holyspectral/neuvector-helm that referenced this issue Feb 9, 2024
operator-sdk has limitation to override boolean value.

operator-framework/operator-sdk#6115

This commit allows string type of the flag, so we can override it from
helm-operator level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. language/helm Issue is related to a Helm operator project lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/support Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

6 participants