forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
102 lines (82 loc) · 2.24 KB
/
types.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package api
import (
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
)
const (
ClusterNetworkDefault = "default"
EgressNetworkPolicyMaxRules = 50
)
// +genclient=true
type ClusterNetwork struct {
unversioned.TypeMeta
kapi.ObjectMeta
Network string
HostSubnetLength uint32
ServiceNetwork string
PluginName string
}
type ClusterNetworkList struct {
unversioned.TypeMeta
unversioned.ListMeta
Items []ClusterNetwork
}
// HostSubnet encapsulates the inputs needed to define the container subnet network on a node
type HostSubnet struct {
unversioned.TypeMeta
kapi.ObjectMeta
// host may just be an IP address, resolvable hostname or a complete DNS
Host string
HostIP string
Subnet string
}
// HostSubnetList is a collection of HostSubnets
type HostSubnetList struct {
unversioned.TypeMeta
unversioned.ListMeta
Items []HostSubnet
}
// NetNamespace holds the network id against its name
type NetNamespace struct {
unversioned.TypeMeta
kapi.ObjectMeta
NetName string
NetID uint32
}
// NetNamespaceList is a collection of NetNamespaces
type NetNamespaceList struct {
unversioned.TypeMeta
unversioned.ListMeta
Items []NetNamespace
}
// EgressNetworkPolicyRuleType gives the type of an EgressNetworkPolicyRule
type EgressNetworkPolicyRuleType string
const (
EgressNetworkPolicyRuleAllow EgressNetworkPolicyRuleType = "Allow"
EgressNetworkPolicyRuleDeny EgressNetworkPolicyRuleType = "Deny"
)
// EgressNetworkPolicyPeer specifies a target to apply egress policy to
type EgressNetworkPolicyPeer struct {
CIDRSelector string
}
// EgressNetworkPolicyRule contains a single egress network policy rule
type EgressNetworkPolicyRule struct {
Type EgressNetworkPolicyRuleType
To EgressNetworkPolicyPeer
}
// EgressNetworkPolicySpec provides a list of policies on outgoing traffic
type EgressNetworkPolicySpec struct {
Egress []EgressNetworkPolicyRule
}
// EgressNetworkPolicy describes the current egress network policy
type EgressNetworkPolicy struct {
unversioned.TypeMeta
kapi.ObjectMeta
Spec EgressNetworkPolicySpec
}
// EgressNetworkPolicyList is a collection of EgressNetworkPolicy
type EgressNetworkPolicyList struct {
unversioned.TypeMeta
unversioned.ListMeta
Items []EgressNetworkPolicy
}