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 decorator cycle issue with Cert-Manager and OpenShift #1189

Merged
merged 1 commit into from Apr 19, 2023

Conversation

Sgitario
Copy link
Collaborator

@Sgitario Sgitario force-pushed the add_example_certmanager_ocp branch from f6a2401 to cc78d42 Compare April 19, 2023 13:37
@sonarcloud
Copy link

sonarcloud bot commented Apr 19, 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

CertificateBuilder builder = new CertificateBuilder();

// metadata
builder.withNewMetadata()
.withName(getName(meta))
.withNamespace(meta.getMetadata().getNamespace())
Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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.

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 5c74cee into dekorateio:main Apr 19, 2023
7 checks passed
@Sgitario Sgitario deleted the add_example_certmanager_ocp branch April 19, 2023 14:05
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