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

Validate the interface name against a list of prefixes #106

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

jaydeokar
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
This accepts a list of interface prefixes to TC class. If the interface doesn't start from any of the accepted list of prefixes we return an error and skip any actions on that interface

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jaydeokar jaydeokar requested a review from a team as a code owner February 12, 2025 04:43
if !strings.HasPrefix(interfaceName, interfacePrefix) {
log.Errorf("expected prefix - %s but got %s", interfacePrefix, interfaceName)
return errors.New("Mismatched initialized prefix name and passed interface name")
func mismatchedInterfacePrefix(interfaceName string, interfacePrefix []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

@jaydeokar jaydeokar merged commit 273ff75 into aws:main Feb 18, 2025
2 checks passed
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.

2 participants