From 01f78d92b7428a925631529d68f368753fcc5624 Mon Sep 17 00:00:00 2001 From: ichekrygin Date: Mon, 31 Dec 2018 17:25:44 -0800 Subject: [PATCH] Fix `nil` error when using `BootstrapOptions.Host` Signed-off-by: ichekrygin --- pkg/webhook/bootstrap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/webhook/bootstrap.go b/pkg/webhook/bootstrap.go index b789c05315..c14f8dafff 100644 --- a/pkg/webhook/bootstrap.go +++ b/pkg/webhook/bootstrap.go @@ -297,7 +297,7 @@ func (s *Server) validatingWHConfigs() (runtime.Object, error) { } func (s *Server) admissionWebhook(path string, wh *admission.Webhook) (*admissionregistration.Webhook, error) { - if wh.NamespaceSelector == nil && len(s.Service.Namespace) > 0 { + if wh.NamespaceSelector == nil && s.Service != nil && len(s.Service.Namespace) > 0 { wh.NamespaceSelector = &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ {