Skip to content

Feat(spring): Adding FromConfigMap annotation that dynamically maps data config-map to map #1594

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

Merged

Conversation

yue9944882
Copy link
Member

example usage:

public class App {
   @FromConfigMap(namespace="default", name="my-config")
   private Map<String, String> myConfig;
}

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 13, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 13, 2021
@yue9944882 yue9944882 force-pushed the feat/spring-cfgmap-mapper branch from 00380ed to 36917b1 Compare March 13, 2021 12:13
@yue9944882 yue9944882 changed the title Feat(spring): Adding @FromConfigMap annotation that dynamically maps data config-map to map Feat(spring): Adding FromConfigMap annotation that dynamically maps data config-map to map Mar 13, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Mar 13, 2021
if (configMap == null || configMap.getData() == null) {
return;
}
configMap.getData().keySet().stream().forEach(key -> configMapDataCache.refresh(key));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want an update to be atomic? e.g. it is currently possible that a user could read half the values from ConfigMap v1 and half the values from ConfigMap v2.

This would probably be pretty unexpected from a programmers perspective.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added a todo comment on the line. am not sure if atomic cache entry update is supported in the cache library for now, we will need that otherwise it wont work

@yue9944882 yue9944882 force-pushed the feat/spring-cfgmap-mapper branch from 36917b1 to 330cf3b Compare March 15, 2021 05:58
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 15, 2021
@yue9944882 yue9944882 force-pushed the feat/spring-cfgmap-mapper branch from 4f23070 to f153a24 Compare March 15, 2021 08:10
@brendandburns
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 17, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, yue9944882

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [brendandburns,yue9944882]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 9b25290 into kubernetes-client:master Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants