Documentation ¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func CleanEtcd()
- func CleanIPPools(c *client.Client)
- func CreateNewIPPool(c client.Client, poolSubnet string, ipip, natOut, ipam bool)
- func CreateRule(ipv, icmpType, icmpCode int, ...) (api.Rule, api.Rule)
- func DumpEtcd()
- func E2eDatastoreDescribe(description string, datastores int, body func(config api.CalicoAPIConfig)) bool
- func HookLogrusForGinkgo()
- func MustParseCIDR(c string) net.IPNet
- func MustParseIP(i string) net.IP
- func MustParseNetwork(c string) net.IPNet
- func NewClient(cf string) (*client.Client, error)
Constants ¶
const ( DatastoreEtcdV2 = 1 << iota DatastoreK8s )
Variables ¶
var EgressRule1 = api.Rule{ Action: "pass", IPVersion: &ipv4, Protocol: &numProtocol1, ICMP: &icmp1, Source: api.EntityRule{ Tag: "tag3", Net: &cidr2, Selector: "all()", }, }
var EgressRule2 = api.Rule{ Action: "allow", IPVersion: &ipv6, Protocol: &strProtocol2, ICMP: &icmp1, Source: api.EntityRule{ Tag: "tag4", Net: &cidrv62, Selector: "label2 == '1234'", }, }
var InRule1 = api.Rule{ Action: "allow", IPVersion: &ipv4, Protocol: &strProtocol1, ICMP: &icmp1, Source: api.EntityRule{ Tag: "tag1", Net: &cidr1, Selector: "label1 == 'value1'", }, }
var InRule2 = api.Rule{ Action: "deny", IPVersion: &ipv6, Protocol: &numProtocol1, ICMP: &icmp1, Source: api.EntityRule{ Tag: "tag2", Net: &cidrv61, Selector: "has(label2)", }, }
Functions ¶
func CleanEtcd ¶
func CleanEtcd()
CleanEtcd is a utility function to wipe clean "/calico" recursively from etcd.
func CleanIPPools ¶ added in v1.1.1
CleanIPPools removes all IP pool configuration from the datastore.
func CreateNewIPPool ¶
CreateNewIPPool takes a client.Client with a poolSubnet CIDR (in "192.168.1.0/24" format) with ipip, natOut, and ipam bools for the pool to be setup and creates a new pool.
func CreateRule ¶
func CreateRule(ipv, icmpType, icmpCode int, proto, cidrStr, tag, selector, inAction, eAction string) (api.Rule, api.Rule)
CreateRule takes all fields necessary to create a api.Rule object and returns ingress and egress api.Rules.
func E2eDatastoreDescribe ¶ added in v1.1.1
func E2eDatastoreDescribe(description string, datastores int, body func(config api.CalicoAPIConfig)) bool
E2eDatastoreDescribe is a replacement for ginkgo.Describe which invokes Describe multiple times for one or more different datastore drivers - passing in the Calico API configuration as a parameter to the test function. This allows easy construction of end-to-end tests covering multiple different datastore drivers.
The *datastores* parameter is a bit-wise OR of the required datastore drivers that will be tested.
func HookLogrusForGinkgo ¶
func HookLogrusForGinkgo()
func MustParseCIDR ¶
MustParseCIDR parses the string into a net.IPNet. The IP address in the IPNet is not masked.
func MustParseIP ¶
func MustParseNetwork ¶ added in v1.1.1
MustParseNetwork parses the string into a net.IPNet. The IP address in the IPNet is masked.
Types ¶
This section is empty.