-
Notifications
You must be signed in to change notification settings - Fork 106
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 decorator cycle issue with Cert-Manager and OpenShift #1189
Fix decorator cycle issue with Cert-Manager and OpenShift #1189
Conversation
f6a2401
to
cc78d42
Compare
Kudos, SonarCloud Quality Gate passed! |
CertificateBuilder builder = new CertificateBuilder(); | ||
|
||
// metadata | ||
builder.withNewMetadata() | ||
.withName(getName(meta)) | ||
.withNamespace(meta.getMetadata().getNamespace()) |
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.
Updating the namespace was not necessary as there is a decorator that populates all the resources with the correct namespace.
@@ -56,27 +58,31 @@ public void generate(CertificateConfig config) { | |||
LOGGER.info("Processing certificate config."); | |||
validate(config); | |||
|
|||
String defaultName = configurationRegistry.get(BaseConfig.class).map(BaseConfig::getName) | |||
.orElse(config.getProject().getBuildInfo().getName()); | |||
String name = defaultIfEmpty(config.getName(), defaultName); |
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.
This is the important fix: Instead of getting the name from the generated deployment resource, it will get it from the BaseConfig.
I've confirmed that this works fine for the kubernetes and openshift extensions.
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.
lgtm
Relates to quarkiverse/quarkus-cert-manager#39 (comment)