Documentation ¶
Index ¶
- Variables
- func AssertConditionsMatch(t *testing.T, condsA []metav1.Condition, condsB []metav1.Condition)
- func IsApiMockEnabled() bool
- func IsWebhookServerEnabled() bool
- func NewAddonWithInstallSpec(installSpec addonsv1alpha1.AddonInstallSpec, addonName string) *addonsv1alpha1.Addon
- func NewLogger(t *testing.T) logr.Logger
- func NewStatusError(msg string) *k8sApiErrors.StatusError
- func NewTestAddonWithAdditionalCatalogSources() *addonsv1alpha1.Addon
- func NewTestAddonWithCatalogSourceImage() *addonsv1alpha1.Addon
- func NewTestAddonWithMonitoringFederation() *addonsv1alpha1.Addon
- func NewTestAddonWithMonitoringStack() *addonsv1alpha1.Addon
- func NewTestAddonWithMultipleNamespaces() *addonsv1alpha1.Addon
- func NewTestAddonWithSingleNamespace() *addonsv1alpha1.Addon
- func NewTestAddonWithoutNamespace() *addonsv1alpha1.Addon
- func NewTestCatalogSource() *operatorsv1alpha1.CatalogSource
- func NewTestCatalogSourceWithoutOwner() *operatorsv1alpha1.CatalogSource
- func NewTestErrNotFound() *k8sApiErrors.StatusError
- func NewTestExistingNamespace() *corev1.Namespace
- func NewTestNamespace() *corev1.Namespace
- func NewTestNamespaceWithoutOwner() *corev1.Namespace
- func NewTestOperatorGroup() *operatorsv1.OperatorGroup
- func NewTestOperatorGroupWithoutOwner() *operatorsv1.OperatorGroup
- func NewTestSchemeWithAddonsv1alpha1() *runtime.Scheme
- func NewTestSchemeWithAddonsv1alpha1AndMsov1alpha1() *runtime.Scheme
- func NewTestSubscription() *operatorsv1alpha1.Subscription
- func NewTestSubscriptionWithoutOwner() *operatorsv1alpha1.Subscription
- type Client
- func (c *Client) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (c *Client) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (c *Client) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (c *Client) Get(ctx context.Context, key types.NamespacedName, obj client.Object, ...) error
- func (c *Client) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (c *Client) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (c *Client) RESTMapper() meta.RESTMapper
- func (c *Client) Scheme() *runtime.Scheme
- func (c *Client) Status() client.StatusWriter
- func (c *Client) SubResource(name string) client.SubResourceClient
- func (c *Client) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type Logger
- func (l *Logger) Enabled(level int) bool
- func (l *Logger) Error(err error, msg string, kvs ...interface{})
- func (l *Logger) Info(level int, msg string, kvs ...interface{})
- func (l *Logger) Init(info logr.RuntimeInfo)
- func (l *Logger) WithName(name string) logr.LogSink
- func (l *Logger) WithValues(kvs ...interface{}) logr.LogSink
- type StatusClient
- func (c *StatusClient) Create(ctx context.Context, obj client.Object, obj2 client.Object, ...) error
- func (c *StatusClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (c *StatusClient) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type Summary
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // core IsCoreV1NamespacePtr = mock.IsType(&corev1.Namespace{}) IsCoreV1NamespaceListPtr = mock.IsType(&corev1.NamespaceList{}) IsConfigMapPtr = mock.IsType(&corev1.ConfigMap{}) // networking IsNetworkingV1NetworkPolicyPtr = mock.IsType(&networkingv1.NetworkPolicy{}) // olm IsOperatorsV1OperatorGroupPtr = mock.IsType(&operatorsv1.OperatorGroup{}) IsOperatorsV1Alpha1CatalogSourcePtr = mock.IsType(&operatorsv1alpha1.CatalogSource{}) IsOperatorsV1Alpha1SubscriptionPtr = mock.IsType(&operatorsv1alpha1.Subscription{}) IsOperatorsV1OperatorPtr = mock.IsType(&operatorsv1.Operator{}) // prom IsMonitoringV1ServiceMonitorPtr = mock.IsType(&monitoringv1.ServiceMonitor{}) // addon.managed.openshift.io/v1alpha1 IsAddonsv1alpha1AddonPtr = mock.IsType(&addonsv1alpha1.Addon{}) IsAddonsv1alpha1AddonListPtr = mock.IsType(&addonsv1alpha1.AddonList{}) IsAddonsv1alpha1AddonOperatorPtr = mock.IsType(&addonsv1alpha1.AddonOperator{}) IsAddonsv1alpha1AddonOperatorListPtr = mock.IsType(&addonsv1alpha1.AddonOperatorList{}) // misc IsContext = mock.IsType(context.TODO()) IsObjectKey = mock.IsType(client.ObjectKey{}) )
custom testify/mock matchers
Functions ¶
func AssertConditionsMatch ¶ added in v1.5.4
func IsApiMockEnabled ¶ added in v0.7.0
func IsApiMockEnabled() bool
func IsWebhookServerEnabled ¶ added in v0.3.0
func IsWebhookServerEnabled() bool
func NewAddonWithInstallSpec ¶ added in v0.3.0
func NewAddonWithInstallSpec(installSpec addonsv1alpha1.AddonInstallSpec, addonName string) *addonsv1alpha1.Addon
NewAddonWithInstallSpec returns an Addon object with the specified InstallSpec
func NewStatusError ¶ added in v0.3.0
func NewStatusError(msg string) *k8sApiErrors.StatusError
NewStatusError returns an error of type `StatusError `
func NewTestAddonWithAdditionalCatalogSources ¶ added in v1.4.0
func NewTestAddonWithAdditionalCatalogSources() *addonsv1alpha1.Addon
func NewTestAddonWithCatalogSourceImage ¶ added in v0.5.0
func NewTestAddonWithCatalogSourceImage() *addonsv1alpha1.Addon
func NewTestAddonWithMonitoringFederation ¶ added in v1.4.1
func NewTestAddonWithMonitoringFederation() *addonsv1alpha1.Addon
func NewTestAddonWithMonitoringStack ¶ added in v1.7.1
func NewTestAddonWithMonitoringStack() *addonsv1alpha1.Addon
func NewTestAddonWithMultipleNamespaces ¶ added in v0.5.0
func NewTestAddonWithMultipleNamespaces() *addonsv1alpha1.Addon
func NewTestAddonWithSingleNamespace ¶ added in v0.5.0
func NewTestAddonWithSingleNamespace() *addonsv1alpha1.Addon
func NewTestAddonWithoutNamespace ¶ added in v0.5.0
func NewTestAddonWithoutNamespace() *addonsv1alpha1.Addon
func NewTestCatalogSource ¶ added in v0.5.0
func NewTestCatalogSource() *operatorsv1alpha1.CatalogSource
func NewTestCatalogSourceWithoutOwner ¶ added in v0.5.0
func NewTestCatalogSourceWithoutOwner() *operatorsv1alpha1.CatalogSource
func NewTestErrNotFound ¶ added in v0.5.0
func NewTestErrNotFound() *k8sApiErrors.StatusError
func NewTestExistingNamespace ¶ added in v0.7.0
func NewTestNamespace ¶ added in v0.5.0
func NewTestNamespaceWithoutOwner ¶ added in v0.7.0
func NewTestOperatorGroup ¶ added in v0.7.0
func NewTestOperatorGroup() *operatorsv1.OperatorGroup
func NewTestOperatorGroupWithoutOwner ¶ added in v0.7.0
func NewTestOperatorGroupWithoutOwner() *operatorsv1.OperatorGroup
func NewTestSchemeWithAddonsv1alpha1 ¶ added in v0.5.0
func NewTestSchemeWithAddonsv1alpha1AndMsov1alpha1 ¶ added in v1.7.1
func NewTestSubscription ¶ added in v0.7.0
func NewTestSubscription() *operatorsv1alpha1.Subscription
func NewTestSubscriptionWithoutOwner ¶ added in v0.7.0
func NewTestSubscriptionWithoutOwner() *operatorsv1alpha1.Subscription
Types ¶
type Client ¶
type Client struct { mock.Mock StatusMock *StatusClient }
Client is a mock for the controller-runtime dynamic client interface.
func (*Client) DeleteAllOf ¶
func (*Client) List ¶
func (c *Client) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*Client) RESTMapper ¶
func (c *Client) RESTMapper() meta.RESTMapper
func (*Client) Status ¶
func (c *Client) Status() client.StatusWriter
func (*Client) SubResource ¶ added in v1.8.2
func (c *Client) SubResource(name string) client.SubResourceClient
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements logr.Logger and logs to testing.T to preserve the order of log lines in tests.
func (*Logger) Init ¶ added in v0.7.0
func (l *Logger) Init(info logr.RuntimeInfo)
Init implements logr.LogSink.Init
func (*Logger) WithValues ¶
WithValues implements logr.LogSink.WithValues
type StatusClient ¶
func (*StatusClient) Create ¶ added in v1.8.2
func (c *StatusClient) Create(ctx context.Context, obj client.Object, obj2 client.Object, opts ...client.SubResourceCreateOption) error
func (*StatusClient) Patch ¶
func (c *StatusClient) Patch( ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error
func (*StatusClient) Update ¶
func (c *StatusClient) Update( ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type Summary ¶ added in v0.7.0
Summary is a mock object for `prometheus.Summary`
func NewSummaryMock ¶ added in v0.7.0
func NewSummaryMock() *Summary
func (*Summary) Collect ¶ added in v0.7.0
func (s *Summary) Collect(m chan<- prometheus.Metric)
implement `prometheus.Collector` interface
func (*Summary) Desc ¶ added in v0.7.0
func (s *Summary) Desc() *prometheus.Desc
implement `prometheus.Metric` interface
func (*Summary) Describe ¶ added in v0.7.0
func (s *Summary) Describe(c chan<- *prometheus.Desc)
implement `prometheus.Collector` interface
Click to show internal directories.
Click to hide internal directories.