Skip to content

Commit

Permalink
refactor: Service Type LoadBalancer is not a requirement for Ingress …
Browse files Browse the repository at this point in the history
…generation
  • Loading branch information
manusa committed Jan 27, 2021
1 parent efe3e90 commit 73c79d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,7 @@ static boolean shouldCreateExternalURLForService(ServiceBuilder service, KitLogg
List<ServicePort> ports = spec.getPorts();
log.debug("Service " + serviceName + " has ports: " + ports);
if (ports.size() == 1) {
String type = spec.getType();
if (Objects.equals(type, "LoadBalancer")) {
return true;
}
log.info("Not generating Ingress for service " + serviceName + " type is not LoadBalancer: " + type);
return true;
} else {
log.info("Not generating Ingress for service " + serviceName + " as only single port services are supported. Has ports: " + ports);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void testShouldCreateExternalURLForServiceWithClusterIP() {
assertThat(IngressEnricher.shouldCreateExternalURLForService(initTestService().editSpec()
.withType("ClusterIP")
.endSpec(), logger))
.isFalse();
.isTrue();
}

@Test
Expand Down

0 comments on commit 73c79d8

Please sign in to comment.