Skip to content

Commit

Permalink
Integration test servers listen on localhost
Browse files Browse the repository at this point in the history
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
kubernetes-sigs/controller-runtime#322.
  • Loading branch information
craigfurman committed Feb 11, 2019
1 parent 29d7be8 commit 83b4614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 83b4614

Please sign in to comment.