diff options
author | Fabricio Voznika <fvoznika@google.com> | 2020-08-26 20:22:39 -0700 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-09 17:53:10 -0700 |
commit | 4705782bf39e7202a5fd66a966fac94baf36492b (patch) | |
tree | b6c6179d0e9a1633cb9e9aaf16d0d429e44e80f8 /runsc/config/BUILD | |
parent | dd8b3ffcb8eb7f7867dbea2c721f7fb7d0ec0342 (diff) |
Make flag propagation automatic
Use reflection and tags to provide automatic conversion from
Config to flags. This makes adding new flags less error-prone,
skips flags using default values (easier to read), and makes
tests correctly use default flag values for test Configs.
Updates #3494
PiperOrigin-RevId: 328662070
Diffstat (limited to 'runsc/config/BUILD')
-rw-r--r-- | runsc/config/BUILD | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/runsc/config/BUILD b/runsc/config/BUILD index 3c8713d53..b1672bb9d 100644 --- a/runsc/config/BUILD +++ b/runsc/config/BUILD @@ -1,4 +1,4 @@ -load("//tools:defs.bzl", "go_library") +load("//tools:defs.bzl", "go_library", "go_test") package(licenses = ["notice"]) @@ -6,10 +6,23 @@ go_library( name = "config", srcs = [ "config.go", + "flags.go", ], visibility = ["//:sandbox"], deps = [ "//pkg/refs", "//pkg/sentry/watchdog", + "//pkg/sync", + "//runsc/flag", ], ) + +go_test( + name = "config_test", + size = "small", + srcs = [ + "config_test.go", + ], + library = ":config", + deps = ["//runsc/flag"], +) |