Documentation
¶
Index ¶
- func ContainsType(resources []resource.KubernetesResource, t reflect.Type) bool
- func EventExists(c client.Client, reason string) bool
- type FakeClient
- func (c *FakeClient) ClearMockError()
- func (c *FakeClient) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
- func (c *FakeClient) Delete(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error
- func (c *FakeClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error
- func (c *FakeClient) Get(ctx context.Context, key client.ObjectKey, obj runtime.Object) error
- func (c *FakeClient) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error
- func (c *FakeClient) OpenAPISchema() (*openapi_v2.Document, error)
- func (c *FakeClient) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, ...) error
- func (c FakeClient) RESTClient() rest.Interface
- func (c *FakeClient) Scheme() *runtime.Scheme
- func (c *FakeClient) ServerGroups() (*metav1.APIGroupList, error)
- func (c *FakeClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)
- func (c *FakeClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)
- func (c *FakeClient) ServerPreferredResources() ([]*metav1.APIResourceList, error)
- func (c *FakeClient) ServerResources() ([]*metav1.APIResourceList, error)deprecated
- func (c *FakeClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
- func (c *FakeClient) ServerVersion() (*version.Info, error)
- func (c *FakeClient) SetMockError(err error)
- func (c *FakeClient) SetMockErrorForOneRequest(err error)
- func (c FakeClient) Status() client.StatusWriter
- func (c *FakeClient) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
- type FakeClientBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsType ¶ added in v0.3.0
func ContainsType(resources []resource.KubernetesResource, t reflect.Type) bool
Types ¶
type FakeClient ¶ added in v0.3.0
type FakeClient struct {
// contains filtered or unexported fields
}
FakeClient wraps an API fake client to allow mocked error responses Useful for covering errors other than NotFound It also wraps a fake discovery client FakeClient implements both client.Client and discovery.DiscoveryInterface
func (*FakeClient) ClearMockError ¶ added in v0.3.0
func (c *FakeClient) ClearMockError()
ClearMockError unsets any mock errors previously set
func (*FakeClient) Create ¶ added in v0.3.0
func (c *FakeClient) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
func (*FakeClient) Delete ¶ added in v0.3.0
func (c *FakeClient) Delete(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error
func (*FakeClient) DeleteAllOf ¶ added in v0.3.0
func (c *FakeClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error
func (*FakeClient) List ¶ added in v0.3.0
func (c *FakeClient) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error
func (*FakeClient) OpenAPISchema ¶ added in v0.3.0
func (c *FakeClient) OpenAPISchema() (*openapi_v2.Document, error)
func (*FakeClient) Patch ¶ added in v0.3.0
func (c *FakeClient) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error
func (FakeClient) RESTClient ¶ added in v0.3.0
func (c FakeClient) RESTClient() rest.Interface
func (*FakeClient) Scheme ¶ added in v0.3.0
func (c *FakeClient) Scheme() *runtime.Scheme
Scheme returns the fake client's scheme
func (*FakeClient) ServerGroups ¶ added in v0.3.0
func (c *FakeClient) ServerGroups() (*metav1.APIGroupList, error)
func (*FakeClient) ServerGroupsAndResources ¶ added in v0.3.0
func (c *FakeClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)
func (*FakeClient) ServerPreferredNamespacedResources ¶ added in v0.3.0
func (c *FakeClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)
func (*FakeClient) ServerPreferredResources ¶ added in v0.3.0
func (c *FakeClient) ServerPreferredResources() ([]*metav1.APIResourceList, error)
func (*FakeClient) ServerResources
deprecated
added in
v0.3.0
func (c *FakeClient) ServerResources() ([]*metav1.APIResourceList, error)
Deprecated: use ServerGroupsAndResources instead.
func (*FakeClient) ServerResourcesForGroupVersion ¶ added in v0.3.0
func (c *FakeClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
func (*FakeClient) ServerVersion ¶ added in v0.3.0
func (c *FakeClient) ServerVersion() (*version.Info, error)
func (*FakeClient) SetMockError ¶ added in v0.3.0
func (c *FakeClient) SetMockError(err error)
SetMockError sets the error which should be returned for the following requests This error will continue to be served until cleared with c.ClearMockError()
func (*FakeClient) SetMockErrorForOneRequest ¶ added in v0.3.0
func (c *FakeClient) SetMockErrorForOneRequest(err error)
SetMockErrorForOneRequest sets the error which should be returned for the following request this error will be set to nil after the next request
func (FakeClient) Status ¶ added in v0.3.0
func (c FakeClient) Status() client.StatusWriter
func (*FakeClient) Update ¶ added in v0.3.0
func (c *FakeClient) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
type FakeClientBuilder ¶ added in v0.3.0
type FakeClientBuilder struct {
// contains filtered or unexported fields
}
FakeClientBuilder allows building a FakeClient according to the desired cluster capabilities
func NewFakeClientBuilder ¶ added in v0.3.0
func NewFakeClientBuilder(initObjs ...runtime.Object) *FakeClientBuilder
NewFakeClientBuilder will create a new fake client that is aware of minimal resource types and stores initObjs for initialization later
func (*FakeClientBuilder) Build ¶ added in v0.3.0
func (b *FakeClientBuilder) Build() *FakeClient
Build returns the fake discovery client
func (*FakeClientBuilder) OnOpenshift ¶ added in v0.3.0
func (b *FakeClientBuilder) OnOpenshift() *FakeClientBuilder
OnOpenshift makes the fake client aware of resources from Openshift
func (*FakeClientBuilder) WithIngress ¶ added in v0.3.0
func (b *FakeClientBuilder) WithIngress() *FakeClientBuilder
WithIngress makes the fake client aware of v1 Ingresses