From fcaeebaa187d2b8d8efdfae813d277ee90f662fc Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Fri, 11 Sep 2020 14:51:45 -0700 Subject: [PATCH] Add support for disabling all staged content This reduces the binary footprint for downstream users that won't use these files anyway. Signed-off-by: Brad Davidson --- pkg/codegen/main.go | 2 ++ pkg/deploy/nostage.go | 7 +++++++ pkg/deploy/stage.go | 2 ++ pkg/deploy/zz_generated_bindata.go | 2 ++ pkg/static/nostage.go | 7 +++++++ pkg/static/stage.go | 2 ++ pkg/static/zz_generated_bindata.go | 2 ++ 7 files changed, 24 insertions(+) create mode 100644 pkg/deploy/nostage.go create mode 100644 pkg/static/nostage.go diff --git a/pkg/codegen/main.go b/pkg/codegen/main.go index e98c5c5609..66af50f908 100644 --- a/pkg/codegen/main.go +++ b/pkg/codegen/main.go @@ -44,6 +44,7 @@ func main() { NoMetadata: true, Prefix: "manifests/", Output: "pkg/deploy/zz_generated_bindata.go", + Tags: "!no_stage", } if err := bindata.Translate(bc); err != nil { logrus.Fatal(err) @@ -60,6 +61,7 @@ func main() { NoMetadata: true, Prefix: "build/static/", Output: "pkg/static/zz_generated_bindata.go", + Tags: "!no_stage", } if err := bindata.Translate(bc); err != nil { logrus.Fatal(err) diff --git a/pkg/deploy/nostage.go b/pkg/deploy/nostage.go new file mode 100644 index 0000000000..40e84e7015 --- /dev/null +++ b/pkg/deploy/nostage.go @@ -0,0 +1,7 @@ +// +build no_stage + +package deploy + +func Stage(dataDir string, templateVars map[string]string, skips map[string]bool) error { + return nil +} diff --git a/pkg/deploy/stage.go b/pkg/deploy/stage.go index 1e8d109cf9..57339d3a98 100644 --- a/pkg/deploy/stage.go +++ b/pkg/deploy/stage.go @@ -1,3 +1,5 @@ +// +build !no_stage + package deploy import ( diff --git a/pkg/deploy/zz_generated_bindata.go b/pkg/deploy/zz_generated_bindata.go index 9b798373f7..3c18898572 100644 --- a/pkg/deploy/zz_generated_bindata.go +++ b/pkg/deploy/zz_generated_bindata.go @@ -12,6 +12,8 @@ // manifests/metrics-server/resource-reader.yaml // manifests/rolebindings.yaml // manifests/traefik.yaml +// +build !no_stage + package deploy import ( diff --git a/pkg/static/nostage.go b/pkg/static/nostage.go new file mode 100644 index 0000000000..aec21f08e8 --- /dev/null +++ b/pkg/static/nostage.go @@ -0,0 +1,7 @@ +// +build no_stage + +package static + +func Stage(dataDir string) error { + return nil +} diff --git a/pkg/static/stage.go b/pkg/static/stage.go index 8bd177afd4..6e28aec39d 100644 --- a/pkg/static/stage.go +++ b/pkg/static/stage.go @@ -1,3 +1,5 @@ +// +build !no_stage + package static import ( diff --git a/pkg/static/zz_generated_bindata.go b/pkg/static/zz_generated_bindata.go index 561bd700cd..c981878be0 100644 --- a/pkg/static/zz_generated_bindata.go +++ b/pkg/static/zz_generated_bindata.go @@ -1,6 +1,8 @@ // Code generated for package static by go-bindata DO NOT EDIT. (@generated) // sources: // build/static/charts/traefik-1.81.0.tgz +// +build !no_stage + package static import (