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

Fix template metadata is not generated in Deployment resources #1166

Closed
wants to merge 1 commit into from

Conversation

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.

Please do not revert this change.
We cannot assume that the template is going to be there, since we allow users to bring their own resources. What we need to do, is to ensure that the required decorators are applied.

@@ -39,9 +40,10 @@ public HasMetadata create(AbstractKubernetesManifestGenerator<?> generator, Base
.endMetadata()
.withNewSpec()
.withReplicas(1)
.withNewTemplate()
Copy link
Member

Choose a reason for hiding this comment

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

I disagree with this change.

Our decorators should work regardless of the structure of the initial resource (users are allowed to bring their own resource and can't possibly know the decorate internals).

When we have a decorator that requires the exististence of some objects, we should then ensure that these objects exists (usually by also adding the decorators that create them).

So, instead of creating the template and metadata here, we should be using the decorators that do so.

@Sgitario
Copy link
Collaborator Author

Please do not revert this change. We cannot assume that the template is going to be there, since we allow users to bring their own resources. What we need to do, is to ensure that the required decorators are applied.

Ok, I'm closing this pull request. Please, provide a fix, the problematic decorator is AddAnnotationDecorator which is not working because there is no ObjectMeta generated. Unless we change the definition of AddAnnotationDecorator (the inheritance), I'm not sure how to address it.

@Sgitario Sgitario closed this Mar 21, 2023
@Sgitario Sgitario reopened this Mar 21, 2023
@sonarqubecloud
Copy link

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

@Sgitario
Copy link
Collaborator Author

Superseded by #1167

@Sgitario Sgitario closed this Mar 21, 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.

2 participants