spuru9 commented on code in PR #1112:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/1112#discussion_r3255340496


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/ValidatorUtils.java:
##########
@@ -36,13 +37,22 @@ public final class ValidatorUtils {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(FlinkUtils.class);
 
+    @VisibleForTesting
     public static Set<FlinkResourceValidator> 
discoverValidators(FlinkConfigManager configManager) {

Review Comment:
   This overload isn't called from any non-test code now. `@VisibleForTesting` 
keeps internal callers honest, but for anyone downstream (forks, vendored 
builds) the method is still public API on a published utility — 
`@Deprecated(forRemoval = false)` with a Javadoc pointer to the 2-arg version 
would actually signal intent to them. The three test sites 
(FlinkStateSnapshotControllerTest, Testing*Controller) could then migrate to 
the 2-arg form over time. WDYT?



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/OperatorPluginUtils.java:
##########
@@ -0,0 +1,67 @@
+/*
+ * 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.Configuration;
+import org.apache.flink.configuration.CoreOptions;
+import org.apache.flink.core.plugin.PluginManager;
+import org.apache.flink.core.plugin.PluginUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Builds the single, process-wide {@link PluginManager} used by the operator 
and webhook for plugin
+ * discovery (metric reporters, file systems, validators, mutators, listeners).
+ *
+ * <p>Plugin classloaders delegate {@code io.fabric8} and {@code 
com.fasterxml} to the parent so all
+ * plugins share the operator's fabric8 client and Jackson, avoiding duplicate 
informers and version
+ * skew.
+ */
+public final class OperatorPluginUtils {
+
+    private static final List<String> EXTRA_PARENT_FIRST_PATTERNS =
+            List.of("io.fabric8", "com.fasterxml");
+
+    private OperatorPluginUtils() {}
+
+    /** Returns a copy of {@code baseConf} with the operator's parent-first 
patterns merged in. */
+    public static Configuration 
enrichWithPluginParentFirstPatterns(Configuration baseConf) {

Review Comment:
   ```suggestion
       private static Configuration 
enrichWithPluginParentFirstPatterns(Configuration baseConf) {
   ```
   Dont need it to be public as createPluginManager is the only caller.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to