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

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

Merged

Conversation

hc-github-team-consul-core
Copy link
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
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
absolutelightning 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 <[email protected]>

* 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 <[email protected]>

* fix tests

* removed unwanted code

---------

Co-authored-by: Ganesh S <[email protected]>
Co-authored-by: R.B. Boyer <[email protected]>
@absolutelightning absolutelightning marked this pull request as ready for review October 8, 2023 13:20
@absolutelightning absolutelightning requested a review from a team as a code owner October 8, 2023 13:20
@david-yu
Copy link
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.

@absolutelightning absolutelightning merged commit 4e98c51 into release/1.16.x Oct 9, 2023
@absolutelightning absolutelightning 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