Skip to content
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

Ensure that the name property of @ComponentApplication is applied #281

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

geoand
Copy link
Collaborator

@geoand geoand commented Jul 18, 2019

Fixes: #276

@geoand geoand requested review from iocanel and aureamunoz July 18, 2019 08:38
@geoand geoand changed the title fix: Ensure that the name property of @ComponentApplication is applied Ensure that the name property of @ComponentApplication is applied Jul 18, 2019
Copy link
Member

@iocanel iocanel left a comment

Choose a reason for hiding this comment

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

LGTM

@geoand
Copy link
Collaborator Author

geoand commented Jul 18, 2019

On hold for the time being

@geoand geoand changed the title Ensure that the name property of @ComponentApplication is applied WIP: Ensure that the name property of @ComponentApplication is applied Jul 18, 2019
@geoand
Copy link
Collaborator Author

geoand commented Jul 18, 2019

Ready for new review

@geoand geoand changed the title WIP: Ensure that the name property of @ComponentApplication is applied Ensure that the name property of @ComponentApplication is applied Jul 18, 2019
@@ -150,10 +152,12 @@ private BaseConfig getKubernetesConfig() {
* @return The component.
*/
private Component createComponent(ComponentConfig config) {
return new ComponentBuilder()
Map<String, String> labels = resources.getLabels();
labels.put(Labels.APP, config.getName());
Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM but I'm just wondering if it should be done in a decorator? @iocanel

Copy link
Member

Choose a reason for hiding this comment

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

I prefer to have as many things as possibly set via decorator, but it's not a blocker for me.

The benefit of using a decoratror is that you don't have to keep track of the origin.

Was the resource created using fallback config? It works.
Was the resource created externally? it works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense. Does it apply to this case though?

Copy link
Member

Choose a reason for hiding this comment

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

For the name and labels not, as we don't do that in the rest of the modules.

Copy link
Collaborator

Choose a reason for hiding this comment

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

:-) ok. I agree.

@iocanel
Copy link
Member

iocanel commented Jul 18, 2019

Overall, this seems to me like another side-effect of having the ComponentHandler to run without KuberenetesConfig, which leads to no-one setting the application info.

I am wondering if we could just resolve that using the handler @geoand created. and just do a setApplicationInfo() inside handle like the KubernetesHanlder does.

@geoand
Copy link
Collaborator Author

geoand commented Jul 18, 2019

@iocanel I don't think that is the case. I think here the case is that for @ComponentApplica(name="....") name must take precedence over anything else.
At least that is how I understand it

@iocanel
Copy link
Member

iocanel commented Jul 18, 2019

@geoand ok lets not hold the PR more, just make all constatnts in Labels public to keep the symetry and lets merge.

@geoand
Copy link
Collaborator Author

geoand commented Jul 18, 2019

@iocanel done, thanks

@geoand geoand merged commit c196c8b into master Jul 18, 2019
@geoand geoand deleted the #276 branch July 18, 2019 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

component name is not overrided by conf
3 participants