Skip to content

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

Merged
david-yu merged 6 commits intorelease/1.15.xfrom
backport/gh-17642-watch-checks-tag/suitably-dynamic-owl
Jun 30, 2023
Merged

Backport of watch: support -filter for consul watch: checks, services, nodes, service into release/1.15.x#17986
david-yu merged 6 commits intorelease/1.15.xfrom
backport/gh-17642-watch-checks-tag/suitably-dynamic-owl

Conversation

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

Backport

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

🚨

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/suitably-dynamic-owl branch from a5cf3dd to a29b6af Compare June 30, 2023 19:58
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/gh-17642-watch-checks-tag/suitably-dynamic-owl branch from 12d5ec6 to fb5ac3b Compare June 30, 2023 19:58
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

@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 30, 2023
@david-yu david-yu marked this pull request as ready for review June 30, 2023 19:59
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging June 30, 2023 20:01 Inactive
@vercel vercel bot temporarily deployed to Preview – consul June 30, 2023 20:03 Inactive
@david-yu david-yu merged commit 0a465dd into release/1.15.x Jun 30, 2023
@david-yu david-yu deleted the backport/gh-17642-watch-checks-tag/suitably-dynamic-owl branch June 30, 2023 20:26
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