Skip to content

Remove shell specification in Makefile for Ansible and Helm#4489

Merged
varshaprasad96 merged 1 commit intooperator-framework:masterfrom
varshaprasad96:fix/makefile
Feb 17, 2021
Merged

Remove shell specification in Makefile for Ansible and Helm#4489
varshaprasad96 merged 1 commit intooperator-framework:masterfrom
varshaprasad96:fix/makefile

Conversation

@varshaprasad96
Copy link
Copy Markdown
Member

@varshaprasad96 varshaprasad96 commented Feb 5, 2021

Remove the shell specification in ansible
and helm makefiles.

Description of the change:
Currently, we are hardcoding SHELL to point to /bin/sh. Its not necessary that /bin/sh invokes sh or points to bash, it can be a symbolic link invoking any other shell which may give errors. Instead, if required we could add a documentation similar to as we have for Golang operators, suggesting to use bash.

Motivation for the change:
Closes: #4403

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@varshaprasad96 varshaprasad96 force-pushed the fix/makefile branch 2 times, most recently from d14de91 to 7d7e455 Compare February 5, 2021 00:24
@jmrodri
Copy link
Copy Markdown
Member

jmrodri commented Feb 5, 2021

I thought we put these in for a reason but I can't find why. We have it set to bash in the main Makefile.

@jmrodri
Copy link
Copy Markdown
Member

jmrodri commented Feb 5, 2021

Does this need a changelog? It will affect the generated Makefile right?

Copy link
Copy Markdown
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2021
@joelanford
Copy link
Copy Markdown
Member

/hold

These may be necessary due to the PATH setup that includes the project-local bin directory.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2021
@joelanford
Copy link
Copy Markdown
Member

If there's an alternate way of ensuring executables from $(pwd)/bin are preferred over others in $PATH when invoking them, that would probably be fine as well.

However I'm a bit confused. Based on the documentation here, it seems like we're basically just running make's default shell with a modified $PATH.

@varshaprasad96
Copy link
Copy Markdown
Member Author

Ah, yes. Right now, the problem is that /bin/sh can have symbolic link to other shells and not necessary bash. And we setting it explicitly assuming it to be bash is causing errors. Can we instead just point to to bash directly, and document it ?

@joelanford
Copy link
Copy Markdown
Member

@varshaprasad96 I'm wondering if the original issue reported is more of an edge case than a normal case. See https://stackoverflow.com/questions/4814006/can-i-assume-bash-is-installed

It seems like it's safer to assume /bin/sh than /bin/bash.

I'm not personally super opposed to switching to /bin/bash, but that has a chance of breaking someone else who has /bin/sh but not /bin/bash.

@joelanford
Copy link
Copy Markdown
Member

Looking at this a bit closer and testing this PR out, I think this is actually a safe change. The changes @estroz made in #4407 make the SHELL setup redundant.

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 16, 2021
@varshaprasad96
Copy link
Copy Markdown
Member Author

/retest

@joelanford
Copy link
Copy Markdown
Member

Is the PATH assignment on the line above this now obsolete as well?

@varshaprasad96
Copy link
Copy Markdown
Member Author

varshaprasad96 commented Feb 16, 2021

yeah, given that we are specifically checking for binaries in $(pwd)/bin/ (like here for kustomize) and downloading if necessary at the right place in $pwd/bin.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 16, 2021
Remove the shell specification in ansible
and helm makefiles.

Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
@jmrodri
Copy link
Copy Markdown
Member

jmrodri commented Feb 17, 2021

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2021
Copy link
Copy Markdown
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@varshaprasad96 varshaprasad96 merged commit 549f745 into operator-framework:master Feb 17, 2021
reinvantveer pushed a commit to reinvantveer/operator-sdk that referenced this pull request Feb 20, 2021
Remove the shell specification in ansible
and helm makefiles.

Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
reinvantveer pushed a commit to reinvantveer/operator-sdk that referenced this pull request Feb 28, 2021
Remove the shell specification in ansible
and helm makefiles.

Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
Signed-off-by: reinvantveer <reinvantveer@gmail.com>
reinvantveer pushed a commit to reinvantveer/operator-sdk that referenced this pull request Feb 28, 2021
Remove the shell specification in ansible
and helm makefiles.

Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ansible Operator defaults on macOS result in 'No such file or directory' when running docker make targets

5 participants