Skip to content

Commit 4d5b2c9

Browse files
authored
[FLINK-36264] Fix can not setup other values for parameter rest-service.exposed.type
1 parent ee02482 commit 4d5b2c9

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilder.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,6 @@ protected FlinkConfigBuilder applyPodTemplate() throws IOException {
249249
return this;
250250
}
251251

252-
protected FlinkConfigBuilder applyIngressDomain() {
253-
// Web UI
254-
if (spec.getIngress() != null) {
255-
effectiveConfig.set(
256-
REST_SERVICE_EXPOSED_TYPE,
257-
KubernetesConfigOptions.ServiceExposedType.ClusterIP);
258-
}
259-
return this;
260-
}
261-
262252
protected FlinkConfigBuilder applyServiceAccount() {
263253
if (spec.getServiceAccount() != null) {
264254
effectiveConfig.set(
@@ -412,7 +402,6 @@ public static Configuration buildFrom(
412402
.applyImagePullPolicy()
413403
.applyServiceAccount()
414404
.applyPodTemplate()
415-
.applyIngressDomain()
416405
.applyJobManagerSpec()
417406
.applyTaskManagerSpec()
418407
.applyJobOrSessionSpec()

flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilderTest.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import java.util.Collections;
6464
import java.util.List;
6565
import java.util.Map;
66+
import java.util.stream.Stream;
6667

6768
import static org.apache.flink.configuration.DeploymentOptions.SHUTDOWN_ON_APPLICATION_FINISH;
6869
import static org.apache.flink.kubernetes.operator.api.utils.BaseTestUtils.IMAGE;
@@ -348,17 +349,6 @@ private PodTemplateSpec getTmPod(Configuration configuration) throws IOException
348349
PodTemplateSpec.class);
349350
}
350351

351-
@Test
352-
public void testApplyIngressDomain() {
353-
final Configuration configuration =
354-
new FlinkConfigBuilder(flinkDeployment, new Configuration())
355-
.applyIngressDomain()
356-
.build();
357-
assertEquals(
358-
KubernetesConfigOptions.ServiceExposedType.ClusterIP,
359-
configuration.get(KubernetesConfigOptions.REST_SERVICE_EXPOSED_TYPE));
360-
}
361-
362352
@Test
363353
public void testApplyServiceAccount() {
364354
final Configuration configuration =
@@ -944,4 +934,13 @@ private PodTemplateSpec createTestPodWithContainers() {
944934
TestUtils.getTestPodTemplate("hostname", List.of(mainContainer, sideCarContainer));
945935
return pod;
946936
}
937+
938+
private static Stream<KubernetesConfigOptions.ServiceExposedType> serviceExposedTypes() {
939+
return Stream.of(
940+
null,
941+
KubernetesConfigOptions.ServiceExposedType.ClusterIP,
942+
KubernetesConfigOptions.ServiceExposedType.LoadBalancer,
943+
KubernetesConfigOptions.ServiceExposedType.Headless_ClusterIP,
944+
KubernetesConfigOptions.ServiceExposedType.NodePort);
945+
}
947946
}

0 commit comments

Comments
 (0)