Documentation ¶
Index ¶
- func ConfigMaps(names ...string) runtime.Object
- func MakeConfigMap(name string) *v1.ConfigMap
- func MakeDaemonSet(name string) *extbeta1.DaemonSet
- func MakeDependency(parent, child string, label ...string) *client.Dependency
- func MakeDeployment(name string) *extbeta1.Deployment
- func MakeFlow(name string) *client.ResourceDefinition
- func MakeFlowParameter(defaultValue string) client.FlowParameter
- func MakeJob(name string) *batchapiv1.Job
- func MakePersistentVolumeClaim(name string) *v1.PersistentVolumeClaim
- func MakePetSet(name string) *appsalpha1.PetSet
- func MakePod(name string) *v1.Pod
- func MakeReplicaSet(name string) *extbeta1.ReplicaSet
- func MakeResourceDefinition(name string) *client.ResourceDefinition
- func MakeSecret(name string) *v1.Secret
- func MakeService(name string) *v1.Service
- func MakeServiceAccount(name string) *v1.ServiceAccount
- func MakeStatefulSet(name string) *appsbeta1.StatefulSet
- func NewClient(objects ...runtime.Object) client.Interface
- func NewClient1_4(objects ...runtime.Object) client.Interface
- func NewClientWithFake(objects ...runtime.Object) (client.Interface, *testing.Fake)
- func ServiceAccounts(names ...string) runtime.Object
- type CounterWithMemo
- type CountingResource
- func (c *CountingResource) Create() error
- func (c *CountingResource) Delete() error
- func (c CountingResource) Key() string
- func (c *CountingResource) Meta(string) interface{}
- func (c *CountingResource) NameMatches(_ client.ResourceDefinition, _ string) bool
- func (c *CountingResource) New(_ client.ResourceDefinition, _ client.Interface) interfaces.BaseResource
- func (c *CountingResource) NewExisting(name string, _ client.Interface) interfaces.BaseResource
- func (c *CountingResource) Status(meta map[string]string) (interfaces.ResourceStatus, error)
- type Resource
- func (c *Resource) Create() error
- func (c *Resource) Delete() error
- func (c Resource) Key() string
- func (c *Resource) Meta(key string) interface{}
- func (c *Resource) NameMatches(_ client.ResourceDefinition, _ string) bool
- func (c *Resource) New(_ client.ResourceDefinition, _ client.Interface) interfaces.Resource
- func (c *Resource) NewExisting(name string, _ client.Interface) interfaces.BaseResource
- func (c *Resource) Status(meta map[string]string) (interfaces.ResourceStatus, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigMaps ¶
ConfigMaps generates sample ConfigMapList collection object
func MakeConfigMap ¶
MakeConfigMap generates sample ConfigMap object
func MakeDaemonSet ¶
MakeDaemonSet creates a daemonset base in its name
func MakeDependency ¶
func MakeDependency(parent, child string, label ...string) *client.Dependency
MakeDependency generates Dependency object
func MakeDeployment ¶
func MakeDeployment(name string) *extbeta1.Deployment
MakeDeployment creates mock Deployment
func MakeFlow ¶
func MakeFlow(name string) *client.ResourceDefinition
MakeFlow generates sample Flow resource definition
func MakeFlowParameter ¶
func MakeFlowParameter(defaultValue string) client.FlowParameter
MakeFlowParameter creates stample Flow parameter object
func MakePersistentVolumeClaim ¶
func MakePersistentVolumeClaim(name string) *v1.PersistentVolumeClaim
MakePersistentVolumeClaim creates a persistentVolumeClaim based on its name
func MakePetSet ¶
func MakePetSet(name string) *appsalpha1.PetSet
MakePetSet returns a new K8s PetSet object for the client to return. If it's name is "fail" it will have labels that will cause it's underlying mock Pods to fail.
func MakeReplicaSet ¶
func MakeReplicaSet(name string) *extbeta1.ReplicaSet
MakeReplicaSet generates sample ReplicaSet object
func MakeResourceDefinition ¶
func MakeResourceDefinition(name string) *client.ResourceDefinition
MakeResourceDefinition generates sample ResourceDefinition object
func MakeService ¶
MakeService creates a service based on its name
func MakeServiceAccount ¶
func MakeServiceAccount(name string) *v1.ServiceAccount
MakeServiceAccount generates sample ServiceAccount object
func MakeStatefulSet ¶
func MakeStatefulSet(name string) *appsbeta1.StatefulSet
MakeStatefulSet returns a new K8s StatefulSet object for the client to return. If it's name is "fail" it will have labels that will cause it's underlying mock Pods to fail.
func NewClient1_4 ¶
NewClient1_4 returns fake client for K8s 1.4.x
func NewClientWithFake ¶
NewClientWithFake returns new fake client and *testing.Fake object that can be used to catch client events
func ServiceAccounts ¶
ServiceAccounts generates sample ServiceAccountList collection object
Types ¶
type CounterWithMemo ¶
CounterWithMemo is a counter with atomic increment and decrememt and memoization of miminum and maximum values of the counter
func NewCounterWithMemo ¶
func NewCounterWithMemo() *CounterWithMemo
NewCounterWithMemo creates new instance of CounterWithMemo
func (*CounterWithMemo) Dec ¶
func (c *CounterWithMemo) Dec()
Dec atomically decrements the value of the counter
func (*CounterWithMemo) Inc ¶
func (c *CounterWithMemo) Inc()
Inc atomically increments the value of the counter
func (*CounterWithMemo) Max ¶
func (c *CounterWithMemo) Max() int
Max returns maximum value that counter reached
func (*CounterWithMemo) Min ¶
func (c *CounterWithMemo) Min() int
Min returns minimum value that counter reached
type CountingResource ¶
type CountingResource struct {
// contains filtered or unexported fields
}
CountingResource is a fake resource that becomes ready after given timeout. It also increases the counter when started and decreases it when becomes ready
func NewCountingResource ¶
func NewCountingResource(key string, counter *CounterWithMemo, timeout time.Duration) *CountingResource
NewCountingResource creates new instance of CountingResource
func (*CountingResource) Create ¶
func (c *CountingResource) Create() error
Create increments counter and sets creation time
func (CountingResource) Key ¶
func (c CountingResource) Key() string
Key returns a key of the CountingResource
func (*CountingResource) Meta ¶
func (c *CountingResource) Meta(string) interface{}
Meta returns empty string
func (*CountingResource) NameMatches ¶
func (c *CountingResource) NameMatches(_ client.ResourceDefinition, _ string) bool
NameMatches returns true
func (*CountingResource) New ¶
func (c *CountingResource) New(_ client.ResourceDefinition, _ client.Interface) interfaces.BaseResource
New returns new fake resource
func (*CountingResource) NewExisting ¶
func (c *CountingResource) NewExisting(name string, _ client.Interface) interfaces.BaseResource
NewExisting returns new existing resource
func (*CountingResource) Status ¶
func (c *CountingResource) Status(meta map[string]string) (interfaces.ResourceStatus, error)
Status returns a status of the CountingResource. It also updates the status after provided timeout and decrements counter
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource is a fake resource
func NewResource ¶
func NewResource(key string, status interfaces.ResourceStatus) *Resource
NewResource creates new instance of Resource
func NewResourceWithMeta ¶
func NewResourceWithMeta(key string, status interfaces.ResourceStatus, meta map[string]interface{}) *Resource
NewResourceWithMeta creates new instance of Resource
func (*Resource) NameMatches ¶
func (c *Resource) NameMatches(_ client.ResourceDefinition, _ string) bool
NameMatches returns true
func (*Resource) New ¶
func (c *Resource) New(_ client.ResourceDefinition, _ client.Interface) interfaces.Resource
New returns new fake resource
func (*Resource) NewExisting ¶
func (c *Resource) NewExisting(name string, _ client.Interface) interfaces.BaseResource
NewExisting returns new existing resource
func (*Resource) Status ¶
func (c *Resource) Status(meta map[string]string) (interfaces.ResourceStatus, error)
Status returns a status of the Resource
Source Files ¶
- client.go
- configmaps.go
- counterwithmemo.go
- countingresource.go
- daemonsets.go
- dependencies.go
- deployment.go
- fake_dependencies.go
- fake_replicas.go
- fake_resdefs.go
- flows.go
- jobs.go
- persistentvolumeclaims.go
- petsets.go
- pods.go
- replicasets.go
- resdefs.go
- resource.go
- secrets.go
- serviceaccounts.go
- services.go
- statefulsets.go