Closed justnoise closed 4 years ago
Does this only happen when you use curl, or in kip too? I think the default curl in alpine is just a busybox alias, you need to add curl explicitly via apk to get the "real" one.
I noticed this happening inside kip first. It would return emptystring for the zone which would mess up autodetecting its environment. I then investigated on alpine by apk adding curl and testing it out. (busybox doesn't come with its own curl but it does implement wget) The really strange thing is that the problem doesn't show up when you exec virtual-kubelet -- curl <metadata URL>
whithout the interactive shell...
Overall, I'm not sure what the heck is causing the problem but we can easily work around it.
For some reason, when you curl the gce metadata service for the zone, from alpine, an extra slash gets added to the response:
This does not happen in other distros (debian and ubuntu were tested)
The library we use assumes the response doesn't end with a slash and it'll break if it does end in a slash. This PR gets the zone from the metadata ourselves and handle both cases.