Metal support is basically a stub, but should be sufficient as we are
now only using the cloud provider in gossip mode (and metal does not
use gossip).
Though we likely want to stop using this code altogether, it is still
used on GCE (for now). dns-controller will "gossip" AAAA records, and
they are valid (and work) in /etc/hosts.
Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
We discover the kops-controller in gossip mode using seeding code that
calls into the GCE API, just like gossip itself does.
We refactor the gossip code into a shared gcediscovery library with
minimal dependencies.
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
In some scenarios (e.g. cilium), we rely on the internal DNS name
being available, but this isn't the case with gossip clusters.
nodeup can seed /etc/hosts for the control-plane nodes, breaking the
deadlock.
We run protokube on the nodes in gossip mode; however protokube tries
to connect to the apiserver on localhost, and that simply won't work
if running on a node.
This doesn't cause any actual problems beyond logspam, but it's an
easy fix.
The go command now understands //go:build lines and prefers them over // +build lines. The new syntax uses boolean expressions, just like Go, and should be less error-prone. As of this release, the new syntax is fully supported, and all Go files should be updated to have both forms with the same meaning. To aid in migration, gofmt now automatically synchronizes the two forms. For more details on the syntax and migration plan, see https://golang.org/design/draft-gobuild.