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

option: Fix ipvlan master device config #17130

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions daemon/cmd/daemon_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ func initEnv(cmd *cobra.Command) {

switch option.Config.DatapathMode {
case datapathOption.DatapathModeVeth:
if name := viper.GetString(option.IpvlanMasterDevice); name != "undefined" {
if name := option.Config.IpvlanMasterDevice; name != "undefined" {
log.WithField(logfields.IpvlanMasterDevice, name).
Fatal("ipvlan master device cannot be set in the 'veth' datapath mode")
}
Expand Down Expand Up @@ -1262,7 +1262,7 @@ func initEnv(cmd *cobra.Command) {
// the swagger API is that in future we might deprecate --device
// parameter with e.g. some auto-detection mechanism, thus for
// ipvlan it is desired to have a separate one, see PR #6608.
iface := viper.GetString(option.IpvlanMasterDevice)
iface := option.Config.IpvlanMasterDevice
if iface == "undefined" {
log.WithField(logfields.IpvlanMasterDevice, option.Config.Devices[0]).
Fatal("ipvlan master device must be specified in the 'ipvlan' datapath mode")
Expand Down
2 changes: 2 additions & 0 deletions pkg/option/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,7 @@ type DaemonConfig struct {
IPv6Range string
IPv4ServiceRange string
IPv6ServiceRange string
IpvlanMasterDevice string
K8sAPIServer string
K8sKubeConfigPath string
K8sClientBurst int
Expand Down Expand Up @@ -2479,6 +2480,7 @@ func (c *DaemonConfig) Populate() {
c.IPTablesLockTimeout = viper.GetDuration(IPTablesLockTimeout)
c.IPTablesRandomFully = viper.GetBool(IPTablesRandomFully)
c.IPSecKeyFile = viper.GetString(IPSecKeyFileName)
c.IpvlanMasterDevice = viper.GetString(IpvlanMasterDevice)
c.ModePreFilter = viper.GetString(PrefilterMode)
c.EnableMonitor = viper.GetBool(EnableMonitorName)
c.MonitorAggregation = viper.GetString(MonitorAggregationName)
Expand Down