kubewarden / helm-charts

Helm charts for the Kubewarden project
Apache License 2.0
25 stars 17 forks source link

fix: values.schema.json PDB variable type #505

Closed ferhatguneri closed 2 months ago

ferhatguneri commented 2 months ago

Description

Breaking some automations while passing parameters from one file another. Original variable type should be corrected. Otherwise facing unnecessary issues.

Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s): kubewarden-defaults: policyServer.minAvailable: Invalid type. Expected: string, given: integer

Test

To test this pull request, you can run the following commands:

Additional Information

Tradeoff

Potential improvement

viccuad commented 2 months ago

Hi, thanks for opening this PR. I agree that the schema and the values should expect integer, that way we check earlier for the correct value.

I'm not sure just making the current change and keeping the defaults in values.yml will work, I believe the Schema needs some changes too. Please give me a bit to verify.

As a workaround, one can deploy the current charts with --set policyServer.minAvailable="2.0" for example.

viccuad commented 2 months ago

I believe the correct Schema is (with no defaults in values.yaml):

      "oneOf": [
        {
          "properties": {
            "minAvailable": {
              "type": "integer",
              "minLength": 1
            },
            "maxUnavailable": {
              "type": "integer",
              "minLength": 1
            }
          }
        }
      ],

This PR is a partial fix, thanks. I'm merging, and will open a follow-up PR.

viccuad commented 2 months ago

@ferhatguneri I will surely revert back the change on this PR, as minAvailable and maxUnavailable can be a string percentage (e.g: "30%") which is arguably more useful with scaling deployments.

Could you share the values.yaml that prompted this PR please? Since we expect string, it would be enough with surrounding the values by ".