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 - NET-4135 - Fix NodeMeta filtering Catalog List Services API (#18322) #19115

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

absolutelightning
Copy link
Contributor

Backport

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

🚨

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: unable to process merge commit: "91efd2c15e14d27f7317426f22a23ec1610e1088", automatic backport requires rebase workflow

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

* 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 requested a review from a team as a code owner October 9, 2023 05:12
@github-actions github-actions bot added the theme/api Relating to the HTTP API interface label Oct 9, 2023
@absolutelightning absolutelightning changed the title NET-4135 - Fix NodeMeta filtering Catalog List Services API (#18322) Backport - NET-4135 - Fix NodeMeta filtering Catalog List Services API (#18322) Oct 9, 2023
@absolutelightning absolutelightning enabled auto-merge (squash) October 9, 2023 05:23
@absolutelightning absolutelightning merged commit 020fffa into release/1.14.x Oct 9, 2023
@absolutelightning absolutelightning deleted the backport/NET-4135/rel-1.14.x branch October 9, 2023 05:23
@absolutelightning absolutelightning added the consul-india PRs/Issues assigned to Consul India team label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul-india PRs/Issues assigned to Consul India team pr/no-backport theme/api Relating to the HTTP API interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants