multus/types: handle delegates as Go structs and other cleanups

This commit is contained in:
Dan Williams
2018-05-01 13:08:39 -05:00
committed by Kuralamudhan Ramakrishnan
parent 8895358816
commit 61d212c59a
4 changed files with 203 additions and 260 deletions

View File

@@ -25,10 +25,24 @@ import (
// NetConf for cni config file written in json
type NetConf struct {
types.NetConf
ConfDir string `json:"confDir"`
CNIDir string `json:"cniDir"`
Delegates []map[string]interface{} `json:"delegates"`
Kubeconfig string `json:"kubeconfig"`
ConfDir string `json:"confDir"`
CNIDir string `json:"cniDir"`
// RawDelegates is private to the NetConf class; use Delegates instead
RawDelegates []map[string]interface{} `json:"delegates"`
Delegates []*DelegateNetConf `json:"-"`
Kubeconfig string `json:"kubeconfig"`
}
type DelegateNetConf struct {
types.NetConf
IfnameRequest string `json:"ifnameRequest,omitempty"`
// MasterPlugin is only used internal housekeeping
MasterPlugin bool `json:"-"`
// Raw unmarshalled JSON
RawConfig map[string]interface{}
// Raw bytes
Bytes []byte
}
type Network struct {