Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var V1EgressRule1 = apiv1.Rule{ Action: "pass", IPVersion: &ipv4, Protocol: &numProtocol1, ICMP: &icmp1, Source: apiv1.EntityRule{ Tag: "tag3", Net: &cidr2, Selector: "all()", }, }
var V1EgressRule2 = apiv1.Rule{ Action: "allow", IPVersion: &ipv6, Protocol: &v1strProtocol2, ICMP: &icmp1, Source: apiv1.EntityRule{ Tag: "tag4", Net: &cidrv62, Selector: "label2 == '1234'", }, }
var V1InRule1 = apiv1.Rule{ Action: "allow", IPVersion: &ipv4, Protocol: &v1strProtocol1, ICMP: &icmp1, Source: apiv1.EntityRule{ Tag: "tag1", Net: &cidr1, Nets: []*net.IPNet{&cidr3, &cidr4}, NotNet: &cidr2, NotNets: []*net.IPNet{&cidr1, &cidr3}, Selector: "has(calico/k8s_ns) || bake == 'cake'", }, Destination: apiv1.EntityRule{ Tag: "kingindanorth", Net: &cidr2, Nets: []*net.IPNet{&cidr1, &cidr3}, NotNet: &cidr1, NotNets: []*net.IPNet{&cidr3, &cidr4}, }, }
var V1InRule2 = apiv1.Rule{ Action: "deny", IPVersion: &ipv6, Protocol: &numProtocol1, ICMP: &icmp1, Source: apiv1.EntityRule{ Tag: "tag2", Net: &cidrv61, Selector: "has(label2)", }, }
var V1ModelEgressRule1 = model.Rule{
Action: "next-tier",
IPVersion: &ipv4,
Protocol: &numProtocol1,
ICMPType: &icmpType1,
ICMPCode: &icmpCode1,
SrcTag: "tag3",
SrcNet: &cidr2Net,
SrcSelector: "all()",
}
var V1ModelEgressRule2 = model.Rule{
Action: "allow",
IPVersion: &ipv6,
Protocol: &v1strProtocol2,
ICMPType: &icmpType1,
ICMPCode: &icmpCode1,
SrcTag: "tag4",
SrcNet: &cidrv62,
SrcSelector: "label2 == '1234'",
}
var V1ModelInRule1 = model.Rule{ Action: "allow", IPVersion: &ipv4, Protocol: &v1strProtocol1, ICMPType: &icmpType1, ICMPCode: &icmpCode1, SrcTag: "tag1", SrcNet: &cidr1Net, SrcNets: []*net.IPNet{&cidr3Net, &cidr4Net}, NotSrcNet: &cidr2Net, NotSrcNets: []*net.IPNet{&cidr1Net, &cidr3Net}, DstTag: "kingindanorth", DstNet: &cidr2Net, DstNets: []*net.IPNet{&cidr1Net, &cidr3Net}, NotDstNet: &cidr1Net, NotDstNets: []*net.IPNet{&cidr3Net, &cidr4Net}, SrcSelector: "has(calico/k8s_ns) || bake == 'cake'", }
var V1ModelInRule2 = model.Rule{
Action: "deny",
IPVersion: &ipv6,
Protocol: &numProtocol1,
ICMPType: &icmpType1,
ICMPCode: &icmpCode1,
SrcTag: "tag2",
SrcNet: &cidrv61,
SrcSelector: "has(label2)",
}
var V3EgressRule1 = apiv3.Rule{ Action: apiv3.Pass, IPVersion: &ipv4, Protocol: &numProtocol1, ICMP: &v3icmp1, Source: apiv3.EntityRule{ Nets: []string{cidr2StrictMaskStr}, Selector: "(all()) && tag3 == ''", }, }
var V3EgressRule2 = apiv3.Rule{ Action: apiv3.Allow, IPVersion: &ipv6, Protocol: &v3strProtocol2, ICMP: &v3icmp1, Source: apiv3.EntityRule{ Nets: []string{cidrv62Str}, Selector: "(label2 == '1234') && tag4 == ''", }, }
var V3InRule1 = apiv3.Rule{ Action: apiv3.Allow, IPVersion: &ipv4, Protocol: &v3strProtocol1, ICMP: &v3icmp1, Source: apiv3.EntityRule{ Nets: []string{cidr3StrictMaskStr, cidr4StrictMaskStr, cidr1StrictMaskStr}, NotNets: []string{cidr1StrictMaskStr, cidr3StrictMaskStr, cidr2StrictMaskStr}, Selector: "(has(projectcalico.org/namespace) || bake == 'cake') && tag1 == ''", }, Destination: apiv3.EntityRule{ Nets: []string{cidr1StrictMaskStr, cidr3StrictMaskStr, cidr2StrictMaskStr}, NotNets: []string{cidr3StrictMaskStr, cidr4StrictMaskStr, cidr1StrictMaskStr}, Selector: "kingindanorth == ''", }, }
var V3InRule2 = apiv3.Rule{ Action: apiv3.Deny, IPVersion: &ipv6, Protocol: &numProtocol1, ICMP: &v3icmp1, Source: apiv3.EntityRule{ Nets: []string{cidrv61Str}, Selector: "(has(label2)) && tag2 == ''", }, }
Functions ¶
func ConvertNodeName ¶
Convert the v1 node name to a standard v3 name. This uses the standard name normalization but does not add a qualifier. Any overlapping names will result in a failed upgrade, so the pre-upgrade validation script will check for conflicting names.
Types ¶
type BGPPeer ¶
type BGPPeer struct{}
BGPPeer implements the Converter interface.
func (BGPPeer) APIV1ToBackendV1 ¶
APIV1ToBackendV1 converts v1 BGPPeer API to v1 BGPPeer KVPair.
type HostEndpoint ¶
type HostEndpoint struct{}
HostEndpoint implements the Converter interface.
func (HostEndpoint) APIV1ToBackendV1 ¶
func (_ HostEndpoint) APIV1ToBackendV1(a unversioned.Resource) (*model.KVPair, error)
APIV1ToBackendV1 converts an APIv1 HostEndpoint structure to a KVPair containing a backend HostEndpoint and HostEndpointKey. This is part of the converter interface.
func (HostEndpoint) BackendV1ToAPIV3 ¶
func (_ HostEndpoint) BackendV1ToAPIV3(d *model.KVPair) (Resource, error)
BackendV1ToAPIV3 converts a KVPair containing a backend HostEndpoint and HostEndpointKey to an APIv3 HostEndpoint structure. This is part of the Converter interface.
type IPPool ¶
type IPPool struct{}
IPPool implements the Converter interface.
func (IPPool) APIV1ToBackendV1 ¶
APIV1ToBackendV1 converts v1 IPPool API to v1 IPPool KVPair.
type Node ¶
type Node struct{}
func (Node) APIV1ToBackendV1 ¶
convertAPIToKVPair converts an API Node structure to a KVPair containing a backend Node and NodeKey. This is part of the conversionHelper interface.
func (Node) BackendV1ToAPIV3 ¶
convertKVPairToAPI converts a KVPair containing a backend Node and NodeKey to an API Node structure. The Node.Spec.BGP.IPv4IPIPTunnelAddr field will need to be populated still since it comes from another resource. This is part of the conversionHelper interface.
type Policy ¶
type Policy struct{}
Policy implements the Converter interface.
func (Policy) APIV1ToBackendV1 ¶
APIV1ToBackendV1 converts v1 Policy API to v1 Policy KVPair.
type Profile ¶
type Profile struct{}
Profile implements the Converter interface.
func (Profile) APIV1ToBackendV1 ¶
APIV1ToBackendV1 converts v1 Profile API to v1 Profile KVPair.
type Resource ¶
type Resource interface { runtime.Object v1.ObjectMetaAccessor }
Resource is implemented by all Calico resources.
type Tier ¶
type Tier struct{}
Tier implements the Converter interface.
func (Tier) APIV1ToBackendV1 ¶
APIV1ToBackendV1 converts v1 Tier API to v1 Tier KVPair.
type WorkloadEndpoint ¶
type WorkloadEndpoint struct{}
func (WorkloadEndpoint) APIV1ToBackendV1 ¶
func (_ WorkloadEndpoint) APIV1ToBackendV1(rIn unversioned.Resource) (*model.KVPair, error)
APIV1ToBackendV1 converts v1 WorkloadEndpoint API to v1 WorkloadEndpoint KVPair.
func (WorkloadEndpoint) BackendV1ToAPIV3 ¶
func (_ WorkloadEndpoint) BackendV1ToAPIV3(kvp *model.KVPair) (Resource, error)
BackendV1ToAPIV3 converts v1 WorkloadEndpoint KVPair to v3 API.