root: move metropolis-specific tools to metropolis/, rename launch-multi2 to launch-cluster
Since we now have more than one top-level project it makes sense to not
have metropolis aliases in the root.
We also drive-by rename launch-multi2 to launch-cluster and bump it up
to three nodes.
Change-Id: Ic99065465006e0dace05bcc1f2a702d430014b84
Reviewed-on: https://review.monogon.dev/c/monogon/+/2764
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/metropolis/BUILD.bazel b/metropolis/BUILD.bazel
new file mode 100644
index 0000000..5c2816a
--- /dev/null
+++ b/metropolis/BUILD.bazel
@@ -0,0 +1,20 @@
+test_suite(
+ name = "launch",
+ tags = ["manual"],
+ tests = [
+ "//metropolis/test/launch/cli/launch",
+ ],
+)
+
+test_suite(
+ name = "launch-cluster",
+ tags = ["manual"],
+ tests = [
+ "//metropolis/test/launch/cli/launch-cluster",
+ ],
+)
+
+alias(
+ name = "metroctl",
+ actual = "//metropolis/cli/metroctl:metroctl",
+)
diff --git a/metropolis/test/launch/cli/launch-multi2/BUILD.bazel b/metropolis/test/launch/cli/launch-cluster/BUILD.bazel
similarity index 66%
rename from metropolis/test/launch/cli/launch-multi2/BUILD.bazel
rename to metropolis/test/launch/cli/launch-cluster/BUILD.bazel
index 90440eb..974258a 100644
--- a/metropolis/test/launch/cli/launch-multi2/BUILD.bazel
+++ b/metropolis/test/launch/cli/launch-cluster/BUILD.bazel
@@ -2,9 +2,9 @@
load("@bazel_skylib//rules:native_binary.bzl", "native_test")
go_library(
- name = "launch-multi2_lib",
+ name = "launch-cluster_lib",
srcs = ["main.go"],
- importpath = "source.monogon.dev/metropolis/test/launch/cli/launch-multi2",
+ importpath = "source.monogon.dev/metropolis/test/launch/cli/launch-cluster",
visibility = ["//visibility:private"],
deps = [
"//metropolis/cli/metroctl/core",
@@ -14,18 +14,20 @@
)
go_binary(
- name = "launch-multi2_bin",
+ name = "launch-cluster_bin",
data = [
"//metropolis/cli/metroctl",
],
- embed = [":launch-multi2_lib"],
+ embed = [":launch-cluster_lib"],
visibility = ["//:__pkg__"],
)
+# Wrap the binary in a native_test so that we can run it with the
+# `bazel test` command inside the sandbox.
native_test(
- name = "launch-multi2",
- src = ":launch-multi2_bin",
- out = "launch-multi2",
+ name = "launch-cluster",
+ src = ":launch-cluster_bin",
+ out = "launch",
tags = ["manual"],
visibility = ["//visibility:public"],
)
diff --git a/metropolis/test/launch/cli/launch-multi2/main.go b/metropolis/test/launch/cli/launch-cluster/main.go
similarity index 97%
rename from metropolis/test/launch/cli/launch-multi2/main.go
rename to metropolis/test/launch/cli/launch-cluster/main.go
index f174c98..e5959f3 100644
--- a/metropolis/test/launch/cli/launch-multi2/main.go
+++ b/metropolis/test/launch/cli/launch-cluster/main.go
@@ -28,7 +28,7 @@
func main() {
ctx := clicontext.WithInterrupt(context.Background())
cl, err := cluster.LaunchCluster(ctx, cluster.ClusterOptions{
- NumNodes: 2,
+ NumNodes: 3,
NodeLogsToFiles: true,
})
if err != nil {
@@ -52,7 +52,7 @@
log.Fatalf("Cluster has no Kubernetes controller nodes")
}
- configName := "launch-multi2"
+ configName := "launch-cluster"
if err := metroctl.InstallKubeletConfig(ctx, mpath, cl.ConnectOptions(), configName, apiservers[0]); err != nil {
log.Fatalf("InstallKubeletConfig: %v", err)
}