Documentation ¶
Overview ¶
Copyright 2022 Matrix Origin
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Matrix Origin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package fake is a generated GoMock package.
Copyright 2022 Matrix Origin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func NewContext[T client.Object](obj T, c client.Client, emitter recon.EventEmitter) *recon.Context[T]
- func ReadyPod(meta metav1.ObjectMeta) *corev1.Pod
- func UnreadyPod(meta metav1.ObjectMeta) *corev1.Pod
- 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 client.ObjectKey, 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) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type MockCreateFn
- type MockDeleteAllOfFn
- type MockDeleteFn
- type MockEventEmitter
- func (m *MockEventEmitter) EXPECT() *MockEventEmitterMockRecorder
- func (m *MockEventEmitter) EmitEventGeneric(eventReason, msg string, err error)
- func (m *MockEventEmitter) EmitEventOnCreate(createObj client.Object, err error)
- func (m *MockEventEmitter) EmitEventOnDelete(deleteObj client.Object, err error)
- func (m *MockEventEmitter) EmitEventOnGetError(getObj client.Object, err error)
- func (m *MockEventEmitter) EmitEventOnList(listObj client.ObjectList, err error)
- func (m *MockEventEmitter) EmitEventOnPatch(patchObj client.Object, err error)
- func (m *MockEventEmitter) EmitEventOnUpdate(updateObj client.Object, err error)
- func (m *MockEventEmitter) EmitEventRollingDeployWait(k8sObj client.Object)
- type MockEventEmitterMockRecorder
- func (mr *MockEventEmitterMockRecorder) EmitEventGeneric(eventReason, msg, err interface{}) *gomock.Call
- func (mr *MockEventEmitterMockRecorder) EmitEventOnCreate(createObj, err interface{}) *gomock.Call
- func (mr *MockEventEmitterMockRecorder) EmitEventOnDelete(deleteObj, err interface{}) *gomock.Call
- func (mr *MockEventEmitterMockRecorder) EmitEventOnGetError(getObj, err interface{}) *gomock.Call
- func (mr *MockEventEmitterMockRecorder) EmitEventOnList(listObj, err interface{}) *gomock.Call
- func (mr *MockEventEmitterMockRecorder) EmitEventOnPatch(patchObj, err interface{}) *gomock.Call
- func (mr *MockEventEmitterMockRecorder) EmitEventOnUpdate(updateObj, err interface{}) *gomock.Call
- func (mr *MockEventEmitterMockRecorder) EmitEventRollingDeployWait(k8sObj interface{}) *gomock.Call
- type MockGenericEventEmitter
- type MockGenericEventEmitterMockRecorder
- type MockGetFn
- type MockK8sEventEmitter
- func (m *MockK8sEventEmitter) EXPECT() *MockK8sEventEmitterMockRecorder
- func (m *MockK8sEventEmitter) EmitEventOnCreate(createObj client.Object, err error)
- func (m *MockK8sEventEmitter) EmitEventOnDelete(deleteObj client.Object, err error)
- func (m *MockK8sEventEmitter) EmitEventOnGetError(getObj client.Object, err error)
- func (m *MockK8sEventEmitter) EmitEventOnList(listObj client.ObjectList, err error)
- func (m *MockK8sEventEmitter) EmitEventOnPatch(patchObj client.Object, err error)
- func (m *MockK8sEventEmitter) EmitEventOnUpdate(updateObj client.Object, err error)
- func (m *MockK8sEventEmitter) EmitEventRollingDeployWait(k8sObj client.Object)
- type MockK8sEventEmitterMockRecorder
- func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnCreate(createObj, err interface{}) *gomock.Call
- func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnDelete(deleteObj, err interface{}) *gomock.Call
- func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnGetError(getObj, err interface{}) *gomock.Call
- func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnList(listObj, err interface{}) *gomock.Call
- func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnPatch(patchObj, err interface{}) *gomock.Call
- func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnUpdate(updateObj, err interface{}) *gomock.Call
- func (mr *MockK8sEventEmitterMockRecorder) EmitEventRollingDeployWait(k8sObj interface{}) *gomock.Call
- type MockListFn
- type MockPatchFn
- type MockStatusPatchFn
- type MockStatusUpdateFn
- type MockUpdateFn
- type ObjectFn
Constants ¶
This section is empty.
Variables ¶
var KubeClientBuilder = kubefake.NewClientBuilder
Functions ¶
func NewContext ¶
func UnreadyPod ¶
func UnreadyPod(meta metav1.ObjectMeta) *corev1.Pod
Types ¶
type Client ¶
type Client struct { Client client.Client MockGet MockGetFn MockList MockListFn MockCreate MockCreateFn MockDelete MockDeleteFn MockDeleteAllOf MockDeleteAllOfFn MockUpdate MockUpdateFn MockPatch MockPatchFn }
Client proxy the real client.Client and enables us to mock individual funcs when necessary
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
type MockCreateFn ¶
func NewMockCreateFn ¶
func NewMockCreateFn(err error, ofn ...ObjectFn) MockCreateFn
type MockDeleteAllOfFn ¶
type MockDeleteAllOfFn func(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error
func NewMockDeleteAllOfFn ¶
func NewMockDeleteAllOfFn(err error, ofn ...ObjectFn) MockDeleteAllOfFn
type MockDeleteFn ¶
func NewMockDeleteFn ¶
func NewMockDeleteFn(err error, ofn ...ObjectFn) MockDeleteFn
type MockEventEmitter ¶
type MockEventEmitter struct {
// contains filtered or unexported fields
}
MockEventEmitter is a mock of EventEmitter interface.
func NewMockEventEmitter ¶
func NewMockEventEmitter(ctrl *gomock.Controller) *MockEventEmitter
NewMockEventEmitter creates a new mock instance.
func (*MockEventEmitter) EXPECT ¶
func (m *MockEventEmitter) EXPECT() *MockEventEmitterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockEventEmitter) EmitEventGeneric ¶
func (m *MockEventEmitter) EmitEventGeneric(eventReason, msg string, err error)
EmitEventGeneric mocks base method.
func (*MockEventEmitter) EmitEventOnCreate ¶
func (m *MockEventEmitter) EmitEventOnCreate(createObj client.Object, err error)
EmitEventOnCreate mocks base method.
func (*MockEventEmitter) EmitEventOnDelete ¶
func (m *MockEventEmitter) EmitEventOnDelete(deleteObj client.Object, err error)
EmitEventOnDelete mocks base method.
func (*MockEventEmitter) EmitEventOnGetError ¶
func (m *MockEventEmitter) EmitEventOnGetError(getObj client.Object, err error)
EmitEventOnGetError mocks base method.
func (*MockEventEmitter) EmitEventOnList ¶
func (m *MockEventEmitter) EmitEventOnList(listObj client.ObjectList, err error)
EmitEventOnList mocks base method.
func (*MockEventEmitter) EmitEventOnPatch ¶
func (m *MockEventEmitter) EmitEventOnPatch(patchObj client.Object, err error)
EmitEventOnPatch mocks base method.
func (*MockEventEmitter) EmitEventOnUpdate ¶
func (m *MockEventEmitter) EmitEventOnUpdate(updateObj client.Object, err error)
EmitEventOnUpdate mocks base method.
func (*MockEventEmitter) EmitEventRollingDeployWait ¶
func (m *MockEventEmitter) EmitEventRollingDeployWait(k8sObj client.Object)
EmitEventRollingDeployWait mocks base method.
type MockEventEmitterMockRecorder ¶
type MockEventEmitterMockRecorder struct {
// contains filtered or unexported fields
}
MockEventEmitterMockRecorder is the mock recorder for MockEventEmitter.
func (*MockEventEmitterMockRecorder) EmitEventGeneric ¶
func (mr *MockEventEmitterMockRecorder) EmitEventGeneric(eventReason, msg, err interface{}) *gomock.Call
EmitEventGeneric indicates an expected call of EmitEventGeneric.
func (*MockEventEmitterMockRecorder) EmitEventOnCreate ¶
func (mr *MockEventEmitterMockRecorder) EmitEventOnCreate(createObj, err interface{}) *gomock.Call
EmitEventOnCreate indicates an expected call of EmitEventOnCreate.
func (*MockEventEmitterMockRecorder) EmitEventOnDelete ¶
func (mr *MockEventEmitterMockRecorder) EmitEventOnDelete(deleteObj, err interface{}) *gomock.Call
EmitEventOnDelete indicates an expected call of EmitEventOnDelete.
func (*MockEventEmitterMockRecorder) EmitEventOnGetError ¶
func (mr *MockEventEmitterMockRecorder) EmitEventOnGetError(getObj, err interface{}) *gomock.Call
EmitEventOnGetError indicates an expected call of EmitEventOnGetError.
func (*MockEventEmitterMockRecorder) EmitEventOnList ¶
func (mr *MockEventEmitterMockRecorder) EmitEventOnList(listObj, err interface{}) *gomock.Call
EmitEventOnList indicates an expected call of EmitEventOnList.
func (*MockEventEmitterMockRecorder) EmitEventOnPatch ¶
func (mr *MockEventEmitterMockRecorder) EmitEventOnPatch(patchObj, err interface{}) *gomock.Call
EmitEventOnPatch indicates an expected call of EmitEventOnPatch.
func (*MockEventEmitterMockRecorder) EmitEventOnUpdate ¶
func (mr *MockEventEmitterMockRecorder) EmitEventOnUpdate(updateObj, err interface{}) *gomock.Call
EmitEventOnUpdate indicates an expected call of EmitEventOnUpdate.
func (*MockEventEmitterMockRecorder) EmitEventRollingDeployWait ¶
func (mr *MockEventEmitterMockRecorder) EmitEventRollingDeployWait(k8sObj interface{}) *gomock.Call
EmitEventRollingDeployWait indicates an expected call of EmitEventRollingDeployWait.
type MockGenericEventEmitter ¶
type MockGenericEventEmitter struct {
// contains filtered or unexported fields
}
MockGenericEventEmitter is a mock of GenericEventEmitter interface.
func NewMockGenericEventEmitter ¶
func NewMockGenericEventEmitter(ctrl *gomock.Controller) *MockGenericEventEmitter
NewMockGenericEventEmitter creates a new mock instance.
func (*MockGenericEventEmitter) EXPECT ¶
func (m *MockGenericEventEmitter) EXPECT() *MockGenericEventEmitterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockGenericEventEmitter) EmitEventGeneric ¶
func (m *MockGenericEventEmitter) EmitEventGeneric(eventReason, msg string, err error)
EmitEventGeneric mocks base method.
type MockGenericEventEmitterMockRecorder ¶
type MockGenericEventEmitterMockRecorder struct {
// contains filtered or unexported fields
}
MockGenericEventEmitterMockRecorder is the mock recorder for MockGenericEventEmitter.
func (*MockGenericEventEmitterMockRecorder) EmitEventGeneric ¶
func (mr *MockGenericEventEmitterMockRecorder) EmitEventGeneric(eventReason, msg, err interface{}) *gomock.Call
EmitEventGeneric indicates an expected call of EmitEventGeneric.
type MockGetFn ¶
func NewMockGetFn ¶
type MockK8sEventEmitter ¶
type MockK8sEventEmitter struct {
// contains filtered or unexported fields
}
MockK8sEventEmitter is a mock of K8sEventEmitter interface.
func NewMockK8sEventEmitter ¶
func NewMockK8sEventEmitter(ctrl *gomock.Controller) *MockK8sEventEmitter
NewMockK8sEventEmitter creates a new mock instance.
func (*MockK8sEventEmitter) EXPECT ¶
func (m *MockK8sEventEmitter) EXPECT() *MockK8sEventEmitterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockK8sEventEmitter) EmitEventOnCreate ¶
func (m *MockK8sEventEmitter) EmitEventOnCreate(createObj client.Object, err error)
EmitEventOnCreate mocks base method.
func (*MockK8sEventEmitter) EmitEventOnDelete ¶
func (m *MockK8sEventEmitter) EmitEventOnDelete(deleteObj client.Object, err error)
EmitEventOnDelete mocks base method.
func (*MockK8sEventEmitter) EmitEventOnGetError ¶
func (m *MockK8sEventEmitter) EmitEventOnGetError(getObj client.Object, err error)
EmitEventOnGetError mocks base method.
func (*MockK8sEventEmitter) EmitEventOnList ¶
func (m *MockK8sEventEmitter) EmitEventOnList(listObj client.ObjectList, err error)
EmitEventOnList mocks base method.
func (*MockK8sEventEmitter) EmitEventOnPatch ¶
func (m *MockK8sEventEmitter) EmitEventOnPatch(patchObj client.Object, err error)
EmitEventOnPatch mocks base method.
func (*MockK8sEventEmitter) EmitEventOnUpdate ¶
func (m *MockK8sEventEmitter) EmitEventOnUpdate(updateObj client.Object, err error)
EmitEventOnUpdate mocks base method.
func (*MockK8sEventEmitter) EmitEventRollingDeployWait ¶
func (m *MockK8sEventEmitter) EmitEventRollingDeployWait(k8sObj client.Object)
EmitEventRollingDeployWait mocks base method.
type MockK8sEventEmitterMockRecorder ¶
type MockK8sEventEmitterMockRecorder struct {
// contains filtered or unexported fields
}
MockK8sEventEmitterMockRecorder is the mock recorder for MockK8sEventEmitter.
func (*MockK8sEventEmitterMockRecorder) EmitEventOnCreate ¶
func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnCreate(createObj, err interface{}) *gomock.Call
EmitEventOnCreate indicates an expected call of EmitEventOnCreate.
func (*MockK8sEventEmitterMockRecorder) EmitEventOnDelete ¶
func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnDelete(deleteObj, err interface{}) *gomock.Call
EmitEventOnDelete indicates an expected call of EmitEventOnDelete.
func (*MockK8sEventEmitterMockRecorder) EmitEventOnGetError ¶
func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnGetError(getObj, err interface{}) *gomock.Call
EmitEventOnGetError indicates an expected call of EmitEventOnGetError.
func (*MockK8sEventEmitterMockRecorder) EmitEventOnList ¶
func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnList(listObj, err interface{}) *gomock.Call
EmitEventOnList indicates an expected call of EmitEventOnList.
func (*MockK8sEventEmitterMockRecorder) EmitEventOnPatch ¶
func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnPatch(patchObj, err interface{}) *gomock.Call
EmitEventOnPatch indicates an expected call of EmitEventOnPatch.
func (*MockK8sEventEmitterMockRecorder) EmitEventOnUpdate ¶
func (mr *MockK8sEventEmitterMockRecorder) EmitEventOnUpdate(updateObj, err interface{}) *gomock.Call
EmitEventOnUpdate indicates an expected call of EmitEventOnUpdate.
func (*MockK8sEventEmitterMockRecorder) EmitEventRollingDeployWait ¶
func (mr *MockK8sEventEmitterMockRecorder) EmitEventRollingDeployWait(k8sObj interface{}) *gomock.Call
EmitEventRollingDeployWait indicates an expected call of EmitEventRollingDeployWait.
type MockListFn ¶
func NewMockListFn ¶
func NewMockListFn(err error, ofn ...ObjectFn) MockListFn
type MockPatchFn ¶
type MockPatchFn func(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error
func NewMockPatchFn ¶
func NewMockPatchFn(err error, ofn ...ObjectFn) MockPatchFn
type MockStatusPatchFn ¶
type MockStatusUpdateFn ¶
type MockUpdateFn ¶
func NewMockUpdateFn ¶
func NewMockUpdateFn(err error, ofn ...ObjectFn) MockUpdateFn