-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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 libvirt-coreos cluster #11379
Fix libvirt-coreos cluster #11379
Conversation
KUBERNETES=libvirt-coreos cluster/kube-up.sh produced the following error: cluster/../cluster/libvirt-coreos/../../cluster/common.sh: line 83: user_args[@]: unbound variable This was coming from the fact that, as a libvirt-coreos cluster runs locally on local VMs, there is no authentication mechanism. This led to have user_args of common.sh unset. In the case of libvirt-coreos, it is in fact expected to have no authentication token.
Hi @sdminonne , |
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
@lhuard1A sure. Let you know ASAP. |
Works here. Thanks! |
@@ -80,7 +80,9 @@ function create-kubeconfig() { | |||
fi | |||
|
|||
"${kubectl}" config set-cluster "${CONTEXT}" "${cluster_args[@]}" | |||
"${kubectl}" config set-credentials "${CONTEXT}" "${user_args[@]}" | |||
if [ -n "${user_args[@]:-}" ]; then |
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.
Nit: per our chosen bash style guide [[ is prefered over [
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/devel/coding-conventions.md
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.
The rest of the file does 2 space indentation as well.
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.
in my limited testing, I think using [
instead of [[
is what broke this for GCE, though I can't entirely explain why.
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.
These actually evaluate differently. The [[ -n
does the right thing with array expansion, whereas [
seems to, well, deal poorly. I love bash:
zml@zml:~$ args=("--foo" "--bar" "--blatz")
zml@zml:~$ if [[ -n "${args[@]:-}" ]]; then echo "WUMPUS"; fi
WUMPUS
zml@zml:~$ if [ -n "${args[@]:-}" ]; then echo "WUMPUS"; fi
-bash: [: too many arguments
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.
that's what I discovered in my testing, too, but I didn't see that error in the build log on Jenkins, so I was/am confused.
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.
wait no, I'm just bad at searching the log:
/jenkins-master-data/jobs/kubernetes-e2e-gce-parallel/workspace/kubernetes/hack/e2e-internal/../../cluster/../cluster/gce/../../cluster/common.sh: line 83: [: too many arguments
LGTM |
All green, and isolated change |
Pretty sure this change broke Jenkins for GCE:
This change also didn't run through the per-PR Jenkins before being merged, making it even more suspect. |
Oh man, I missed that. I apologize. Shame on me. |
KUBERNETES=libvirt-coreos cluster/kube-up.sh
produced the following error:This was coming from the fact that, as a
libvirt-coreos
cluster runs locally on local VMs,there is no authentication mechanism. This led to have
user_args
ofcommon.sh
unset.In the case of libvirt-coreos, it is in fact expected to have no authentication token.