blob: cf0917eec147b0d7df4b51d95116224ce412293e [file] [log] [blame]
Jan Schär652c2ad2024-11-19 17:40:50 +01001load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
Tim Windelschmidt681d5152025-01-08 00:19:33 +01002load("@rules_oci//oci:defs.bzl", "oci_image")
3load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
Jan Schär652c2ad2024-11-19 17:40:50 +01004
5go_library(
6 name = "persistentvolume_lib",
7 srcs = ["main.go"],
8 importpath = "source.monogon.dev/metropolis/test/e2e/persistentvolume",
9 visibility = ["//visibility:private"],
Jan Schärbe70c922024-11-21 11:16:03 +010010 deps = [
11 "//osbase/blockdev",
12 "@org_golang_x_sys//unix",
13 ],
Jan Schär652c2ad2024-11-19 17:40:50 +010014)
15
16go_binary(
17 name = "persistentvolume",
18 embed = [":persistentvolume_lib"],
19 pure = "on",
20 visibility = ["//visibility:private"],
21)
22
Tim Windelschmidt681d5152025-01-08 00:19:33 +010023static_binary_tarball(
Jan Schär652c2ad2024-11-19 17:40:50 +010024 name = "persistentvolume_layer",
Tim Windelschmidt681d5152025-01-08 00:19:33 +010025 executable = ":persistentvolume",
Jan Schär652c2ad2024-11-19 17:40:50 +010026 visibility = ["//visibility:private"],
27)
28
Jan Schär652c2ad2024-11-19 17:40:50 +010029oci_image(
30 name = "persistentvolume_image",
31 base = "@distroless_base",
Tim Windelschmidt681d5152025-01-08 00:19:33 +010032 entrypoint = ["/app/metropolis/test/e2e/persistentvolume/persistentvolume_/persistentvolume"],
Jan Schär652c2ad2024-11-19 17:40:50 +010033 tars = [":persistentvolume_layer"],
34 visibility = ["//metropolis/test/e2e:__pkg__"],
35 workdir = "/app",
36)