Documentation ¶
Index ¶
- func GetGVR() schema.GroupVersionResource
- type Builder
- func (builder *Builder) Create() (*Builder, error)
- func (builder *Builder) Delete() error
- func (builder *Builder) Exists() bool
- func (builder *Builder) Get() (*nadV1.NetworkAttachmentDefinition, error)
- func (builder *Builder) GetString() (string, error)
- func (builder *Builder) Update() (*Builder, error)
- func (builder *Builder) WithMasterPlugin(masterPlugin *MasterPlugin) *Builder
- func (builder *Builder) WithPlugins(name string, plugins *[]Plugin) *Builder
- type Capability
- type IPAM
- type IPRanges
- type Link
- type MasterBondPlugin
- func (plugin *MasterBondPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
- func (plugin *MasterBondPlugin) WithCapabilities(capabilities *Capability) *MasterBondPlugin
- func (plugin *MasterBondPlugin) WithFailOverMac(failOverMac int) *MasterBondPlugin
- func (plugin *MasterBondPlugin) WithIPAM(ipam *IPAM) *MasterBondPlugin
- func (plugin *MasterBondPlugin) WithLinks(links []Link) *MasterBondPlugin
- func (plugin *MasterBondPlugin) WithLinksInContainer(linksInContainer bool) *MasterBondPlugin
- func (plugin *MasterBondPlugin) WithMiimon(miimon int) *MasterBondPlugin
- func (plugin *MasterBondPlugin) WithVLANInContainer(vlan uint16) *MasterBondPlugin
- type MasterBridgePlugin
- type MasterIPVlanPlugin
- func (plugin *MasterIPVlanPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
- func (plugin *MasterIPVlanPlugin) WithIPAM(ipam *IPAM) *MasterIPVlanPlugin
- func (plugin *MasterIPVlanPlugin) WithLinkInContainer() *MasterIPVlanPlugin
- func (plugin *MasterIPVlanPlugin) WithMasterInterface(masterInterfaceName string) *MasterIPVlanPlugin
- type MasterMacVlanPlugin
- func (plugin *MasterMacVlanPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
- func (plugin *MasterMacVlanPlugin) WithIPAM(ipam *IPAM) *MasterMacVlanPlugin
- func (plugin *MasterMacVlanPlugin) WithLinkInContainer() *MasterMacVlanPlugin
- func (plugin *MasterMacVlanPlugin) WithMasterInterface(master string) *MasterMacVlanPlugin
- func (plugin *MasterMacVlanPlugin) WithMode(mode string) *MasterMacVlanPlugin
- type MasterPlugin
- type MasterVlanPlugin
- func (plugin *MasterVlanPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
- func (plugin *MasterVlanPlugin) WithIPAM(ipam *IPAM) *MasterVlanPlugin
- func (plugin *MasterVlanPlugin) WithLinkInContainer() *MasterVlanPlugin
- func (plugin *MasterVlanPlugin) WithMasterInterface(masterInterfaceName string) *MasterVlanPlugin
- type Plugin
- type Routes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGVR ¶
func GetGVR() schema.GroupVersionResource
GetGVR returns nad's GroupVersionResource which could be used for Clean function.
Types ¶
type Builder ¶
type Builder struct { Definition *nadV1.NetworkAttachmentDefinition Object *nadV1.NetworkAttachmentDefinition // contains filtered or unexported fields }
Builder provides struct for NAD object which contains connection to cluster and the NAD object itself.
func NewBuilder ¶
NewBuilder creates a new instance of NetworkAttachmentDefinition Builder. arguments: "apiClient" - the nad network client.
"name" - the name of the nad network. "nsname" - the nad network namespace.
return value: the created Builder.
func (*Builder) Create ¶
Create builds a NetworkAttachmentDefinition resource with the builder configuration.
if the creation failed, the builder errorMsg will be updated.
return value: the builder itself with the NAD object if the creation succeeded.
an error if any occurred.
func (*Builder) Delete ¶
Delete removes NetworkAttachmentDefinition resource with the builder definition. (If NAD does not exist, nothing is done) and a nil error is returned. return value: an error if any occurred.
func (*Builder) Exists ¶
Exists checks if a NAD is exists in the builder. return value: true - NAD exists.
false - NAD does not exist.
func (*Builder) Get ¶
func (builder *Builder) Get() (*nadV1.NetworkAttachmentDefinition, error)
Get returns CatalogSource object if found.
func (*Builder) GetString ¶
GetString prints NetworkAttachmentDefinition resource. return value: the builder details in json string format, and an error if any occurred.
func (*Builder) WithMasterPlugin ¶
func (builder *Builder) WithMasterPlugin(masterPlugin *MasterPlugin) *Builder
WithMasterPlugin defines master plugin configuration in the NetworkAttachmentDefinition spec.
type Capability ¶
Capability tells if the plugin supports MAC.
type IPAM ¶
type IPAM struct { Type string `json:"type,omitempty"` AddrRange string `json:"range,omitempty"` RangeStart string `json:"range_start,omitempty"` RangeEnd string `json:"range_end,omitempty"` Gateway string `json:"gateway,omitempty"` Exclude []string `json:"exclude,omitempty"` Routes []Routes `json:"routes,omitempty"` IPRanges []IPRanges `json:"ipRanges,omitempty"` }
IPAM container the IPAM configuration for a NAD.
func IPAMWhereAbouts ¶
IPAMWhereAbouts returns WhereAbout ipam type.
func WhereAboutsAppendRange ¶
WhereAboutsAppendRange returns WhereAbout ipam type with additional address range.
type IPRanges ¶
type IPRanges struct { Range string `json:"range,omitempty"` Gateway string `json:"gateway,omitempty"` }
IPRanges contains ip range for WhereAbout IPAM plugin.
type Link ¶
type Link struct {
Name string `json:"name,omitempty"`
}
Link contains the link name of a link.
type MasterBondPlugin ¶
type MasterBondPlugin struct {
// contains filtered or unexported fields
}
MasterBondPlugin provides struct for MasterPlugin to create a NAD for bonded interfaces.
func NewMasterBondPlugin ¶
func NewMasterBondPlugin(name, mode string) *MasterBondPlugin
NewMasterBondPlugin creates new instance of MasterBondPlugin.
func (*MasterBondPlugin) GetMasterPluginConfig ¶
func (plugin *MasterBondPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
GetMasterPluginConfig returns master plugin if error is not occur.
func (*MasterBondPlugin) WithCapabilities ¶
func (plugin *MasterBondPlugin) WithCapabilities(capabilities *Capability) *MasterBondPlugin
WithCapabilities defines Capabilities configuration to MasterBondPlugin.
func (*MasterBondPlugin) WithFailOverMac ¶
func (plugin *MasterBondPlugin) WithFailOverMac(failOverMac int) *MasterBondPlugin
WithFailOverMac defines FailOverMac configuration to MasterBondPlugin.
func (*MasterBondPlugin) WithIPAM ¶
func (plugin *MasterBondPlugin) WithIPAM(ipam *IPAM) *MasterBondPlugin
WithIPAM defines IPAM configuration to MasterBondPlugin.
func (*MasterBondPlugin) WithLinks ¶
func (plugin *MasterBondPlugin) WithLinks(links []Link) *MasterBondPlugin
WithLinks defines Links configuration to MasterBondPlugin.
func (*MasterBondPlugin) WithLinksInContainer ¶
func (plugin *MasterBondPlugin) WithLinksInContainer(linksInContainer bool) *MasterBondPlugin
WithLinksInContainer defines linksInContainer configuration to MasterBondPlugin.
func (*MasterBondPlugin) WithMiimon ¶
func (plugin *MasterBondPlugin) WithMiimon(miimon int) *MasterBondPlugin
WithMiimon defines Miimon configuration to MasterBondPlugin.
func (*MasterBondPlugin) WithVLANInContainer ¶
func (plugin *MasterBondPlugin) WithVLANInContainer(vlan uint16) *MasterBondPlugin
WithVLANInContainer defines a VLAN ID configuration to MasterBondPlugin.
type MasterBridgePlugin ¶
type MasterBridgePlugin struct {
// contains filtered or unexported fields
}
MasterBridgePlugin provides struct for MasterPlugin set to bridge in NetworkAttachmentDefinition.
func NewMasterBridgePlugin ¶
func NewMasterBridgePlugin(name, bridgeName string) *MasterBridgePlugin
NewMasterBridgePlugin creates new instance of MasterBridgePlugin.
func (*MasterBridgePlugin) GetMasterPluginConfig ¶
func (plugin *MasterBridgePlugin) GetMasterPluginConfig() (*MasterPlugin, error)
GetMasterPluginConfig returns master plugin if error does not occur.
func (*MasterBridgePlugin) WithIPAM ¶
func (plugin *MasterBridgePlugin) WithIPAM(ipam *IPAM) *MasterBridgePlugin
WithIPAM defines IPAM configuration to MasterBridgePlugin. Default is empty.
type MasterIPVlanPlugin ¶
type MasterIPVlanPlugin struct {
// contains filtered or unexported fields
}
MasterIPVlanPlugin provides struct for MasterPlugin set to IP vlan in NetworkAttachmentDefinition.
func NewMasterIPVlanPlugin ¶
func NewMasterIPVlanPlugin(name string) *MasterIPVlanPlugin
NewMasterIPVlanPlugin creates new instance of MasterIP VlanPlugin.
func (*MasterIPVlanPlugin) GetMasterPluginConfig ¶
func (plugin *MasterIPVlanPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
GetMasterPluginConfig returns master plugin if error does not occur.
func (*MasterIPVlanPlugin) WithIPAM ¶
func (plugin *MasterIPVlanPlugin) WithIPAM(ipam *IPAM) *MasterIPVlanPlugin
WithIPAM defines IPAM configuration to MasterIPVlanPlugin. Default is empty.
func (*MasterIPVlanPlugin) WithLinkInContainer ¶
func (plugin *MasterIPVlanPlugin) WithLinkInContainer() *MasterIPVlanPlugin
WithLinkInContainer defines MasterIPVlanPlugin using linkInContainer feature.
func (*MasterIPVlanPlugin) WithMasterInterface ¶
func (plugin *MasterIPVlanPlugin) WithMasterInterface(masterInterfaceName string) *MasterIPVlanPlugin
WithMasterInterface defines master interface to MasterVlanPlugin. Default is cn0.
type MasterMacVlanPlugin ¶
type MasterMacVlanPlugin struct {
// contains filtered or unexported fields
}
MasterMacVlanPlugin provides struct for NetworkAttachmentDefinition Master plugin with macvlan configuration.
func NewMasterMacVlanPlugin ¶
func NewMasterMacVlanPlugin(name string) *MasterMacVlanPlugin
NewMasterMacVlanPlugin creates new instance of MasterMacVlanPlugin.
func (*MasterMacVlanPlugin) GetMasterPluginConfig ¶
func (plugin *MasterMacVlanPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
GetMasterPluginConfig returns master plugin if error is not occur.
func (*MasterMacVlanPlugin) WithIPAM ¶
func (plugin *MasterMacVlanPlugin) WithIPAM(ipam *IPAM) *MasterMacVlanPlugin
WithIPAM defines IPAM configuration to MasterMacVlanPlugin. Default is empty.
func (*MasterMacVlanPlugin) WithLinkInContainer ¶
func (plugin *MasterMacVlanPlugin) WithLinkInContainer() *MasterMacVlanPlugin
WithLinkInContainer defines MasterMacVlan plugin using linkInContainer feature.
func (*MasterMacVlanPlugin) WithMasterInterface ¶
func (plugin *MasterMacVlanPlugin) WithMasterInterface(master string) *MasterMacVlanPlugin
WithMasterInterface defines master interface to MasterMacVlanPlugin. Default is cn0.
func (*MasterMacVlanPlugin) WithMode ¶
func (plugin *MasterMacVlanPlugin) WithMode(mode string) *MasterMacVlanPlugin
WithMode defines macvlan type to MasterMacVlanPlugin. Default is bridge.
type MasterPlugin ¶
type MasterPlugin struct { CniVersion string `json:"cniVersion,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Master string `json:"master,omitempty"` Mode string `json:"mode,omitempty"` Plugins *[]Plugin `json:"plugins,omitempty"` Bridge string `json:"bridge,omitempty"` Ipam *IPAM `json:"ipam,omitempty"` LinksInContainer bool `json:"linksInContainer,omitempty"` LinkInContainer bool `json:"linkInContainer,omitempty"` VlanID uint16 `json:"vlanId,omitempty"` FailOverMac int `json:"failOverMac,omitempty"` Miimon string `json:"miimon,omitempty"` Mtu int `json:"mtu,omitempty"` Links []Link `json:"links,omitempty"` Capabilities *Capability `json:"capabilities,omitempty"` }
MasterPlugin contains the master plugin configuration for a NAD.
type MasterVlanPlugin ¶
type MasterVlanPlugin struct {
// contains filtered or unexported fields
}
MasterVlanPlugin provides struct for MasterPlugin set to vlan in NetworkAttachmentDefinition.
func NewMasterVlanPlugin ¶
func NewMasterVlanPlugin(name string, vlanID uint16) *MasterVlanPlugin
NewMasterVlanPlugin creates new instance of MasterVlanPlugin.
func (*MasterVlanPlugin) GetMasterPluginConfig ¶
func (plugin *MasterVlanPlugin) GetMasterPluginConfig() (*MasterPlugin, error)
GetMasterPluginConfig returns master plugin if error does not occur.
func (*MasterVlanPlugin) WithIPAM ¶
func (plugin *MasterVlanPlugin) WithIPAM(ipam *IPAM) *MasterVlanPlugin
WithIPAM defines IPAM configuration to MasterVlanPlugin. Default is empty.
func (*MasterVlanPlugin) WithLinkInContainer ¶
func (plugin *MasterVlanPlugin) WithLinkInContainer() *MasterVlanPlugin
WithLinkInContainer defines MasterVlanPlugin using linkInContainer feature.
func (*MasterVlanPlugin) WithMasterInterface ¶
func (plugin *MasterVlanPlugin) WithMasterInterface(masterInterfaceName string) *MasterVlanPlugin
WithMasterInterface defines master interface to MasterVlanPlugin. Default is cn0.
type Plugin ¶
type Plugin struct { LinksInContainer bool `json:"linksInContainer,omitempty"` IPMasq bool `json:"ipMasq,omitempty"` IsGateway bool `json:"isGateway,omitempty"` IsDefaultGateway bool `json:"isDefaultGateway,omitempty"` ForceAddress bool `json:"forceAddress,omitempty"` HairpinMode bool `json:"hairpinMode,omitempty"` PromiscuousMode bool `json:"promiscuousMode,omitempty"` FailOverMac int `json:"failOverMac,omitempty"` CNIVersion string `json:"cniVersion,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Bridge string `json:"bridge,omitempty"` Master string `json:"master,omitempty"` Vlan string `json:"vlan,omitempty"` Mtu string `json:"mtu,omitempty"` VrfName string `json:"vrfName,omitempty"` Mode string `json:"mode,omitempty"` Miimon string `json:"miimon,omitempty"` Capabilities *Capability `json:"capabilities,omitempty"` Sysctl map[string]string `json:"sysctl,omitempty"` Links []Link `json:"links,omitempty"` Ipam *IPAM `json:"ipam,omitempty"` Owner int `json:"owner,omitempty"` Group int `json:"group,omitempty"` MultiQueue bool `json:"multiQueue,omitempty"` SelinuxContext string `json:"selinuxcontext,omitempty"` }
Plugin contains all plugin details and information of a single plugin.
func TuningMacPlugin ¶
TuningMacPlugin returns mac plugin configuration.