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

Add patch for default eupf cmd config [issue #587] #590

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ func init() {
v.SetDefault("ueip_pool", "10.60.0.0/24")
v.SetDefault("teid_pool", 65535)

if v.GetString("n9_address") == "n3addr" {
v.Set("n9_address", v.GetString("n3_address"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't you use v.SetDefault instead of v.Set?

Copy link
Collaborator Author

@krezef4l krezef4l Jan 16, 2025

Choose a reason for hiding this comment

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

Changed.
Also removed other 'SetDefault's, since binding native Viper's pflags also binds default cli arg values

}

v.SetConfigFile(*configPath)

v.SetEnvPrefix("upf")
Expand Down Expand Up @@ -150,10 +154,6 @@ func (c *UpfConfig) Validate() error {
c.UEIPPool = ""
}

if c.N9Address == "n3addr" {
c.N9Address = c.N3Address
}

return nil
}

Expand Down
Loading