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

fix generate-yaml by escaping newlines #404

Merged
merged 1 commit into from
Jul 21, 2019

Conversation

sbueringer
Copy link
Member

We had a problem with generate-yaml.sh because yq rejected the invalid YAML.
To work around this we have to make sure the master.yaml is also a valid YAML.
So functions like Indent are no option. One option to solve this would have been
base64Encode, but the problem is that Ignition has no property to specify that the
inline content is base64 encoded. The only would have been inline: !! binary |, but
then yq complains that {{ .CaCert | Base64Encode }} is not correctly encoded.

So the solution was to just replace the new lines with \n

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #402

We had a problem with generate-yaml.sh because yq rejected the invalid YAML.
To work around this we have to make sure the master.yaml is also a valid YAML.
So functions like Indent are no option. One option to solve this would have been
base64Encode, but the problem is that Ignition has no property to specify that the
inline content is base64 encoded. The only would have been `inline: !! binary |`, but
then yq complains that {{ .CaCert | Base64Encode }} is not correctly encoded.

So the solution was to just replace the new lines with \n
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 18, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 18, 2019
@jichenjc
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jichenjc, sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2019
@k8s-ci-robot
Copy link
Contributor

@sbueringer: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jichenjc
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 21, 2019
@k8s-ci-robot k8s-ci-robot merged commit 25ed7a4 into kubernetes-sigs:master Jul 21, 2019
@sbueringer sbueringer deleted the pr-fix-402 branch July 21, 2019 11:35
pierreprinetti pushed a commit to shiftstack/cluster-api-provider-openstack that referenced this pull request Apr 22, 2024
We had a problem with generate-yaml.sh because yq rejected the invalid YAML.
To work around this we have to make sure the master.yaml is also a valid YAML.
So functions like Indent are no option. One option to solve this would have been
base64Encode, but the problem is that Ignition has no property to specify that the
inline content is base64 encoded. The only would have been `inline: !! binary |`, but
then yq complains that {{ .CaCert | Base64Encode }} is not correctly encoded.

So the solution was to just replace the new lines with \n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example of generate-yaml.sh doesn't work for Container Linux any more
3 participants