m/{cli,test/launch}: integrate launch/cluster with metroctl
This makes test-launch2 (and possibly later any other code that uses the
launch/cluster library) tell the user that they can connect to the newly
launched cluster using metroctl, either by using specific flags, or
using a wrapper script, or using kubectl.
Change-Id: I54035ee02f3cbab3d17f46b1f1685b91aab275a9
Reviewed-on: https://review.monogon.dev/c/monogon/+/1373
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/metropolis/cli/metroctl/main.go b/metropolis/cli/metroctl/main.go
index 8714332..19b378d 100644
--- a/metropolis/cli/metroctl/main.go
+++ b/metropolis/cli/metroctl/main.go
@@ -6,6 +6,8 @@
"github.com/adrg/xdg"
"github.com/spf13/cobra"
+
+ "source.monogon.dev/metropolis/cli/metroctl/core"
)
// rootCmd represents the base command when called without any subcommands
@@ -58,3 +60,13 @@
func main() {
cobra.CheckErr(rootCmd.Execute())
}
+
+// connectOptions returns core.ConnectOptions as defined by the metroctl flags
+// currently set.
+func connectOptions() *core.ConnectOptions {
+ return &core.ConnectOptions{
+ ProxyServer: flags.proxyAddr,
+ Endpoints: flags.clusterEndpoints,
+ ConfigPath: flags.configPath,
+ }
+}