-
Notifications
You must be signed in to change notification settings - Fork 84
OPRUN-4203: (fix): Scripts executed with make verify to run on mac os #1124
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,10 +27,65 @@ crddir="${chartdir}/crds" | |
| crdsrcdir="${tmpdir}/operators" | ||
|
|
||
| SED="sed" | ||
| if ! command -v ${SED} &> /dev/null; then | ||
| SED="sed" | ||
| if command -v gsed &> /dev/null; then | ||
| SED="gsed" | ||
| elif ! command -v "${SED}" &> /dev/null; then | ||
| echo "GNU sed is required for creating manifests, unable to proceed" | ||
| exit 1 | ||
| fi | ||
|
|
||
| relpath() { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The config either does not solve
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the instructions on https://operator-framework.github.io/operator-controller/contribute/developer/#special-setup-for-macos are followed, this error does not occur on macOS. |
||
| local base="$1" | ||
| local target="$2" | ||
| local base_abs target_abs | ||
| local rel="" | ||
|
|
||
| base_abs=$(cd "${base}" && pwd -P) | ||
| target_abs=$(cd "$(dirname "${target}")" && pwd -P)/$(basename "${target}") | ||
|
|
||
| IFS='/' read -r -a base_parts <<< "${base_abs}" | ||
| IFS='/' read -r -a target_parts <<< "${target_abs}" | ||
|
|
||
| local i=0 | ||
| local max_common=${#base_parts[@]} | ||
| if [ ${#target_parts[@]} -lt ${max_common} ]; then | ||
| max_common=${#target_parts[@]} | ||
| fi | ||
|
|
||
| while [ $i -lt ${max_common} ] && [ "${base_parts[$i]}" = "${target_parts[$i]}" ]; do | ||
| i=$((i + 1)) | ||
| done | ||
|
|
||
| local j=$i | ||
| while [ $j -lt ${#base_parts[@]} ]; do | ||
| if [ -n "${base_parts[$j]}" ]; then | ||
| if [ -z "${rel}" ]; then | ||
| rel=".." | ||
| else | ||
| rel="../${rel}" | ||
| fi | ||
| fi | ||
| j=$((j + 1)) | ||
| done | ||
|
|
||
| if [ -z "${rel}" ]; then | ||
| rel="." | ||
| fi | ||
|
|
||
| while [ $i -lt ${#target_parts[@]} ]; do | ||
| if [ -n "${target_parts[$i]}" ]; then | ||
| if [ "${rel}" = "." ]; then | ||
| rel="${target_parts[$i]}" | ||
| else | ||
| rel="${rel}/${target_parts[$i]}" | ||
| fi | ||
| fi | ||
| i=$((i + 1)) | ||
| done | ||
|
|
||
| printf '%s\n' "${rel}" | ||
| } | ||
|
|
||
| # OSX distrubtions do not include GNU sed by default, the test below | ||
| # exits if we detect that the the insert command is not supported by | ||
| # the sed exectuable. | ||
|
|
@@ -614,7 +669,7 @@ for file in ${microshift_manifests_files}; do | |
| continue 2 | ||
| fi | ||
| done | ||
| echo " - $(realpath --relative-to "${ROOT_DIR}/microshift-manifests" "${file}")" >> "${ROOT_DIR}/microshift-manifests/kustomization.yaml" | ||
| echo " - $(relpath "${ROOT_DIR}/microshift-manifests" "${file}")" >> "${ROOT_DIR}/microshift-manifests/kustomization.yaml" | ||
| done | ||
|
|
||
| # Now we need to get rid of these args from the olm-operator deployment: | ||
|
|
||
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.
@grokspawn
The config does not solve the fact that the script looks for sed.
On Mac we have gsed ( with the config : https://operator-framework.github.io/operator-controller/contribute/developer/#special-setup-for-macos )
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 have all setup already.
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.
If you follow the "Configure your Shell" portion of the doc, then sed is gsed:
$ which sed /opt/homebrew/opt/gsed/libexec/gnubin/sed $ which gsed /opt/homebrew/bin/gsed $ ll /opt/homebrew/opt/gsed/libexec/gnubin/sed lrwxr-xr-x 1 jordan 14 Nov 6 2022 /opt/homebrew/opt/gsed/libexec/gnubin/sed -> ../../bin/gsedThere 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.
You also need your path updated. Doing the
brew installis not enough.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.
OK. I mised that. Done and worked. Created the sislink
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.