You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dennis-Mircea (via GitHub)" <gi...@apache.org> on 2026/07/09 08:24:37 UTC

[PR] [FLINK-40106] Move FlinkResourceValidator and FlinkResourceMutator to the api module [flink-kubernetes-operator]

Dennis-Mircea opened a new pull request, #1157:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1157

   ## What is the purpose of the change
   
   The operator exposes three pluggable resource extension points that third parties implement via the plugin mechanism: `FlinkResourceListener`, `FlinkResourceValidator`, and `FlinkResourceMutator`. `FlinkResourceListener` was moved into the `flink-kubernetes-operator-api` module under FLINK-29655 so that plugin authors only depend on the stable, lightweight api module. `FlinkResourceValidator` and `FlinkResourceMutator` were left in the `flink-kubernetes-operator` module, which is inconsistent and forces implementers of a custom validator or mutator to depend on the entire operator module.
   
   This change moves the two interfaces into the api module, mirroring the listener, so all three plugin SPIs live together and can be implemented against the api module alone.
   
   ## Brief change log
   
   - Move `FlinkResourceValidator` to `org.apache.flink.kubernetes.operator.api.validation` in the api module.
   - Move `FlinkResourceMutator` to `org.apache.flink.kubernetes.operator.api.mutator` in the api module.
   - The interfaces only reference `flink-core`'s `Plugin` and api custom resource types (`FlinkDeployment`, `FlinkSessionJob`, `FlinkStateSnapshot`, `AbstractFlinkResource`), so no new module dependencies or `pom.xml` changes are required (unlike the listener move, the api module already provides everything they need).
   - Keep the concrete implementations and wiring in the operator module: `DefaultValidator`, `DefaultFlinkMutator`, and the discovery utilities `ValidatorUtils` / `MutatorUtils` (which still `PluginManager.load(...)` the interfaces). Only their imports change.
   - Update imports in the operator module: `FlinkOperator`, `FlinkDeploymentController`, `FlinkSessionJobController`, `FlinkStateSnapshotController`, `ValidatorUtils`, `MutatorUtils`.
   - Update imports in the webhook module: `FlinkOperatorWebhook`, `FlinkValidator`, `FlinkMutator`, and the tests `FlinkValidatorTest`, `FlinkMutatorTest`.
   - Rename the four test `META-INF/services` registration files to the new fully qualified interface names (operator and webhook test resources for both validator and mutator). File contents are unchanged, since the test implementations stay in their current packages.
   - Update the plugin docs (`docs/content/docs/operations/plugins.md` and the `content.zh` copy) to reference the new packages in the validator and mutator sections.
   
   ## Verifying this change
   
   This is a pure move/refactor with no behavior change.
   
   - Covered by existing tests: the operator and webhook validator/mutator tests (`FlinkValidatorTest`, `FlinkMutatorTest`, and the reconciler/controller tests that run validation), plus plugin discovery via the renamed test `META-INF/services` files, which confirm `ValidatorUtils`/`MutatorUtils` still load implementations after the package change.
   - `mvn clean verify` builds both modules and runs the above.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changes to the `CustomResourceDescriptors`: no
     - Core observer or reconciler logic that is regularly executed: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   


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


Re: [PR] [FLINK-40106] Move FlinkResourceValidator and FlinkResourceMutator to the api module [flink-kubernetes-operator]

Posted by "gyfora (via GitHub)" <gi...@apache.org>.
gyfora merged PR #1157:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1157


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