Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-27613] Add label for the session job to help list the session … #265

Merged
merged 2 commits into from
Jun 14, 2022

Conversation

Aitozi
Copy link

@Aitozi Aitozi commented Jun 11, 2022

…jobs in the same session cluster

This PR is based on #215 but use the mutator webhook to do the same thing


private static final ObjectMapper mapper = new ObjectMapper();

public static <T> T convertToTargetType(HasMetadata resource, Class<T> targetType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don’t need this utility class, ObjectMapper already has a convertValue method that does exactly this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻, Fixed

return resource;
}

private void patchInternalLabel(FlinkSessionJob flinkSessionJob) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be clearer to call it simply setSessionTargetLabel

@@ -109,4 +109,36 @@ webhooks:
operator: In
values: [{{- range .Values.watchNamespaces }}{{ . | quote }},{{- end}}]
{{- end }}
{{- end }}
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have a separate config flag to enable this. We should handle the validating and mutating webhooks independently of each other as some envs might want one but not the other.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, will do it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@gyfora gyfora merged commit bf60428 into apache:main Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants