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

Remove extra space that breaks kubectl YAML block formatting #528

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

philippebi
Copy link
Contributor

With the current ConfigMap template version, the data block format rendered by kubectl is broken after an RKE2 deployment:

> kubectl get cm rke2-coredns-rke2-coredns -n kube-system -o yaml
apiVersion: v1
data:
  Corefile: ".:53 {\n    errors \n    health  {\n        lameduck 5s\n    }\n    ready
    \n    kubernetes   cluster.local  cluster.local in-addr.arpa ip6.arpa {\n        pods
    insecure\n        fallthrough in-addr.arpa ip6.arpa\n        ttl 30\n    }\n    prometheus
    \  0.0.0.0:9153\n    forward   . /etc/resolv.conf\n    cache   30\n    loop \n
    \   reload \n    loadbalance \n}"
kind: ConfigMap
...

It seems that an extra space added during the last commit breaks the rendering.
Removing this extra space restores the correct block format.

> kubectl get cm rke2-coredns-rke2-coredns -n kube-system -o yaml
apiVersion: v1
data:
  Corefile: |-
    .:53 {
        errors
        health {
            lameduck 5s
        }
        ready
        kubernetes  cluster.local cluster.local in-addr.arpa ip6.arpa {
            pods insecure
            fallthrough in-addr.arpa ip6.arpa
            ttl 30
        }
        prometheus 0.0.0.0:9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
...

@philippebi philippebi requested a review from a team as a code owner September 25, 2024 15:49
@brandond
Copy link
Member

brandond commented Sep 25, 2024

I'm confused why you want to make a change to this to allow people to edit it more easily. If this is generated by a Helm chart you SHOULD NOT be editing it directly, as the changes will be lost next time the chart is updated. Don't edit things managed by Helm.

As discussed on Slack this only affects how the configmap string value is displayed in kubectl, the actual contents of the corefile are fine.

Copy link
Member

@brandond brandond left a comment

Choose a reason for hiding this comment

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

Please bump the package version when changing the generated changes without bumping the chart version.
https://github.com/rancher/rke2-charts/blob/main-source/packages/rke2-coredns/package.yaml#L2

@brandond brandond merged commit af7c7c9 into rancher:main-source Sep 25, 2024
1 check passed
github-actions bot pushed a commit that referenced this pull request Sep 25, 2024
* Remove extra space that breaks kubectl YAML block formatting
* Bump package version
github-actions bot pushed a commit to manuelbuil/rke2-charts that referenced this pull request Sep 26, 2024
…#528)

* Remove extra space that breaks kubectl YAML block formatting
* Bump package version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants