-
Notifications
You must be signed in to change notification settings - Fork 2.9k
NIFI-15243 Improve KubernetesConfigMapStateProvider #10619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on these improvements @bbende. The general approach reworking update process for ConfigMaps looks good. I noted a few minor recommendations.
...rc/main/java/org/apache/nifi/kubernetes/state/provider/KubernetesConfigMapStateProvider.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/nifi/kubernetes/state/provider/KubernetesConfigMapStateProvider.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/nifi/kubernetes/state/provider/KubernetesConfigMapStateProvider.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/nifi/kubernetes/state/provider/KubernetesConfigMapStateProvider.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/nifi/kubernetes/state/provider/KubernetesConfigMapStateProvider.java
Outdated
Show resolved
Hide resolved
|
@exceptionfactory thanks for the review, pushed an update to address the comments |
# Conflicts: # nifi-framework-bundle/nifi-framework-extensions/nifi-framework-kubernetes-bundle/nifi-framework-kubernetes-state-provider/src/main/java/org/apache/nifi/kubernetes/state/provider/StandardStateMap.java
exceptionfactory
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the adjustments @bbende, understanding that the current update() call was already making a GET request, changing the approach to make it explicit, with the accompanying improvements, looks good! +1 merging
Summary
NIFI-15243
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
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation