Documentation
¶
Index ¶
- type CalicoClientStub
- func (cc *CalicoClientStub) BGPConfigurations() clientv3.BGPConfigurationInterface
- func (cc *CalicoClientStub) BGPFilter() clientv3.BGPFilterInterface
- func (cc *CalicoClientStub) BGPPeers() clientv3.BGPPeerInterface
- func (cc *CalicoClientStub) BlockAffinities() clientv3.BlockAffinityInterface
- func (cc *CalicoClientStub) CalicoNodeStatus() clientv3.CalicoNodeStatusInterface
- func (cc *CalicoClientStub) ClusterInformation() clientv3.ClusterInformationInterface
- func (cc *CalicoClientStub) EnsureInitialized(ctx context.Context, calicoVersion, clusterType string) error
- func (cc *CalicoClientStub) FelixConfigurations() clientv3.FelixConfigurationInterface
- func (cc *CalicoClientStub) GlobalNetworkPolicies() clientv3.GlobalNetworkPolicyInterface
- func (cc *CalicoClientStub) GlobalNetworkSets() clientv3.GlobalNetworkSetInterface
- func (cc *CalicoClientStub) HostEndpoints() clientv3.HostEndpointInterface
- func (cc *CalicoClientStub) IPAM() ipam.Interface
- func (cc *CalicoClientStub) IPAMConfig() clientv3.IPAMConfigInterface
- func (cc *CalicoClientStub) IPPools() clientv3.IPPoolInterface
- func (cc *CalicoClientStub) IPReservations() clientv3.IPReservationInterface
- func (cc *CalicoClientStub) KubeControllersConfiguration() clientv3.KubeControllersConfigurationInterface
- func (cc *CalicoClientStub) NetworkPolicies() clientv3.NetworkPolicyInterface
- func (cc *CalicoClientStub) NetworkSets() clientv3.NetworkSetInterface
- func (cc *CalicoClientStub) Nodes() clientv3.NodeInterface
- func (cc *CalicoClientStub) Profiles() clientv3.ProfileInterface
- func (cc *CalicoClientStub) Tiers() clientv3.TierInterface
- func (cc *CalicoClientStub) WorkloadEndpoints() clientv3.WorkloadEndpointInterface
- type IPPoolsStub
- func (pools *IPPoolsStub) Create(ctx context.Context, res *apiv3.IPPool, opts options.SetOptions) (*apiv3.IPPool, error)
- func (pools *IPPoolsStub) Delete(ctx context.Context, name string, opts options.DeleteOptions) (*apiv3.IPPool, error)
- func (pools *IPPoolsStub) Get(ctx context.Context, name string, opts options.GetOptions) (*apiv3.IPPool, error)
- func (pools *IPPoolsStub) List(ctx context.Context, opts options.ListOptions) (*apiv3.IPPoolList, error)
- func (pools *IPPoolsStub) UnsafeCreate(ctx context.Context, res *apiv3.IPPool, opts options.SetOptions) (*apiv3.IPPool, error)
- func (pools *IPPoolsStub) UnsafeDelete(ctx context.Context, name string, opts options.DeleteOptions) (*apiv3.IPPool, error)
- func (pools *IPPoolsStub) Update(ctx context.Context, res *apiv3.IPPool, opts options.SetOptions) (*apiv3.IPPool, error)
- func (pools *IPPoolsStub) Watch(ctx context.Context, opts options.ListOptions) (watch.Interface, error)
- type IpamInterfaceStub
- func (iis *IpamInterfaceStub) AssignIP(ctx context.Context, args ipam.AssignIPArgs) error
- func (iis *IpamInterfaceStub) AutoAssign(ctx context.Context, args ipam.AutoAssignArgs) (*ipam.IPAMAssignments, *ipam.IPAMAssignments, error)
- func (iis *IpamInterfaceStub) ClaimAffinity(ctx context.Context, cidr cnet.IPNet, host string) ([]cnet.IPNet, []cnet.IPNet, error)
- func (iis *IpamInterfaceStub) EnsureBlock(ctx context.Context, args ipam.BlockArgs) (*cnet.IPNet, *cnet.IPNet, error)
- func (iis *IpamInterfaceStub) GetAssignmentAttributes(ctx context.Context, addr cnet.IP) (map[string]string, *string, error)
- func (iis *IpamInterfaceStub) GetIPAMConfig(ctx context.Context) (*ipam.IPAMConfig, error)
- func (iis *IpamInterfaceStub) GetUtilization(ctx context.Context, args ipam.GetUtilizationArgs) ([]*ipam.PoolUtilization, error)
- func (iis *IpamInterfaceStub) IPsByHandle(ctx context.Context, handleID string) ([]cnet.IP, error)
- func (iis *IpamInterfaceStub) ReleaseAffinity(ctx context.Context, cidr cnet.IPNet, host string, mustBeEmpty bool) error
- func (iis *IpamInterfaceStub) ReleaseBlockAffinity(ctx context.Context, block *model.AllocationBlock, mustBeEmpty bool) error
- func (iis *IpamInterfaceStub) ReleaseByHandle(ctx context.Context, handleID string) error
- func (iis *IpamInterfaceStub) ReleaseHostAffinities(ctx context.Context, host string, mustBeEmpty bool) error
- func (iis *IpamInterfaceStub) ReleaseIPs(ctx context.Context, ips ...ipam.ReleaseOptions) ([]cnet.IP, error)
- func (iis *IpamInterfaceStub) ReleasePoolAffinities(ctx context.Context, pool cnet.IPNet) error
- func (iis *IpamInterfaceStub) RemoveIPAMHost(ctx context.Context, host string) error
- func (iis *IpamInterfaceStub) SetIPAMConfig(ctx context.Context, cfg ipam.IPAMConfig) error
- type NodesMock
- func (m *NodesMock) Create(ctx context.Context, res *libapiv3.Node, opts options.SetOptions) (*libapiv3.Node, error)
- func (m *NodesMock) Delete(ctx context.Context, name string, opts options.DeleteOptions) (*libapiv3.Node, error)
- func (m *NodesMock) Get(ctx context.Context, name string, opts options.GetOptions) (*libapiv3.Node, error)
- func (m *NodesMock) List(ctx context.Context, opts options.ListOptions) (*libapiv3.NodeList, error)
- func (m *NodesMock) Update(ctx context.Context, res *libapiv3.Node, opts options.SetOptions) (*libapiv3.Node, error)
- func (m *NodesMock) Watch(ctx context.Context, opts options.ListOptions) (watch.Interface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalicoClientStub ¶
type CalicoClientStub struct { IPPoolsStub *IPPoolsStub IPAMStub *IpamInterfaceStub NodesMock *NodesMock }
CalicoClientStub is stub implementation of clientv3.Interface. It is used for communication with other Calico parts.
func NewCalicoClientStub ¶
func NewCalicoClientStub() *CalicoClientStub
NewCalicoClientStub creates new CalicoClientStub instance
func (*CalicoClientStub) BGPConfigurations ¶
func (cc *CalicoClientStub) BGPConfigurations() clientv3.BGPConfigurationInterface
BGPConfigurations returns an interface for managing the BGP configuration resources.
func (*CalicoClientStub) BGPFilter ¶ added in v3.26.0
func (cc *CalicoClientStub) BGPFilter() clientv3.BGPFilterInterface
func (*CalicoClientStub) BGPPeers ¶
func (cc *CalicoClientStub) BGPPeers() clientv3.BGPPeerInterface
BGPPeers returns an interface for managing BGP peer resources.
func (*CalicoClientStub) BlockAffinities ¶ added in v3.25.1
func (cc *CalicoClientStub) BlockAffinities() clientv3.BlockAffinityInterface
BlockAffinities returns an interface for viewing IPAM block affinity resources.
func (*CalicoClientStub) CalicoNodeStatus ¶
func (cc *CalicoClientStub) CalicoNodeStatus() clientv3.CalicoNodeStatusInterface
CalicoNodeStatus returns an interface for managing CalicoNodeStatus resources.
func (*CalicoClientStub) ClusterInformation ¶
func (cc *CalicoClientStub) ClusterInformation() clientv3.ClusterInformationInterface
ClusterInformation returns an interface for managing the cluster information resource.
func (*CalicoClientStub) EnsureInitialized ¶
func (cc *CalicoClientStub) EnsureInitialized(ctx context.Context, calicoVersion, clusterType string) error
EnsureInitialized is used to ensure the backend datastore is correctly initialized for use by Calico. This method may be called multiple times, and will have no effect if the datastore is already correctly initialized. Most Calico deployment scenarios will automatically implicitly invoke this method and so a general consumer of this API can assume that the datastore is already initialized.
func (*CalicoClientStub) FelixConfigurations ¶
func (cc *CalicoClientStub) FelixConfigurations() clientv3.FelixConfigurationInterface
FelixConfigurations returns an interface for managing the Felix configuration resources.
func (*CalicoClientStub) GlobalNetworkPolicies ¶
func (cc *CalicoClientStub) GlobalNetworkPolicies() clientv3.GlobalNetworkPolicyInterface
GlobalNetworkPolicies returns an interface for managing global network policy resources.
func (*CalicoClientStub) GlobalNetworkSets ¶
func (cc *CalicoClientStub) GlobalNetworkSets() clientv3.GlobalNetworkSetInterface
GlobalNetworkSets returns an interface for managing global network sets resources.
func (*CalicoClientStub) HostEndpoints ¶
func (cc *CalicoClientStub) HostEndpoints() clientv3.HostEndpointInterface
HostEndpoints returns an interface for managing host endpoint resources.
func (*CalicoClientStub) IPAM ¶
func (cc *CalicoClientStub) IPAM() ipam.Interface
IPAM returns an interface for managing IP address assignment and releasing.
func (*CalicoClientStub) IPAMConfig ¶ added in v3.25.1
func (cc *CalicoClientStub) IPAMConfig() clientv3.IPAMConfigInterface
IPAMConfig returns an interface for managing IPAMConfig resources.
func (*CalicoClientStub) IPPools ¶
func (cc *CalicoClientStub) IPPools() clientv3.IPPoolInterface
IPPools returns an interface for managing IP pool resources.
func (*CalicoClientStub) IPReservations ¶
func (cc *CalicoClientStub) IPReservations() clientv3.IPReservationInterface
IPReservations returns an interface for managing IP reservation resources.
func (*CalicoClientStub) KubeControllersConfiguration ¶
func (cc *CalicoClientStub) KubeControllersConfiguration() clientv3.KubeControllersConfigurationInterface
KubeControllersConfiguration returns an interface for managing the KubeControllersConfiguration resource.
func (*CalicoClientStub) NetworkPolicies ¶
func (cc *CalicoClientStub) NetworkPolicies() clientv3.NetworkPolicyInterface
NetworkPolicies returns an interface for managing namespaced network policy resources.
func (*CalicoClientStub) NetworkSets ¶
func (cc *CalicoClientStub) NetworkSets() clientv3.NetworkSetInterface
NetworkSets returns an interface for managing network sets resources.
func (*CalicoClientStub) Nodes ¶
func (cc *CalicoClientStub) Nodes() clientv3.NodeInterface
Nodes returns an interface for managing node resources.
func (*CalicoClientStub) Profiles ¶
func (cc *CalicoClientStub) Profiles() clientv3.ProfileInterface
Profiles returns an interface for managing profile resources.
func (*CalicoClientStub) Tiers ¶ added in v3.29.0
func (cc *CalicoClientStub) Tiers() clientv3.TierInterface
func (*CalicoClientStub) WorkloadEndpoints ¶
func (cc *CalicoClientStub) WorkloadEndpoints() clientv3.WorkloadEndpointInterface
WorkloadEndpoints returns an interface for managing workload endpoint resources.
type IPPoolsStub ¶
type IPPoolsStub struct {
// contains filtered or unexported fields
}
IPPoolsStub is stub implementation of clientv3.IPPoolInterface. It is used for managing IPPool resources.
func NewIPPoolsStub ¶
func NewIPPoolsStub() *IPPoolsStub
NewIPPoolsStub creates new IPPoolsStub instance
func (*IPPoolsStub) Create ¶
func (pools *IPPoolsStub) Create(ctx context.Context, res *apiv3.IPPool, opts options.SetOptions) (*apiv3.IPPool, error)
func (*IPPoolsStub) Delete ¶
func (pools *IPPoolsStub) Delete(ctx context.Context, name string, opts options.DeleteOptions) (*apiv3.IPPool, error)
func (*IPPoolsStub) Get ¶
func (pools *IPPoolsStub) Get(ctx context.Context, name string, opts options.GetOptions) (*apiv3.IPPool, error)
func (*IPPoolsStub) List ¶
func (pools *IPPoolsStub) List(ctx context.Context, opts options.ListOptions) (*apiv3.IPPoolList, error)
func (*IPPoolsStub) UnsafeCreate ¶ added in v3.25.1
func (pools *IPPoolsStub) UnsafeCreate(ctx context.Context, res *apiv3.IPPool, opts options.SetOptions) (*apiv3.IPPool, error)
func (*IPPoolsStub) UnsafeDelete ¶ added in v3.25.1
func (pools *IPPoolsStub) UnsafeDelete(ctx context.Context, name string, opts options.DeleteOptions) (*apiv3.IPPool, error)
func (*IPPoolsStub) Update ¶
func (pools *IPPoolsStub) Update(ctx context.Context, res *apiv3.IPPool, opts options.SetOptions) (*apiv3.IPPool, error)
func (*IPPoolsStub) Watch ¶
func (pools *IPPoolsStub) Watch(ctx context.Context, opts options.ListOptions) (watch.Interface, error)
type IpamInterfaceStub ¶
type IpamInterfaceStub struct { // AssignedIPCounter holds the count of all assigned IP addresses. It is used in simplified assigning // of new IP addresses. AssignedIPCounter int }
IpamInterfaceStub is stub implementation of ipam.Interface. It is used for IP address management.
func NewIpamInterfaceStub ¶
func NewIpamInterfaceStub() *IpamInterfaceStub
NewIpamInterfaceStub creates new IpamInterfaceStub instance
func (*IpamInterfaceStub) AssignIP ¶
func (iis *IpamInterfaceStub) AssignIP(ctx context.Context, args ipam.AssignIPArgs) error
AssignIP assigns the provided IP address to the provided host. The IP address must fall within a configured pool. AssignIP will claim block affinity as needed in order to satisfy the assignment. An error will be returned if the IP address is already assigned, or if StrictAffinity is enabled and the address is within a block that does not have affinity for the given host.
func (*IpamInterfaceStub) AutoAssign ¶
func (iis *IpamInterfaceStub) AutoAssign(ctx context.Context, args ipam.AutoAssignArgs) (*ipam.IPAMAssignments, *ipam.IPAMAssignments, error)
AutoAssign automatically assigns one or more IP addresses as specified by the provided AutoAssignArgs. AutoAssign returns the list of the assigned IPv4 addresses, and the list of the assigned IPv6 addresses in IPNet format. The returned IPNet represents the allocation block from which the IP was allocated, which is useful for dataplanes that need to know the subnet (such as Windows).
In case of error, returns the IPs allocated so far along with the error.
func (*IpamInterfaceStub) ClaimAffinity ¶
func (iis *IpamInterfaceStub) ClaimAffinity(ctx context.Context, cidr cnet.IPNet, host string) ([]cnet.IPNet, []cnet.IPNet, error)
ClaimAffinity claims affinity to the given host for all blocks within the given CIDR. The given CIDR must fall within a configured pool. If an empty string is passed as the host, then the value returned by os.Hostname is used.
func (*IpamInterfaceStub) EnsureBlock ¶
func (iis *IpamInterfaceStub) EnsureBlock(ctx context.Context, args ipam.BlockArgs) (*cnet.IPNet, *cnet.IPNet, error)
EnsureBlock returns single IPv4/IPv6 IPAM block for a host as specified by the provided BlockArgs. If there is no block allocated already for this host, allocate one and return its' CIDR. Otherwise, return the CIDR of the IPAM block allocated for this host. It returns IPv4, IPv6 block CIDR and any error encountered.
func (*IpamInterfaceStub) GetAssignmentAttributes ¶
func (iis *IpamInterfaceStub) GetAssignmentAttributes(ctx context.Context, addr cnet.IP) (map[string]string, *string, error)
GetAssignmentAttributes returns the attributes stored with the given IP address upon assignment, as well as the handle used for assignment (if any).
func (*IpamInterfaceStub) GetIPAMConfig ¶
func (iis *IpamInterfaceStub) GetIPAMConfig(ctx context.Context) (*ipam.IPAMConfig, error)
GetIPAMConfig returns the global IPAM configuration. If no IPAM configuration has been set, returns a default configuration with StrictAffinity disabled and AutoAllocateBlocks enabled.
func (*IpamInterfaceStub) GetUtilization ¶
func (iis *IpamInterfaceStub) GetUtilization(ctx context.Context, args ipam.GetUtilizationArgs) ( []*ipam.PoolUtilization, error)
GetUtilization returns IP utilization info for the specified pools, or for all pools.
func (*IpamInterfaceStub) IPsByHandle ¶
IPsByHandle returns a list of all IP addresses that have been assigned using the provided handle.
func (*IpamInterfaceStub) ReleaseAffinity ¶
func (iis *IpamInterfaceStub) ReleaseAffinity(ctx context.Context, cidr cnet.IPNet, host string, mustBeEmpty bool) error
ReleaseAffinity releases affinity for all blocks within the given CIDR on the given host. If an empty string is passed as the host, then the value returned by os.Hostname will be used. If mustBeEmpty is true, then an error will be returned if any blocks within the CIDR are not empty - in this case, this function may release some but not all blocks within the given CIDR.
func (*IpamInterfaceStub) ReleaseBlockAffinity ¶
func (iis *IpamInterfaceStub) ReleaseBlockAffinity(ctx context.Context, block *model.AllocationBlock, mustBeEmpty bool) error
ReleaseBlockAffinity releases the affinity of the exact block provided.
func (*IpamInterfaceStub) ReleaseByHandle ¶
func (iis *IpamInterfaceStub) ReleaseByHandle(ctx context.Context, handleID string) error
ReleaseByHandle releases all IP addresses that have been assigned using the provided handle. Returns an error if no addresses are assigned with the given handle.
func (*IpamInterfaceStub) ReleaseHostAffinities ¶
func (iis *IpamInterfaceStub) ReleaseHostAffinities(ctx context.Context, host string, mustBeEmpty bool) error
ReleaseHostAffinities releases affinity for all blocks that are affine to the given host. If an empty string is passed as the host, the value returned by os.Hostname will be used. If mustBeEmpty is true, then an error will be returned if any blocks within the CIDR are not empty - in this case, this function may release some but not all blocks attached to this host.
func (*IpamInterfaceStub) ReleaseIPs ¶
func (iis *IpamInterfaceStub) ReleaseIPs(ctx context.Context, ips ...ipam.ReleaseOptions) ([]cnet.IP, error)
ReleaseIPs releases any of the given IP addresses that are currently assigned, so that they are available to be used in another assignment.
func (*IpamInterfaceStub) ReleasePoolAffinities ¶
ReleasePoolAffinities releases affinity for all blocks within the specified pool across all hosts.
func (*IpamInterfaceStub) RemoveIPAMHost ¶
func (iis *IpamInterfaceStub) RemoveIPAMHost(ctx context.Context, host string) error
RemoveIPAMHost releases affinity for all blocks on the given host, and removes all host-specific IPAM data from the datastore. RemoveIPAMHost does not release any IP addresses claimed on the given host. If an empty string is passed as the host then the value returned by os.Hostname is used.
func (*IpamInterfaceStub) SetIPAMConfig ¶
func (iis *IpamInterfaceStub) SetIPAMConfig(ctx context.Context, cfg ipam.IPAMConfig) error
SetIPAMConfig sets global IPAM configuration. This can only be done when there are no allocated blocks and IP addresses.
type NodesMock ¶
type NodesMock struct {
// contains filtered or unexported fields
}
NodesMock is mock implementation of clientv3.NodeInterface. It is used for managing Nodes resources.