From 07bb6fd6910db3c34c28a368677d17dd7422db2c Mon Sep 17 00:00:00 2001 From: Sunil Arora Date: Thu, 14 Mar 2019 13:21:26 -0700 Subject: [PATCH] :bug: skip generating webhooks when no markers defined Fixes https://github.com/kubernetes-sigs/controller-tools/issues/154 --- pkg/webhook/manifests.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/webhook/manifests.go b/pkg/webhook/manifests.go index 9f202f8fb..3bea5853e 100644 --- a/pkg/webhook/manifests.go +++ b/pkg/webhook/manifests.go @@ -49,6 +49,10 @@ func Generate(o *Options) error { return fmt.Errorf("failed to parse the input dir: %v", err) } + if len(o.webhooks) == 0 { + return nil + } + objs, err := o.Generate() if err != nil { return err