You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/09/23 06:40:30 UTC
[GitHub] [flink-kubernetes-operator] gyfora commented on a diff in pull request #377: [FLINK-28979] Add owner reference to flink deployment object
gyfora commented on code in PR #377:
URL: https://github.com/apache/flink-kubernetes-operator/pull/377#discussion_r978307344
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractFlinkResourceReconciler.java:
##########
@@ -426,4 +431,17 @@ protected boolean flinkVersionChanged(SPEC oldSpec, SPEC newSpec) {
}
return false;
}
+
+ private void setOwnerReference(CR owner, Configuration deployConfig) {
+ final Map<String, String> ownerReference =
+ Map.of(
+ "apiVersion", owner.getApiVersion(),
+ "kind", owner.getKind(),
+ "name", owner.getMetadata().getName(),
+ "uid", owner.getMetadata().getUid(),
+ "blockOwnerDeletion", "false",
+ "controller", "false");
+ deployConfig.set(
+ KubernetesConfigOptions.JOB_MANAGER_OWNER_REFERENCE, List.of(ownerReference));
+ }
Review Comment:
Feels like the `FlinkConfigBuilder` might be a better place for this, then we can be sure that it's universally set in a single place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org