-
Notifications
You must be signed in to change notification settings - Fork 105
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
Conversation
There was a problem hiding this 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() |
There was a problem hiding this comment.
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.
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. |
Kudos, SonarCloud Quality Gate passed! |
Superseded by #1167 |
Relates to CI failures: https://github.com/quarkusio/quarkus/runs/12159739217#user-content-test-failure-io.quarkus.it.kubernetes.kuberneteswithmetricscustomabsolutetest-1