mateczagany commented on code in PR #821:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/821#discussion_r1666908525


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/crd/CustomResourceDefinitionWatcherImpl.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.crd;
+
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import io.fabric8.kubernetes.client.KubernetesClient;
+import lombok.RequiredArgsConstructor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/** Default implementation for CustomResourceDefinitionWatcher. */
+@RequiredArgsConstructor
+public class CustomResourceDefinitionWatcherImpl implements 
CustomResourceDefinitionWatcher {

Review Comment:
   I have pushed a commit for this, please take a look at it, I am personally 
not 100% satisfied with either solution. The new solution is a lot more simple, 
but I had to hardcode the check to `FlinkConfigManager`, and play with the 
constructors in a way such that the tests won't try to detect if the 
`FlinkStateSnapshot` CR is installed. 
   
   I also kept `FlinkStateSnapshotUtils.shouldCreateSnapshotResource()` that 
checks both the operator config and Flink resource config to make it easy to 
opt-out on a per-job basis. This also helped me with the current tests being 
able to decide which snapshot method to use.



-- 
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-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to