bai sui created FLINK-34965:
-------------------------------

             Summary: optimize code of ServiceType
                 Key: FLINK-34965
                 URL: https://issues.apache.org/jira/browse/FLINK-34965
             Project: Flink
          Issue Type: Improvement
          Components: Deployment / Kubernetes
    Affects Versions: kubernetes
            Reporter: bai sui
             Fix For: 1.9.4


In the class of 
[ServiceType](https://github.com/apache/flink/blob/bf60c8813598d3119375cec057930240642699d4/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/services/ServiceType.java#L57)
now the code as below,in ServiceType.java
``` java
.endMetadata()
                .withNewSpec()
                .withType(
                        kubernetesJobManagerParameters
                                .getRestServiceExposedType()
                                .serviceType()
                                .getType())
                .withSelector(kubernetesJobManagerParameters.getSelectors())
                .addNewPort()
                .withName(Constants.REST_PORT_NAME)
```
since the process context is in class ServiceType,then the type of service type 
should get from the self class,Instead of from `kubernetesJobManagerParameters`

``` java
.endMetadata()
                .withNewSpec()
                .withType(
                              // modify to
                               this .getType())
                .withSelector(kubernetesJobManagerParameters.getSelectors())
                .addNewPort()
                .withName(Constants.REST_PORT_NAME)
```
i think that would be better



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to