Documentation
¶
Overview ¶
Package fake_cloud is a test-double implementation of cloudprovider Interface, TCPLoadBalancer and Instances. It is useful for testing.
Index ¶
- Constants
- type FakeBalancer
- type FakeCloud
- func (f *FakeCloud) AddSSHKeyToAllInstances(user string, keyData []byte) error
- func (f *FakeCloud) ClearCalls()
- func (f *FakeCloud) Clusters() (cloudprovider.Clusters, bool)
- func (f *FakeCloud) CreateRoute(route *cloudprovider.Route) error
- func (f *FakeCloud) CreateTCPLoadBalancer(name, region string, externalIP net.IP, ports []*api.ServicePort, ...) (*api.LoadBalancerStatus, error)
- func (f *FakeCloud) DeleteRoute(name string) error
- func (f *FakeCloud) EnsureTCPLoadBalancerDeleted(name, region string) error
- func (f *FakeCloud) ExternalID(instance string) (string, error)
- func (f *FakeCloud) GetNodeResources(name string) (*api.NodeResources, error)
- func (f *FakeCloud) GetTCPLoadBalancer(name, region string) (*api.LoadBalancerStatus, bool, error)
- func (f *FakeCloud) GetZone() (cloudprovider.Zone, error)
- func (f *FakeCloud) InstanceID(instance string) (string, error)
- func (f *FakeCloud) Instances() (cloudprovider.Instances, bool)
- func (f *FakeCloud) List(filter string) ([]string, error)
- func (f *FakeCloud) ListClusters() ([]string, error)
- func (f *FakeCloud) ListRoutes(filter string) ([]*cloudprovider.Route, error)
- func (f *FakeCloud) Master(name string) (string, error)
- func (f *FakeCloud) NodeAddresses(instance string) ([]api.NodeAddress, error)
- func (f *FakeCloud) ProviderName() string
- func (f *FakeCloud) Routes() (cloudprovider.Routes, bool)
- func (f *FakeCloud) TCPLoadBalancer() (cloudprovider.TCPLoadBalancer, bool)
- func (f *FakeCloud) UpdateTCPLoadBalancer(name, region string, hosts []string) error
- func (f *FakeCloud) Zones() (cloudprovider.Zones, bool)
- type FakeUpdateBalancerCall
Constants ¶
const ProviderName = "fake"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeBalancer ¶ added in v0.13.0
type FakeBalancer struct { Name string Region string ExternalIP net.IP Ports []*api.ServicePort Hosts []string }
FakeBalancer is a fake storage of balancer information
type FakeCloud ¶
type FakeCloud struct { Exists bool Err error Calls []string Addresses []api.NodeAddress ExtID map[string]string Machines []string NodeResources *api.NodeResources ClusterList []string MasterName string ExternalIP net.IP Balancers []FakeBalancer UpdateCalls []FakeUpdateBalancerCall RouteMap map[string]*cloudprovider.Route Lock sync.Mutex cloudprovider.Zone }
FakeCloud is a test-double implementation of Interface, TCPLoadBalancer, Instances, and Routes. It is useful for testing.
func (*FakeCloud) AddSSHKeyToAllInstances ¶ added in v0.19.0
func (*FakeCloud) ClearCalls ¶
func (f *FakeCloud) ClearCalls()
ClearCalls clears internal record of method calls to this FakeCloud.
func (*FakeCloud) Clusters ¶ added in v0.5.1
func (f *FakeCloud) Clusters() (cloudprovider.Clusters, bool)
func (*FakeCloud) CreateRoute ¶ added in v0.18.2
func (f *FakeCloud) CreateRoute(route *cloudprovider.Route) error
func (*FakeCloud) CreateTCPLoadBalancer ¶
func (f *FakeCloud) CreateTCPLoadBalancer(name, region string, externalIP net.IP, ports []*api.ServicePort, hosts []string, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error)
CreateTCPLoadBalancer is a test-spy implementation of TCPLoadBalancer.CreateTCPLoadBalancer. It adds an entry "create" into the internal method call record.
func (*FakeCloud) DeleteRoute ¶ added in v0.18.2
func (*FakeCloud) EnsureTCPLoadBalancerDeleted ¶ added in v0.18.2
EnsureTCPLoadBalancerDeleted is a test-spy implementation of TCPLoadBalancer.EnsureTCPLoadBalancerDeleted. It adds an entry "delete" into the internal method call record.
func (*FakeCloud) ExternalID ¶ added in v0.12.0
ExternalID is a test-spy implementation of Instances.ExternalID. It adds an entry "external-id" into the internal method call record. It returns an external id to the mapped instance name, if not found, it will return "ext-{instance}"
func (*FakeCloud) GetNodeResources ¶
func (f *FakeCloud) GetNodeResources(name string) (*api.NodeResources, error)
func (*FakeCloud) GetTCPLoadBalancer ¶ added in v0.17.0
GetTCPLoadBalancer is a stub implementation of TCPLoadBalancer.GetTCPLoadBalancer.
func (*FakeCloud) InstanceID ¶ added in v0.18.2
InstanceID returns the cloud provider ID of the specified instance.
func (*FakeCloud) Instances ¶
func (f *FakeCloud) Instances() (cloudprovider.Instances, bool)
Instances returns a fake implementation of Instances.
Actually it just returns f itself.
func (*FakeCloud) List ¶
List is a test-spy implementation of Instances.List. It adds an entry "list" into the internal method call record.
func (*FakeCloud) ListClusters ¶ added in v0.5.1
func (*FakeCloud) ListRoutes ¶ added in v0.18.2
func (f *FakeCloud) ListRoutes(filter string) ([]*cloudprovider.Route, error)
func (*FakeCloud) NodeAddresses ¶ added in v0.13.1
func (f *FakeCloud) NodeAddresses(instance string) ([]api.NodeAddress, error)
NodeAddresses is a test-spy implementation of Instances.NodeAddresses. It adds an entry "node-addresses" into the internal method call record.
func (*FakeCloud) ProviderName ¶ added in v0.18.2
ProviderName returns the cloud provider ID.
func (*FakeCloud) Routes ¶ added in v0.18.2
func (f *FakeCloud) Routes() (cloudprovider.Routes, bool)
func (*FakeCloud) TCPLoadBalancer ¶
func (f *FakeCloud) TCPLoadBalancer() (cloudprovider.TCPLoadBalancer, bool)
TCPLoadBalancer returns a fake implementation of TCPLoadBalancer. Actually it just returns f itself.
func (*FakeCloud) UpdateTCPLoadBalancer ¶
UpdateTCPLoadBalancer is a test-spy implementation of TCPLoadBalancer.UpdateTCPLoadBalancer. It adds an entry "update" into the internal method call record.