Skip to content

when running prepare_helm_release.sh for generating token in kubernetes, a extra \r is introduced into the tokens #660

@soyji

Description

@soyji

Describe the bug
While deploying the helm chart in kubernetes, in the preparation it guides you to run
./scripts/pulsar/prepare_helm_release.sh -n <k8s-namespace> -k <helm-release-name>

However, after running it. If you do kubectl get secret -n pulsar pulsar-token-admin -o yaml and try to decode the base64, the secret will appear trimmed. This is because a \r has been introduced.

To Reproduce
Run as the docs states:

git clone https://github.com/apache/pulsar-helm-chart
cd pulsar-helm-chart
./scripts/pulsar/prepare_helm_release.sh -n <k8s-namespace> -k <helm-release-name>

# Then do the following
kubectl get secret -n pulsar pulsar-token-admin -o yaml

# Copy paste the TOKEN: value. Then decode it, it will appear trimmed
echo "(TOKEN value)" | base64 -d

# For extra verification you can check also the octal values, you will see the \r
kubectl get secret pulsar-token-admin -n pulsar -o jsonpath='{.data.TOKEN}' | base64 -d | od -c | tail -3

The impact of this is that when mounting it into Dekaf or trying to mount it into a service for a kubernetes communication, the authentication will fail

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions