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

cluster_wide_install_opr.sh on MacOS is broken #1081

Open
toniharju opened this issue Jan 21, 2025 · 3 comments
Open

cluster_wide_install_opr.sh on MacOS is broken #1081

toniharju opened this issue Jan 21, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@toniharju
Copy link

Describe the bug
The cluster_wide_install_opr.sh script gives the following error on MacOS:

sed: 2: "/WATCH_NAMESPACE/,/- na ...": unexpected EOF (pending }'s)

Apparently the problem is that MacOS has BSD sed by default which doesn't allow the semi-colons to be used in the way they are used.

I managed to fix it by changing the sed to the following POSIX standard way of doing it:

  sed -e "/WATCH_NAMESPACE/,/- name/ { 
    /WATCH_NAMESPACE/b
    /valueFrom:/bx
    /- name/b
    d
    :x
    s/valueFrom:/value: '${WATCH_NAMESPACE}'/
  }" $DEPLOY_PATH/operator.yaml | $KUBE_CLI apply -f -

I haven't tested this with GNU sed to see if it works with that.

Tip

Vote this issue reacting with 👍 or 👎

@toniharju toniharju added the bug Something isn't working label Jan 21, 2025
@brusdev
Copy link
Contributor

brusdev commented Jan 22, 2025

@toniharju could you try if replacing that line with the following line fixes the error?

sed -z "s/WATCH_NAMESPACE.*metadata.namespace/WATCH_NAMESPACE\n          value: ''/" deploy/operator.yaml > o.yaml 

@toniharju
Copy link
Author

toniharju commented Jan 25, 2025

@toniharju could you try if replacing that line with the following line fixes the error?

sed -z "s/WATCH_NAMESPACE.*metadata.namespace/WATCH_NAMESPACE\n          value: ''/" deploy/operator.yaml > o.yaml 

Sorry it took this long to get back to this.

Unfortunately BSD sed, or at least the version that comes pre-installed on MacOS does not support the -z flag:

sed: illegal option -- z

brusdev added a commit to brusdev/activemq-artemis-operator that referenced this issue Feb 19, 2025
@brusdev
Copy link
Contributor

brusdev commented Feb 19, 2025

@toniharju I created the PR #1095 to fix this issue, could you review it?

brusdev added a commit to brusdev/activemq-artemis-operator that referenced this issue Mar 4, 2025
brusdev added a commit to brusdev/activemq-artemis-operator that referenced this issue Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants