[ 
https://issues.apache.org/jira/browse/FLINK-34965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

bai sui updated FLINK-34965:
----------------------------
    Description: 
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
{code:java}
.endMetadata()
.withNewSpec()
.withType(
kubernetesJobManagerParameters
.getRestServiceExposedType()
.serviceType()
.getType())
.withSelector(kubernetesJobManagerParameters.getSelectors())
.addNewPort()
.withName(Constants.REST_PORT_NAME) {code}

since the process context is in class ServiceType,then the type of service type 
should get from the self class,Instead of from `kubernetesJobManagerParameters`
{code:java}
.endMetadata()
.withNewSpec()
.withType(
// modify to
this .getType())
.withSelector(kubernetesJobManagerParameters.getSelectors())
.addNewPort()
.withName(Constants.REST_PORT_NAME) {code}

i think that would be better

  was:
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


> 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
>            Priority: Minor
>             Fix For: 1.9.4
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> 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
> {code:java}
> .endMetadata()
> .withNewSpec()
> .withType(
> kubernetesJobManagerParameters
> .getRestServiceExposedType()
> .serviceType()
> .getType())
> .withSelector(kubernetesJobManagerParameters.getSelectors())
> .addNewPort()
> .withName(Constants.REST_PORT_NAME) {code}
> since the process context is in class ServiceType,then the type of service 
> type should get from the self class,Instead of from 
> `kubernetesJobManagerParameters`
> {code:java}
> .endMetadata()
> .withNewSpec()
> .withType(
> // modify to
> this .getType())
> .withSelector(kubernetesJobManagerParameters.getSelectors())
> .addNewPort()
> .withName(Constants.REST_PORT_NAME) {code}
> i think that would be better



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

Reply via email to