treewide: switch to gomod and bump everything
This switches version resolution from fietsje to gomod and updates
all Go dependencies. It also bumps rules_go (required by gVisor) and
switches the Gazelle naming convention from go_default_xxx to the
standard Bazel convention of the default target having the package
name.
Since Kubernetes dropped upstream Bazel support and doesn't check in
all generated files I manually pregenerated the OpenAPI spec. This
should be fixed, but because of the already-huge scope of this CL
and the rebase complexity this is not in here.
Change-Id: Iec8ea613d06946882426c2f9fad5bda7e8aaf833
Reviewed-on: https://review.monogon.dev/c/monogon/+/639
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
Reviewed-by: Leopold Schabel <leo@nexantic.com>
diff --git a/metropolis/test/launch/BUILD.bazel b/metropolis/test/launch/BUILD.bazel
index 1cb6b24..4508dd5 100644
--- a/metropolis/test/launch/BUILD.bazel
+++ b/metropolis/test/launch/BUILD.bazel
@@ -1,14 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
- name = "go_default_library",
+ name = "launch",
srcs = ["launch.go"],
importpath = "source.monogon.dev/metropolis/test/launch",
visibility = ["//metropolis:__subpackages__"],
deps = [
- "//metropolis/node:go_default_library",
- "//metropolis/pkg/freeport:go_default_library",
+ "//metropolis/node",
+ "//metropolis/pkg/freeport",
"@org_golang_google_grpc//:go_default_library",
- "@org_golang_x_sys//unix:go_default_library",
+ "@org_golang_x_sys//unix",
],
)
diff --git a/metropolis/test/launch/cli/launch-multi2/BUILD.bazel b/metropolis/test/launch/cli/launch-multi2/BUILD.bazel
index 932b57b..c53b626 100644
--- a/metropolis/test/launch/cli/launch-multi2/BUILD.bazel
+++ b/metropolis/test/launch/cli/launch-multi2/BUILD.bazel
@@ -1,13 +1,13 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
- name = "go_default_library",
+ name = "launch-multi2_lib",
srcs = ["main.go"],
importpath = "source.monogon.dev/metropolis/test/launch/cli/launch-multi2",
visibility = ["//visibility:private"],
deps = [
- "//metropolis/cli/pkg/context:go_default_library",
- "//metropolis/test/launch/cluster:go_default_library",
+ "//metropolis/cli/pkg/context",
+ "//metropolis/test/launch/cluster",
],
)
@@ -21,6 +21,6 @@
"//third_party/edk2:firmware",
"@com_github_bonzini_qboot//:qboot-bin",
],
- embed = [":go_default_library"],
+ embed = [":launch-multi2_lib"],
visibility = ["//:__pkg__"],
)
diff --git a/metropolis/test/launch/cli/launch/BUILD.bazel b/metropolis/test/launch/cli/launch/BUILD.bazel
index cb2cbb5..31d491a 100644
--- a/metropolis/test/launch/cli/launch/BUILD.bazel
+++ b/metropolis/test/launch/cli/launch/BUILD.bazel
@@ -1,15 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
- name = "go_default_library",
+ name = "launch_lib",
srcs = ["main.go"],
importpath = "source.monogon.dev/metropolis/test/launch/cli/launch",
visibility = ["//visibility:private"],
deps = [
- "//metropolis/cli/pkg/context:go_default_library",
- "//metropolis/proto/api:go_default_library",
- "//metropolis/test/launch:go_default_library",
- "//metropolis/test/launch/cluster:go_default_library",
+ "//metropolis/cli/pkg/context",
+ "//metropolis/proto/api",
+ "//metropolis/test/launch",
+ "//metropolis/test/launch/cluster",
],
)
@@ -20,6 +20,6 @@
"//metropolis/node:swtpm_data",
"//third_party/edk2:firmware",
],
- embed = [":go_default_library"],
+ embed = [":launch_lib"],
visibility = ["//:__pkg__"],
)
diff --git a/metropolis/test/launch/cluster/BUILD.bazel b/metropolis/test/launch/cluster/BUILD.bazel
index 8e829df..2ca9816 100644
--- a/metropolis/test/launch/cluster/BUILD.bazel
+++ b/metropolis/test/launch/cluster/BUILD.bazel
@@ -1,7 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
- name = "go_default_library",
+ name = "cluster",
srcs = [
"cluster.go",
"insecure_key.go",
@@ -18,19 +18,19 @@
importpath = "source.monogon.dev/metropolis/test/launch/cluster",
visibility = ["//visibility:public"],
deps = [
- "//metropolis/node:go_default_library",
- "//metropolis/node/core/identity:go_default_library",
- "//metropolis/node/core/rpc:go_default_library",
- "//metropolis/pkg/logbuffer:go_default_library",
- "//metropolis/proto/api:go_default_library",
- "//metropolis/proto/common:go_default_library",
- "//metropolis/test/launch:go_default_library",
- "@com_github_cenkalti_backoff_v4//:go_default_library",
- "@com_github_grpc_ecosystem_go_grpc_middleware//retry:go_default_library",
+ "//metropolis/node",
+ "//metropolis/node/core/identity",
+ "//metropolis/node/core/rpc",
+ "//metropolis/pkg/logbuffer",
+ "//metropolis/proto/api",
+ "//metropolis/proto/common",
+ "//metropolis/test/launch",
+ "@com_github_cenkalti_backoff_v4//:backoff",
+ "@com_github_grpc_ecosystem_go_grpc_middleware//retry",
"@org_golang_google_grpc//:go_default_library",
- "@org_golang_google_grpc//codes:go_default_library",
- "@org_golang_google_grpc//status:go_default_library",
- "@org_golang_google_protobuf//proto:go_default_library",
- "@org_uber_go_multierr//:go_default_library",
+ "@org_golang_google_grpc//codes",
+ "@org_golang_google_grpc//status",
+ "@org_golang_google_protobuf//proto",
+ "@org_uber_go_multierr//:multierr",
],
)