Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mabartos
Copy link
Contributor

@mabartos mabartos commented Dec 10, 2024

As the custom Keycloak image is used when testing the Operator, it should be unmarked as optimized to be properly set up.

Draft PR for now as some tweaks to the main will be added. This should be ready for backport.

@mabartos mabartos requested review from a team as code owners December 10, 2024 15:43
@mabartos mabartos marked this pull request as draft December 10, 2024 15:43
@mabartos mabartos self-assigned this Dec 10, 2024
@mabartos mabartos marked this pull request as ready for review December 11, 2024 09:01
@mabartos
Copy link
Contributor Author

Problem Summary

As we use optimized custom Keycloak image when testing Operator, some problems occurred due to the build time options manner. In order to properly start distribution with Tracing enabled, we need to have enabled opentelemetry feature, and set tracing-enabled=true. Associated Keycloak options features-enabled, and tracing-enabled are build time, so they need reaugmentation to be properly propagated.

However, as the Operator uses an optimized image, no augmentation was done and we faced quite weird behavior due to it. It was a series of unhappy coincidences:

  1. The focus of the test case was propagating proper env vars to the pod and nothing more. We did not even wait for the proper server startup - we disabled probes for the test case.
  2. The DelayedAttributes handling on the Quarkus side
  3. Not sure how good was our mechanism for property propagation to Quarkus that time (maybe the quarkus.otel.traces.enabled, or quarkus.otel.enabled was propagated to Quarkus without running augmentation and that might have caused some issues)

In this PR, probes are enabled and we will wait for the proper server startup with the tracing capabilities to verify everything works as expected. We unmarked the image as optimized, so the reaugmentation is happening. It should solve the problem and the issue should not occur again. We can keep an eye on it for some time, but I believe it's gonna be ok.

@shawkins @vmuzikar Are you ok with these changes?

}

@Test
public void podNamePropagation() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly we don't even need to move it to a separate test class, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to move here also the test case for Keycloak Tracing CR to have it separated. Does it work for you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, if we move the other tracing test here, that seems good. Point is to keep them in a single place.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want move the other test here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be done in a separate PR to keep some sort of atomicity.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, works for me either way, don't want to block this PR on this.

My reasoning to suggest moving the other OTEL test (testTracingSpec) in this PR was that we're also moving podNamePropagation to a new test class here, so felt natural to me to move both at the same time. But it's not a blocker for me.

@mabartos
Copy link
Contributor Author

Should be ok now.

}

@Test
public void podNamePropagation() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, works for me either way, don't want to block this PR on this.

My reasoning to suggest moving the other OTEL test (testTracingSpec) in this PR was that we're also moving podNamePropagation to a new test class here, so felt natural to me to move both at the same time. But it's not a blocker for me.

@mabartos mabartos merged commit 9f13b27 into keycloak:main Dec 16, 2024
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing operator test - KeycloakDeploymentTest.testPodNamePropagation

3 participants