load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") load("//test/snapshot:snapshot.bzl", "generate_snapshots") go_library( name = "layout", srcs = ["layout.go"], importpath = "edge-infra.dev/pkg/f8n/warehouse/oci/layout", visibility = ["//visibility:public"], deps = [ "//pkg/f8n/warehouse", "//pkg/f8n/warehouse/oci", "//pkg/f8n/warehouse/oci/cmp", "//pkg/f8n/warehouse/oci/match", "//pkg/f8n/warehouse/oci/name", "@com_github_google_go_containerregistry//pkg/name", "@com_github_google_go_containerregistry//pkg/v1:pkg", "@com_github_google_go_containerregistry//pkg/v1/empty", "@com_github_google_go_containerregistry//pkg/v1/layout", "@com_github_opencontainers_image_spec//specs-go/v1:specs-go", ], ) go_test( name = "layout_test", srcs = ["layout_test.go"], data = glob(["testdata/**"]), embed = [":layout"], deps = [ "//pkg/f8n/warehouse/cluster", "//pkg/f8n/warehouse/lift", "//pkg/f8n/warehouse/oci", "//pkg/f8n/warehouse/oci/layer", "//pkg/f8n/warehouse/pallet", "//pkg/lib/build/bazel", "//pkg/lib/uuid", "//test/snapshot", "@com_github_google_go_containerregistry//pkg/name", "@com_github_stretchr_testify//assert", ], ) generate_snapshots( name = "layout_snapshots", testonly = True, srcs = glob(["testdata/**"]), snapshot_path = "pkg/f8n/warehouse/oci/layout/testdata/snapshots", snapshot_test = ":layout_test", ) write_source_files( name = "update_snapshots_layout", testonly = True, files = { "testdata/snapshots": ":layout_snapshots", }, )