Hi Folks, I am trying a CustomFlinkMutator by impl...
# troubleshooting
s
Hi Folks, I am trying a CustomFlinkMutator by implementing FlinkResourceMutator. I have created a separate project and added operator dependency there:
Copy code
dependency
    groupIdorg.apache.flink/groupId
    artifactIdflink-kubernetes-operator/artifactId
    version1.7-SNAPSHOT/version
/dependency
I have followed rest of the steps for adding jar path in FLINK_PLUGINS_DIR The mutateDeployment method starts as:
Copy code
LOG.info("Entered Mutate Method");
String namespace = deployment.getMetadata().getNamespace();
LOG.info("Metadata namespace: {}", namespace);
But this is failing at deployment.getMetadata() at runtime with the below error:
Copy code
java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.flink.kubernetes.operator.api.FlinkDeployment.getMetadata()Lio/fabric8/kubernetes/api/model/ObjectMeta;" the class loader org.apache.flink.core.plugin.PluginLoader$PluginClassLoader @1f11f64e (instance of org.apache.flink.core.plugin.PluginLoader$PluginClassLoader, child of 'platform' jdk.internal.loader.ClassLoaders$PlatformClassLoader) of the current class, org/apache/flink/mutator/CustomFlinkMutator, and the class loader 'app' (instance of jdk.internal.loader.ClassLoaders$AppClassLoader) for the method's defining class, io/fabric8/kubernetes/client/CustomResource, have different Class objects for the type io/fabric8/kubernetes/api/model/ObjectMeta used in the signature
From this I was able to understand that, the CustomFlinkMutator class is loaded by the PluginClassLoader, while the class io.fabric8.kubernetes.api.model.ObjectMeta is loaded by the application class loader (AppClassLoader). The ObjectMeta is present in CustomResource. I have tried multiple things like shading the io.fabric8.kubernetes.client and importing that in plugin project. But nothing is working. Note: This is from a unreleased version.
d
What JDK version, exact versions of jars and version of flink please