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

Support overwrite values from existing init-containers #1196

Merged
merged 1 commit into from May 24, 2023

Conversation

Sgitario
Copy link
Collaborator

@Sgitario Sgitario requested a review from iocanel May 17, 2023 05:37
@Sgitario Sgitario force-pushed the add_update_init_containers branch from e3282c4 to f9f8b41 Compare May 17, 2023 05:41
@Sgitario Sgitario force-pushed the add_update_init_containers branch from f9f8b41 to 1793a72 Compare May 17, 2023 06:39
@sonarcloud
Copy link

sonarcloud bot commented May 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

It's clearly an improvement over what we have.
I'd like the following:

  • apply the same principal for sidecars too.
  • change to a more real world example in the integration test.

}

if (resource.getWorkingDir() != null) {
matching.withWorkingDir(resource.getWorkingDir());
Copy link
Member

Choose a reason for hiding this comment

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

Most String values in the annotation default to empty String. I don't recall by heart how empty Strings translate in the generated Pojos. This highlights an issue:

  • The correctness of the this code depends on what sundrio does for generating Pojos.

Looking deeper I think that the correctness also depends on:

  • Kubernetes model default values.
  • ContainerAdapter logic.

This is why I am always a little bit sceptic when it comes to decorators that have such a large surface area.

Given, that this is clearly an improvement over what we have and lacking a better proposal I'll let it pass, but we need to be aware of the dangers in case it backfires.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I see your point and I agree with you about how dangerous/wrong this code could be. The root cause is that annotations default strings to empty and the properties default to null :/

@Sgitario
Copy link
Collaborator Author

  • apply the same principal for sidecars too.

I will do this in a separate pull request after this one is merged if you don't mind.

@iocanel iocanel self-requested a review May 24, 2023 07:03
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

@Sgitario Sgitario merged commit 0d5da08 into dekorateio:main May 24, 2023
7 checks passed
@Sgitario Sgitario deleted the add_update_init_containers branch May 24, 2023 07:31
Sgitario added a commit to Sgitario/dekorate that referenced this pull request May 24, 2023
Sgitario added a commit to Sgitario/dekorate that referenced this pull request May 24, 2023
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.

None yet

2 participants