NIFI-15243 Improve KubernetesConfigMapStateProvider
Summary
Improves the KubernetesConfigMapStateProvider....
-
In
setStatethe original code was callingupdatewith a resource that had noresourceVersionspecified and under the covers the k8s client will perform agetin this case to obtain the most recent version before performing the update. Given that, we can callgetourselves every time and simplify the logic to know whether to callcreateorupdate, plus simplify the conflict handling logic since we can re-callgeton each retry. -
In
replacewe had no way to preserve any changes made to metadata fields, sogetStatewas updated to return theObjectMetadatafrom theConfigMapinsideStandardStateMap, then duringreplaceit can use this metadata when constructing the resource to preserve any values.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
- [X] Apache NiFi Jira issue created
Pull Request Tracking
- [X] Pull Request title starts with Apache NiFi Jira issue number, such as
NIFI-00000 - [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such
NIFI-00000
Pull Request Formatting
- [X] Pull Request based on current revision of the
mainbranch - [X] Pull Request refers to a feature branch with one commit containing changes
Verification
Please indicate the verification steps performed prior to pull request creation.
Build
- [X] Build completed using
./mvnw clean install -P contrib-check- [X] JDK 21
- [ ] JDK 25
Licensing
- [ ] New dependencies are compatible with the Apache License 2.0 according to the License Policy
- [ ] New dependencies are documented in applicable
LICENSEandNOTICEfiles
Documentation
- [ ] Documentation formatting appears as expected in rendered files