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(registration): JMX URL defaults to reusing callback host part (backport #414) #415

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jun 12, 2024

Fixes #413

Rather than using the CRYOSTAT_AGENT_HOSTNAME property/env var to set the hostname used in JMX Service URL construction, this adds a new property (true by default) to reuse the host part of the Agent callback URL as the host part of the JMX Service URL. This is under the assumption that if the Agent is properly configured for use with a given Cryostat server, then the callback URL contains a reachable and resolvable host part. This is already used for the Agent HTTP URL, so reusing this for the JMX Service URL makes sense and keeps the URLs consistent with each other.

The user could work around this previously by setting the CRYOSTAT_AGENT_HOSTNAME manually, but this would mean adding more configuration on the user's side that they have to ensure both the HOSTNAME and CALLBACK are set appropriately, separately, just to make sure the Agent uses the same host part for both HTTP and JMX URLs. It seems better to do as in this PR and make that behaviour the automatic default, and allow the user to override that if for some reason they need it to behave differently.

Deployed in Kubernetes for example, getting both URLs to use the Pod IP address for the host part requires a Deployment with this:

        - name: POD_IP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.podIP
        - name: CRYOSTAT_AGENT_CALLBACK
          value: http://$(POD_IP):9977
        - name: CRYOSTAT_AGENT_HOSTNAME
          value: $(POD_IP)

With this patch, the CRYOSTAT_AGENT_HOSTNAME part can be omitted.


This is an automatic backport of pull request #414 done by Mergify.

@github-actions github-actions bot added the needs-triage Needs thorough attention from code reviewers label Jun 12, 2024
@andrewazores andrewazores added fix safe-to-test and removed needs-triage Needs thorough attention from code reviewers labels Jun 12, 2024
@andrewazores andrewazores merged commit 1072c89 into cryostat-v3.0 Jun 12, 2024
21 of 25 checks passed
@mergify mergify bot deleted the mergify/bp/cryostat-v3.0/pr-414 branch June 12, 2024 18:57
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.

1 participant