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(matchexpr): include jvmId in js binding #1393

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

andrewazores
Copy link
Member

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed the last commit: git commit --amend --signoff

Related to #1377
Related to #1389

Description of the change:

This copies the jvmId field from the ServiceRef object representing a target application into the object binding passed into the JS engine when evaluating a match expression.

Motivation for the change:

Without this, the jvmId property tested in the matchExpression will always be an undefined value, leading to expressions that do not properly test and evaluate against the intended targets. In #1377 Cryostat is still able to use the credentials to authenticate to -agents because the lookup is direct by stored credential ID rather than evaluating the associated expression, but this bug does actually manifest in the web-client since it is visible on the /security view that the agents' stored credentials display as matching against 0 targets.

How to manually test:

  1. Run CRYOSTAT_IMAGE=quay.io... sh smoketest.sh...
  2. Open web-client and go to /security
  3. Observe that the two -agent instances' stored credentials should report 1 match each, and expanding the rows should show that each match is for the expected agent target.

Signed-off-by: Andrew Azores <aazores@redhat.com>
@andrewazores andrewazores force-pushed the matchexpression-jvmid branch from a30f7ef to 744d6cb Compare March 8, 2023 20:51
@andrewazores andrewazores requested review from maxcao13 and tthvo March 8, 2023 20:51
@mergify mergify bot added the safe-to-test label Mar 8, 2023
Signed-off-by: Andrew Azores <aazores@redhat.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2023

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1393-7b4b9ee1430dba25f353b548c6f81bbb399ddd33 sh smoketest.sh

Copy link
Member

@tthvo tthvo left a comment

Choose a reason for hiding this comment

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

Looks good to me! This fixed the issue with serviceUrl not being matched too.

@andrewazores andrewazores merged commit 76a4e52 into cryostatio:main Mar 8, 2023
@andrewazores andrewazores deleted the matchexpression-jvmid branch March 8, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants