From 83b46148eeced5920dae48768b962f84ffcbc7b5 Mon Sep 17 00:00:00 2001 From: Craig Furman Date: Mon, 11 Feb 2019 17:59:02 +0000 Subject: [PATCH] Integration test servers listen on localhost And no other addresses. This avoids firewall nagging on macOS. We were already configuring the webhook server to listen on the loopback interface only, but this isn't working due to a bug in controller-runtime. Fixed by https://github.com/kubernetes-sigs/controller-runtime/pull/322. --- pkg/integration/integration.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/integration/integration.go b/pkg/integration/integration.go index ca90c4db..bb9ef552 100644 --- a/pkg/integration/integration.go +++ b/pkg/integration/integration.go @@ -44,7 +44,7 @@ func StartAPIServer(crdDirectoryPath string) (*rest.Config, *envtest.Environment env := &envtest.Environment{ CRDDirectoryPaths: []string{crdDirectoryPath}, - KubeAPIServerFlags: kubeAPIServerFlags(), + KubeAPIServerFlags: append([]string{"--bind-address", "127.0.0.1"}, kubeAPIServerFlags()...), } cfg, err := env.Start() @@ -112,7 +112,7 @@ func CreateNamespace(clientset *kubernetes.Clientset) (string, func()) { // StartTestManager generates a new Manager connected to the given cluster configuration. func StartTestManager(ctx context.Context, cfg *rest.Config) manager.Manager { - mgr, err := manager.New(cfg, manager.Options{}) + mgr, err := manager.New(cfg, manager.Options{MetricsBindAddress: "127.0.0.1:0"}) Expect(err).NotTo(HaveOccurred(), "failed to create test manager") go func() {