forked from nokia/danm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datastructs.go
52 lines (44 loc) · 1.53 KB
/
datastructs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package datastructs
import (
"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/cni/pkg/version"
)
const (
OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
)
var (
SupportedCniVersions = version.PluginSupports("0.3.1")
)
type NetConf struct {
types.NetConf
Kubeconfig string `json:"kubeconfig"`
CniConfigDir string `json:"cniDir"`
NamingScheme string `json:"namingScheme"`
}
type CniBackend struct {
CNIVersion string
}
// Interface represents a request coming from the Pod to connect it to one DanmNet during CNI_ADD operation
// It contains the name of the network object the Pod should be connected to, and other optional requests
// Pods can influence the scheme of IP allocation (dynamic, static, none),
// and can ask for the provisioning of policy-based IP routes
type Interface struct {
Network string `json:"network,omitempty"`
TenantNetwork string `json:"tenantNetwork,omitempty"`
ClusterNetwork string `json:"clusterNetwork,omitempty"`
Ip string `json:"ip,omitempty"`
Ip6 string `json:"ip6,omitempty"`
Proutes map[string]string `json:"proutes,omitempty"`
Proutes6 map[string]string `json:"proutes6,omitempty"`
DefaultIfaceName string
Device string
SequenceId int
}
type IpamConfig struct {
Type string `json:"type"`
Ips []IpamIp `json:"ips,omitempty"`
}
type IpamIp struct {
IpCidr string `json:"ipcidr"`
Version int `json:"version"`
}