Commit d6dcbfd7 authored by Committed by Miciah Dashiel Butler MastersBrowse files
desiredNodePortService: Add port 1936
When creating the NodePort-type service for an ingresscontroller that specifies the "NodePortService" endpoint publishing strategy type, include a "metrics" port with port 1936 so that external load balancers can use the /healthz/ready endpoint. This commit fixes bug 1881210. https://bugzilla.redhat.com/show_bug.cgi?id=1881210 * pkg/operator/controller/ingress/nodeport_service.go (ensureNodePortService): Pass an argument to desiredNodePortService to tell it not to add a "metrics" port if the service already exists and omits the port. (desiredNodePortService): Add a "wantMetricsPort" parameter. Add port 1936 to the service's ports spec if wantMetricsPort is true. * pkg/operator/controller/ingress/nodeport_service_test.go (TestDesiredNodePortService): Add a test case where wantMetricsPort is true. Verify that desiredNodePortService returns the expected service. (TestNodePortServiceChanged): Update the service used for tests to be consistent with what desiredNodePortService returns. * test/e2e/operator_test.go (TestNodePortServiceEndpointPublishingStrategy): Verify that the operator creates the NodePort-type service with the expected ports. Verify that the operator does not add the "metrics" port if it is is removed from the service.