kubewarden / helm-charts

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

fix: schema with XOR for minAvailable, maxUnavailable #506

Closed viccuad closed 1 month ago

viccuad commented 1 month ago

Description

Relates to https://github.com/kubewarden/helm-charts/pull/505

Revert to using string for minAvailable, maxUnavailable. Fix the schema to only accept either minAvailable only, maxUnavailable only, or neither (XOR).

Test

Tested by consuming the following values:

recommendedPolicies:
  enabled: True
  defaultPolicyMode: monitor
policyServer:
  minAvailable: "20%"
  maxUnavailable: "1"

Which results on:

$ helm lint ./charts/kubewarden-defaults --values myvalues.yaml
==> Linting ./charts/kubewarden-defaults
[ERROR] values.yaml: - policyServer: Must validate at least one schema (anyOf)
- policyServer: Must validate one and only one schema (oneOf)

[ERROR] templates/: values don't meet the specifications of the schema(s) in the following chart(s):
kubewarden-defaults:
- policyServer: Must validate at least one schema (anyOf)
- policyServer: Must validate one and only one schema (oneOf)

Error: 1 chart(s) linted, 1 chart(s) failed

Yet notice there's no pretty error.

Additional Information

This change is backwards compatible with released charts.

Tradeoff

Potential improvement