Skip to content

Backport of watch: support -filter for consul watch: checks, services, nodes, service into release/1.16.x#17965

Merged
david-yu merged 6 commits into
release/1.16.xfrom
backport/gh-17642-watch-checks-tag/allegedly-workable-stud
Jun 30, 2023
Merged

Backport of watch: support -filter for consul watch: checks, services, nodes, service into release/1.16.x#17965
david-yu merged 6 commits into
release/1.16.xfrom
backport/gh-17642-watch-checks-tag/allegedly-workable-stud

Conversation

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

Backport

This PR is auto-generated from #17780 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: "ea4e3b34c59e3e6c7385c3ed26fe7558a405dc28", automatic backport requires rebase workflow

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


Description

Before:

consul watch -type=checks -state=critical  -tag=test
Invalid parameters: [tag]

After

consul watch -type=checks -filter="a in ServiceTags"  
[
    {
        "Node": "server-1",
        "CheckID": "fake-backend-check",
        "Name": "Service 'fake-backend' check",
        "Notes": "",
        "Output": "",
        "ServiceID": "fake-backend",
        "ServiceName": "fake-backend",
        "ServiceTags": [
            "a"
        ],

We can also support filtering by service name and status for check types as suggested by the user (see test case TestChecksWatch_Filter_by_ServiceNameStatus in the PR)

consul watch -type=checks -filter="ServiceName == bar and Status == critical"  

Testing & Reproduction steps

Links

#17642

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-17642-watch-checks-tag/allegedly-workable-stud branch from 90e391f to 5058832 Compare June 29, 2023 21:28
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/gh-17642-watch-checks-tag/allegedly-workable-stud branch from 973011a to 855e16d Compare June 29, 2023 21:28
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

@github-actions github-actions Bot added theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface labels Jun 29, 2023
@huikang huikang marked this pull request as ready for review June 29, 2023 22:49
@david-yu david-yu merged commit 46ae78b into release/1.16.x Jun 30, 2023
@david-yu david-yu deleted the backport/gh-17642-watch-checks-tag/allegedly-workable-stud branch June 30, 2023 19:59
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants