You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #17942 from wtrocki/oc-up-socat-warning
Automatic merge from submit-queue (batch tested with PRs 17942, 18370).
Display warning when socat cmd is missing
## Motivation
I have been troubleshooting couple openshift installations done using `oc cluster up` recently and found one common pattern. MacOS users who used `oc cluster up` for the first time almost always experienced problems with reaching running cluster. Example:
```
curl 127.0.0.1:8443
curl: (7) Failed connect to 127.0.0.1:8442; Connection refused
```
Problem related with missing or improperly installed `socat` command.
Following [documentation](https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md#macos-with-docker-for-mac) is often not enough. Users who install this command using brew may miss some additional libraries and this is really hard to debug and track cause of the issue when looking into logs. Example output:
```
> socat
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/socat
Reason: image not found
[1] 13015 abort socat
```
Problem is not easy to investigate as currently installer provides no useful message back to the user.
Example issue that was caused by problem
#17931
## Proposed solution
Validate if socat is available when executing `oc cluster up` to inform users about possible problems that may occur. Validation will happen only when `PortForwarding` option will be used.
Implementation using non disruptive aproach - server will still start without `socat` and only warning will be displayed.
## Dev notes
Changes will be squashed after review.
To properly unit test changes I will need to create fake structure for `localcmd` package in order to mock execution of the command. Something like [wrappers for os/exec](https://github.com/kubernetes/contrib/tree/master/exec-healthz/vendor/k8s.io/kubernetes/pkg/util/exec) in kubernetes dependencies.
I wasn't sure if this is worth doing for such small change.
## Verification
```
brew uninstall socat
oc cluster up | grep "Port forwarding requires socat"
```
0 commit comments