Skip to content

Commit 6cb24d8

Browse files
committed
Fix nil error when using BootstrapOptions.Host
Signed-off-by: ichekrygin <[email protected]>
1 parent 4c0ea9d commit 6cb24d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/webhook/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func (s *Server) validatingWHConfigs() (runtime.Object, error) {
297297
}
298298

299299
func (s *Server) admissionWebhook(path string, wh *admission.Webhook) (*admissionregistration.Webhook, error) {
300-
if wh.NamespaceSelector == nil && len(s.Service.Namespace) > 0 {
300+
if wh.NamespaceSelector == nil && (s.Service == nil || s.Service.Namespace == "") {
301301
wh.NamespaceSelector = &metav1.LabelSelector{
302302
MatchExpressions: []metav1.LabelSelectorRequirement{
303303
{

0 commit comments

Comments
 (0)