VictoriaMetrics / VictoriaMetrics/operator

HTTPRoute extraRules inherit matches/filters from previous rules

Open
#2,605 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug waiting for release
Dominant language
Go
Stars
589
Forks
229
Avg merge
1d 9h
Merged PRs (30d)
77

Description

The operator renders spec.httpRoute.extraRules incorrectly when a CR defines multiple rules.

Example input:

spec:
  httpRoute:
    parentRefs:
      - name: example-gateway
    hostnames:
      - example.com
    extraRules:
      - matches:
          - path:
              type: PathPrefix
              value: /a
        filters:
          - type: RequestHeaderModifier
            requestHeaderModifier:
              add:
                - name: x-scope
                  value: "a"
      - matches:
          - path:
              type: PathPrefix
              value: /b
Expected behavior

spec.rules[1] contains only the second match (/b) and no filters.

Actual behavior

spec.rules[1] contains the second match (/b) plus the filters from the first rule (x-scope: a). If the second entry omits matches, it also keeps the first entry's matches.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the HTTPRoute rendering path for spec.httpRoute.extraRules and reproduce the supplied CR example. Verify that each rendered rule uses only its own matches and filters, including when either field is omitted; done means later rules no longer inherit fields from earlier rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.