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

[YANG] Add constraint for loopback interface name formatting #11483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isabelmsft
Copy link
Contributor

@isabelmsft isabelmsft commented Jul 19, 2022

Why I did it

Loopback interface YANG model was missing the constraint for Loopback interface name formatting (should be LoopbackXXX)

How I did it

Add constraint to YANG model

How to verify it

Try configuring Loopback interface name to valid and invalid names

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

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

Description for the changelog

Link to config_db schema for YANG module changes

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

@isabelmsft isabelmsft requested a review from qiluo-msft as a code owner July 19, 2022 08:18
leaf name {
type string {
length 1..128;
pattern 'Loopback[0-9]{1,3}';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add unit test cases for valid/invalid usage?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add the related checking code into PR description.

@qiluo-msft qiluo-msft requested a review from ganglyu July 19, 2022 20:41
type string;
leaf name {
type string {
length 1..128;
Copy link
Contributor

Choose a reason for hiding this comment

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

you have defined pattern, is length still necessary?

@ganglyu
Copy link
Contributor

ganglyu commented Jul 20, 2022

buildimage pipeline failed, please build target or run unit test before commit.

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