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

Pod annotations cannot contain duplicate keys when combining pod templates #220

Merged
merged 2 commits into from
Sep 11, 2017

Conversation

bajacondor
Copy link
Contributor

Added equals and hashCode overrides to podAnnotations so that combining doesn't allow duplicate keys Also, changed precedence so that the template will override the parent in inheritance.

Copy link
Contributor

@marvinthepa marvinthepa left a comment

Choose a reason for hiding this comment

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

Please clarify the template inheritance precedence - ideally add a test to prove it.

podAnnotations.addAll(template.getAnnotations());

podAnnotations.addAll(parent.getAnnotations());
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I am wrong, but this looks like the precedence favors parent, not as you write, template:

changed precedence so that the template will override the parent in inheritance.

Why do you want to change the precedence in the first place? Reading the documentation, I would expect the template to have precedence.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought the same but actually he is right

https://docs.oracle.com/javase/7/docs/api/java/util/HashSet.html#add(E)

Adds the specified element to this set if it is not already present.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right, makes sense when you think about it.

podAnnotations.addAll(template.getAnnotations());

podAnnotations.addAll(parent.getAnnotations());
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought the same but actually he is right

https://docs.oracle.com/javase/7/docs/api/java/util/HashSet.html#add(E)

Adds the specified element to this set if it is not already present.

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.

3 participants