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

[bitnami/zookeeper] Make Zookeeper DefaultMode YAML 1.2 Compliant #21081

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

schrieveslaach
Copy link
Contributor

Description of the change

With the YAML 1.2 spec octals must be prefixed with 0o and not 0. Parsers implementing the latest spec run into issues.

Benefits

This commit makes the Zookeeper script mount compliant with YAML 1.2.

Possible drawbacks

Applicable issues

None at the moment

Additional information

See background discussion here: dtolnay/serde-yaml#225

Checklist

  • Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

@github-actions github-actions bot added the triage Triage is needed label Nov 21, 2023
@javsalgar javsalgar added the verify Execute verification workflow for these changes label Nov 22, 2023
@github-actions github-actions bot added in-progress and removed triage Triage is needed labels Nov 22, 2023
@bitnami-bot bitnami-bot removed the request for review from javsalgar November 22, 2023 10:36
@andresbono
Copy link
Contributor

Hi, thanks for opening this PR! I have some concerns about merging this PR because the Kubernetes API Reference for v1.28 is still using the YAML v1.1 format for octals:

Must be an octal value between 0000 and 0777 [...] YAML accepts both octal and decimal values [...]. Defaults to 0644.

Could this cause some backwards incompatibility in some old (or current) versions of the k8s tooling? helm, kubectl... Would this change generate confudion for users as the official k8s API spec is documented using the old format? If we apply this update, shouldn't we apply it globally to all the charts for homogeneity?

What is the specific issue you are finding by sticking to YAML v1.1 format?

@schrieveslaach
Copy link
Contributor Author

What is the specific issue you are finding by sticking to YAML v1.1 format?

I'm trying to parse the output of this Helm chart with Rust and the crate kube. This is needed for aixigo/PREvant#146 (code will be public in a few days). I came across dtolnay/serde-yaml#225 which showed Rust's serde library uses YAML 1.2 and thus my code failed because defaultMode was then a string and not a numeric value anymore.

However, I noticed that the chart also makes use of decimals (see TLS secrets) and thus I applied the same trick and this addresses following questions:

Could this cause some backwards incompatibility in some old (or current) versions of the k8s tooling? helm, kubectl... Would this change generate confudion for users as the official k8s API spec is documented using the old format?

If we apply this update, shouldn't we apply it globally to all the charts for homogeneity?

I was thinking about doing so but then I read in the contribution guide to only raise PRs for single charts. I'm up to do it for all charts. Just tell me what is your preferred approach.

With the YAML 1.2 spec octals must be prefixed with `0o` and not `0`.
Parsers implementing the latest spec run into issues. See discussion
here: dtolnay/serde-yaml#225

This commit makes the Zookeeper script mount compliant with YAML 1.2.

Signed-off-by: Marc Schreiber <info@schrieveslaach.de>
@schrieveslaach schrieveslaach force-pushed the zookeeper-default-mode branch 2 times, most recently from 5c83e16 to f0d4b4f Compare December 4, 2023 07:57
In order to be still YAML 1.1 compliant and to be YAML 1.2 compliant,
this commit changes the defaultMode to the decimal value 493. This seems
to be done in other places as well (see modes of TLS secrets).

Signed-off-by: Marc Schreiber <info@schrieveslaach.de>
@schrieveslaach
Copy link
Contributor Author

@andresbono, after fighting the CI a bit I got it working and CI is green. Do you mind to have another look?

@andresbono
Copy link
Contributor

However, I noticed that the chart also makes use of decimals (see TLS secrets) and thus I applied the same trick

That makes total sense 👍

If we apply this update, shouldn't we apply it globally to all the charts for homogeneity?

I was thinking about doing so but then I read in the contribution guide to only raise PRs for single charts. I'm up to do it for all charts. Just tell me what is your preferred approach.

Giving it a second thought, let's keep the rest of the charts as they are right now. We can reconsider moving to YAML 1.2 based on future user requests. But let's merge your changes so your use case is also covered.

Copy link
Contributor

@andresbono andresbono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andresbono andresbono merged commit c82d4ab into bitnami:main Dec 11, 2023
6 checks passed
@schrieveslaach
Copy link
Contributor Author

Thanks a lot.

@schrieveslaach
Copy link
Contributor Author

@andresbono, I did the same trick for Kafka (see #21086). Do you mind to check this out as well?

grouvie pushed a commit to grouvie/charts that referenced this pull request Jan 25, 2024
…tnami#21081)

* Make Zookeeper DefaultMode YAML 1.2 Compliant

With the YAML 1.2 spec octals must be prefixed with `0o` and not `0`.
Parsers implementing the latest spec run into issues. See discussion
here: dtolnay/serde-yaml#225

This commit makes the Zookeeper script mount compliant with YAML 1.2.

Signed-off-by: Marc Schreiber <info@schrieveslaach.de>

* Use Decimal Notation for defaultMode

In order to be still YAML 1.1 compliant and to be YAML 1.2 compliant,
this commit changes the defaultMode to the decimal value 493. This seems
to be done in other places as well (see modes of TLS secrets).

Signed-off-by: Marc Schreiber <info@schrieveslaach.de>

---------

Signed-off-by: Marc Schreiber <info@schrieveslaach.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved verify Execute verification workflow for these changes zookeeper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants