Skip to content

Backport of NET-4135 - Fix NodeMeta filtering Catalog List Services API into release/1.16.x#19113

Merged
asheshvidyut merged 4 commits into
release/1.16.xfrom
backport/NET-4135/loudly-honest-elephant
Oct 9, 2023
Merged

Backport of NET-4135 - Fix NodeMeta filtering Catalog List Services API into release/1.16.x#19113
asheshvidyut merged 4 commits into
release/1.16.xfrom
backport/NET-4135/loudly-honest-elephant

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
Collaborator

Backport

This PR is auto-generated from #18322 to be assessed for backporting due to the inclusion of the label backport/1.16.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@absolutelightning
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


Description

Fixed the working of filter query parameter in /v1/catalog/services API. Fixes - #17422

Testing & Reproduction steps

Followed this tutorial and setup workloads in K8s.
Did curl -

asheshvidyut@asheshvidyut-H2GX766V9T ~/consul (NET-4135) » curl -ks -G http://localhost:8500/v1/catalog/services --data-urlencode filter="NodeMeta[\"consul-network-segment\"] == \"\" and NodeMeta[\"consul-version\"] == \"1.17.0\"" | jq
{
  "consul": []
}
asheshvidyut@asheshvidyut-H2GX766V9T ~/consul (NET-4135) » curl -ks -G http://localhost:8500/v1/catalog/services --data-urlencode filter="NodeMeta[\"synthetic-node\"] == true" | jq
{
  "frontend": [],
  "frontend-sidecar-proxy": [],
  "nginx": [],
  "nginx-sidecar-proxy": [],
  "payments": [],
  "payments-sidecar-proxy": [],
  "postgres": [],
  "postgres-sidecar-proxy": [],
  "products-api": [],
  "products-api-sidecar-proxy": [],
  "public-api": [],
  "public-api-sidecar-proxy": []
}

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/NET-4135/loudly-honest-elephant branch 3 times, most recently from fae9f28 to 63fbed8 Compare October 8, 2023 12:49
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/NET-4135/loudly-honest-elephant branch from 63fbed8 to fae9f28 Compare October 8, 2023 12:49
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@vercel vercel Bot temporarily deployed to Preview – consul October 8, 2023 12:54 Inactive
asheshvidyut and others added 3 commits October 8, 2023 18:37
* logs for debugging

* Init

* white spaces fix

* added change log

* Fix tests

* fix typo

* using queryoptionfilter to populate args.filter

* tests

* fix test

* fix tests

* fix tests

* fix tests

* fix tests

* fix variable name

* fix tests

* fix tests

* fix tests

* Update .changelog/18322.txt

Co-authored-by: Ganesh S <ganesh.seetharaman@hashicorp.com>

* fix change log

* address nits

* removed unused line

* doing join only when filter has nodemeta

* fix tests

* fix tests

* Update agent/consul/catalog_endpoint.go

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>

* fix tests

* removed unwanted code

---------

Co-authored-by: Ganesh S <ganesh.seetharaman@hashicorp.com>
Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
@asheshvidyut asheshvidyut marked this pull request as ready for review October 8, 2023 13:20
@asheshvidyut asheshvidyut requested a review from a team as a code owner October 8, 2023 13:20
@david-yu
Copy link
Copy Markdown
Contributor

david-yu commented Oct 9, 2023

@absolutelightning I believe you should be able to merge the backports as long as all tests pass successfully without any review from staff engineers.

@asheshvidyut asheshvidyut merged commit 4e98c51 into release/1.16.x Oct 9, 2023
@asheshvidyut asheshvidyut deleted the backport/NET-4135/loudly-honest-elephant branch October 9, 2023 05:06
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.

4 participants