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

Fix validate-cluster.sh to work on Mac. #7147

Merged
merged 1 commit into from
Apr 22, 2015

Conversation

fabioy
Copy link
Contributor

@fabioy fabioy commented Apr 21, 2015

This should enable it to work on OS X Mavericks and Yosemite.

@fabioy
Copy link
Contributor Author

fabioy commented Apr 21, 2015

This should fix issue #7139.

@roberthbailey
Copy link
Contributor

LGTM. Thanks for the quick fix!

SED=gsed
fi
if ! ("$SED" --version 2>&1 | grep -q GNU); then
echo "!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'."
Copy link
Member

Choose a reason for hiding this comment

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

This really can't operate with BSD sed?

Copy link
Member

Choose a reason for hiding this comment

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

(I'm asking because the user is deep into cluster creation at this point, and you just bombed out.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason, it works with the BSD sed in Yosemite. But seems to fail on Maverick (OS X 10.9). Rather than keep fighting it, this works for all... :)

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hum, that is a better idea, though not sure if I want to do this check for everyone... Bombing out at the end also sounds bad.

Copy link
Member

Choose a reason for hiding this comment

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

FWIW, --posix on Linux agrees with Mavericks:

$ cluster/kubectl.sh get cs | sed --posix -n 's/^\([[:alnum:][:punct:]]\+\)\s\+\([[:alnum:][:punct:]]\+\)\s\+.*/\2/p'
current-context: "artful-fortress-786_e2e-test-zml"
Running: cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
$

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got an alternative regex here: https://github.com/fabioy/kubernetes/blob/validate.fix.2/cluster/validate-cluster.sh

Just need confirmation it works on the various platforms.

@fabioy
Copy link
Contributor Author

fabioy commented Apr 22, 2015

Updated this with the final, non-GNU checking, simple regex version. Could you do one final verify on your Mac and then merge if it works? Thank you.

@roberthbailey
Copy link
Contributor

Validate output:
NAME                 STATUS    MESSAGE   ERROR
controller-manager   Healthy   ok        nil
scheduler            Healthy   ok        nil
etcd-0               Healthy   {"action":"get","node":{"dir":true,"nodes":[{"key":"/registry","dir":true,"modifiedIndex":3,"createdIndex":3}]}}
                     nil
node-0               Healthy   ok        nil
node-1               Healthy   ok        nil
Cluster validation succeeded

roberthbailey added a commit that referenced this pull request Apr 22, 2015
Fix validate-cluster.sh to work on Mac.
@roberthbailey roberthbailey merged commit 4ca8fbb into kubernetes:master Apr 22, 2015
@fabioy fabioy deleted the validate.fix branch April 24, 2015 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants