gyfora commented on code in PR #733:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/733#discussion_r1444204137


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/MutatorUtils.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.configuration.ConfigConstants;
+import org.apache.flink.core.plugin.PluginUtils;
+import org.apache.flink.kubernetes.operator.config.FlinkConfigManager;
+import org.apache.flink.kubernetes.operator.mutator.DefaultFlinkMutator;
+import org.apache.flink.kubernetes.operator.mutator.FlinkResourceMutator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/** Mutator utilities. */
+public final class MutatorUtils {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(MutatorUtils.class);
+
+    /**
+     * discovers mutators.
+     *
+     * @param configManager Flink Config manager
+     * @return Set of FlinkResourceMutator
+     */
+    public static Set<FlinkResourceMutator> 
discoverMutators(FlinkConfigManager configManager) {

Review Comment:
   We should have a test for this similar to the `ValidatorUtilsTest` 
alternatively it would be even better to refactor the code and eliminate the 
overlapping logic between discovering the validator and mutator and then we can 
have a single test



##########
flink-kubernetes-webhook/src/test/java/org/apache/flink/kubernetes/operator/admission/AdmissionHandlerTest.java:
##########
@@ -136,6 +140,10 @@ public void testHandleValidateRequestWithAdmissionReview() 
throws IOException {
     public void testMutateHandler() throws Exception {
         final EmbeddedChannel embeddedChannel = new 
EmbeddedChannel(admissionHandler);
         var sessionJob = new FlinkSessionJob();
+        ObjectMeta objectMeta = new ObjectMeta();

Review Comment:
   We should also add a test that has a custom mutator and make sure it is 
called.



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