Skip to content

Fix port wildcard-prefix#600

Open
FengPan-Frank wants to merge 1 commit intosonic-net:masterfrom
FengPan-Frank:fix/port-phy-attr-wildcard-prefix
Open

Fix port wildcard-prefix#600
FengPan-Frank wants to merge 1 commit intosonic-net:masterfrom
FengPan-Frank:fix/port-phy-attr-wildcard-prefix

Conversation

@FengPan-Frank
Copy link
Collaborator

Why I did it

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Copilot AI review requested due to automatic review settings March 3, 2026 03:27
@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes wildcard handling for PORT_PHY_ATTR virtual DB path translation so that <prefix>* only matches ports with the same prefix (instead of matching all ports whenever the key ends with *). This improves correctness of gNMI-to-Redis path expansion in sonic_data_client.

Changes:

  • Update v2rPortPhyAttrStats and v2rPortPhyAttrFieldStats to filter wildcard expansions by the requested key prefix.
  • Add unit tests verifying that Ethernet* does not match non-Ethernet port keys, while etp* does.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
sonic_data_client/virtual_db.go Adds prefix filtering for PORT_PHY_ATTR wildcard key expansion (<prefix>*).
sonic_data_client/virtual_db_test.go Adds tests covering wildcard-prefix filtering behavior for both stats and field-stats variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants