From 0c2d7aa177929ff090d8ded3cf57600c946103de Mon Sep 17 00:00:00 2001 From: Suraj Deshmukh Date: Thu, 16 Aug 2018 18:59:32 +0530 Subject: [PATCH] pkg/generator: Add prune to Gopkg.toml template The code that gets vendored by dep by default is huge. We can leverage the functionality given by dep viz. prune. This will remove all the non-go code and unused packages. It makes an exception to the k8s.io/code-generator repository. Since we use the scripts from this repository to generate code. Ref: https://golang.github.io/dep/docs/Gopkg.toml.html#prune --- pkg/generator/templates.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/generator/templates.go b/pkg/generator/templates.go index 3b818c67421..5d5b7cd5c5c 100644 --- a/pkg/generator/templates.go +++ b/pkg/generator/templates.go @@ -281,6 +281,16 @@ required = [ name = "sigs.k8s.io/controller-runtime" revision = "60bb251ad86f9b313653618aad0c2c53f41a6625" +[prune] + go-tests = true + non-go = true + unused-packages = true + + [[prune.project]] + name = "k8s.io/code-generator" + non-go = false + unused-packages = false + [[constraint]] name = "github.com/operator-framework/operator-sdk" # The version rule is used for a specific release and the master branch for in between releases.