Handling of common cluster config #311
Closed
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Description
This PR is a spike to look into how we can push common behavior into the framework. This is not intended for merging as is, just as basis for further discussions.
This branch depends on a branch of the operator framework.
Specifically in this PR I implemented the following functionality:
I have also introduced a struct that can be shared across all operators from the framework: https://github.com/stackabletech/operator-rs/blob/feat/pause-reconciliation/src/config/common_config.rs#L11
In the operators this can then be flattened into the CRD: https://github.com/stackabletech/hdfs-operator/blob/feat/pause-stop/rust/crd/src/lib.rs#L68
This should be backwards compatible with the existing
stoppedandserviceTypeflags in a few of our operators, as the resulting schema looks the same, but will be deserialized to the shared struct (full disclosure: untested as of yet).I have implemented two possible ways of calling the functionlity from the operator, one with a proc macro and one with regular fn's. The fn way is commented out at the moment, but you can test this very simply by removing the macro call and uncommenting the block below it in hdfs-controller.rs
The branch also contains changes to use Tilt and crate2nix, you can ignore these when looking at the code changes themselves, those were just convenience functions for development.
Review Checklist
Once the review is done, comment
bors r+(orbors merge) to merge. Further information