Map<String, String> matchLabels = selector.getMatchLabels(); if (matchLabels != null && !matchLabels.isEmpty()) { specBuilder.withSelector(matchLabels);
.withNewSpec() .withReplicas(replicas) .withSelector(getSelectorLabels()) .withNewTemplate() .withNewMetadata()