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 member cli: add -filter expression to flags into release/1.16.x #18276

Conversation

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

Backport

This PR is auto-generated from #18223 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:
@huikang
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: "44f52d98940efefcf6a1e15d7679ddb9dbfdf6b8", automatic backport requires rebase workflow

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


Description

Add -filter to consul members to filter the members by bexpr. Please see #18152 for the use case

  • unit test added to api

How to Test

Without filter: all members from federated clusters will be listed:

consul members -wan                            
Node          Address              Status  Type    Build      Protocol  DC   Partition  Segment
server-1.dc2  192.168.1.168:8322   alive   server  1.17.0dev  2         dc2  default    <all>
server-1.dc3  192.168.1.168:28322  alive   server  1.17.0dev  2         dc3  default    <all>

Filtered results: only list the members from a specified dc

consul members -wan -filter 'Tags["dc"] == dc2'           
Node          Address             Status  Type    Build      Protocol  DC   Partition  Segment
server-1.dc2  192.168.1.168:8322  alive   server  1.17.0dev  2         dc2  default    <all>


consul members -wan -filter 'Tags["dc"] == dc3'
Node          Address              Status  Type    Build      Protocol  DC   Partition  Segment
server-1.dc3  192.168.1.168:28322  alive   server  1.17.0dev  2         dc3  default    <all>

-->

Links

Fix #18152

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/gh-18152-members-filter-dc/regularly-vast-tadpole branch from 5e96f40 to a56184d Compare July 25, 2023 17:55
@github-actions github-actions bot added type/docs Documentation needs to be created/updated/clarified theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface labels Jul 25, 2023
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

@huikang huikang marked this pull request as ready for review July 25, 2023 18:38
@huikang huikang requested a review from a team as a code owner July 25, 2023 18:38
@huikang huikang merged commit 024a2cd into release/1.16.x Jul 25, 2023
@huikang huikang deleted the backport/gh-18152-members-filter-dc/regularly-vast-tadpole branch July 25, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants