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

sed usage appears to be non-portable #58

Open
devth opened this issue Oct 14, 2020 · 1 comment
Open

sed usage appears to be non-portable #58

devth opened this issue Oct 14, 2020 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@devth
Copy link
Contributor

devth commented Oct 14, 2020

Describe the bug:

This StackOverflow answer explains differences between GNU and BSD/macOS sed. The current Makefile uses sed in a way that causes an error with BSD/macOS sed:

± make crds-to-chart
cp deploy/crds/*.yaml deploy/charts/secret-manager/templates/crds/; \
	for i in deploy/charts/secret-manager/templates/crds/*.yaml; do \
		sed -i '1s/.*/{{- if .Values.installCRDs }}/;$a{{- end }}' $i; \
	done
sed: 1: "deploy/charts/secret-ma ...": extra characters at the end of d command
sed: 1: "deploy/charts/secret-ma ...": extra characters at the end of d command
sed: 1: "deploy/charts/secret-ma ...": extra characters at the end of d command
make: *** [crds-to-chart] Error 1

Expected behavior

Expect make targets to work across OSes.

Steps to reproduce the bug:

Run make crds-to-chart on macOS.

Workaround

macOS users can install GNU sed using brew install sed then following the instructions to setup $PATH to prefer GNU sed over macOS sed.

/kind bug

@mcavoyk mcavoyk added the kind/bug Categorizes issue or PR as related to a bug. label Oct 14, 2020
@mcavoyk
Copy link
Collaborator

mcavoyk commented Oct 14, 2020

I'm not sure there is a portable alternative for some sed commands. If this instance has an alternative which is portable then it could be updated. I would recommend macOS users switch to GNU sed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants