-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix scripts to run in mac os x and or linux #2260
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 scripts to run in mac os x and or linux #2260
Conversation
hack/tests/e2e-ansible-molecule.sh
Outdated
sed -i " " 's|\(FROM quay.io/operator-framework/ansible-operator\)\(:.*\)\?|\1:dev|g' build/Dockerfile | ||
else | ||
sed -i 's|\(FROM quay.io/operator-framework/ansible-operator\)\(:.*\)\?|\1:dev|g' build/Dockerfile | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be combined into one command, similar to the others?
hack/tests/e2e-ansible.sh
Outdated
sed -i "s|{{ REPLACE_IMAGE }}|$DEST_IMAGE|g" deploy/operator.yaml | ||
sed -i 's|{{ pull_policy.default..Always.. }}|Never|g' deploy/operator.yaml | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
sed -i " " "s|{{ REPLACE_IMAGE }}|$DEST_IMAGE|g" deploy/operator.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joelanford just here that I could not find a solution because of "{{".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT:
sed -i".bak" -E -e "s|\{\{ REPLACE_IMAGE \}\}|$DEST_IMAGE|g" deploy/operator.yaml; rm -f deploy/operator.yaml.bak
sed -i".bak" -E -e 's|\{\{ pull_policy.default..Always.. \}\}|Never|g' deploy/operator.yaml; rm -f deploy/operator.yaml.bak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was wrong originally when I said that |
characters don't work with BSD sed. It seems that they do, in fact, work with both GNU sed and BSD sed. So I think we should use |
everywhere we were using it before so that we don't have to escape the forward slashes in the regex patterns and replacements.
ci/tests/e2e-ansible.sh
Outdated
sed -i 's|{{ pull_policy.default..Always.. }}|Always|g' deploy/operator.yaml | ||
sed -i".bak" -e 's/{{ pull_policy.default..Always.. }}/Always/g' deploy/operator.yaml; rm -f deploy/operator.yaml.bak | ||
cp deploy/operator.yaml deploy/operator-copy.yaml | ||
sed -i "s|{{ REPLACE_IMAGE }}|$IMAGE|g" deploy/operator.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files in the ci
directory do not need to be changed since:
- They are currently unused in this repo
- They will soon be transitioned into the
openshift/ocp-release-operator-sdk
repo - When used with OpenShift CI, they do not need to support mac's sed command syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Description of the change:
fix scripts to run in mac os x and/or Linux
Motivation for the change:
Closes #2257