k8s

package
v1.7.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>

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

https://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 (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>

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

https://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 (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>

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

https://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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultManagerMock

func NewDefaultManagerMock() manager.Manager

NewDefaultManagerMock returns default empty mock object.

Types

type ClientMock

type ClientMock struct {
	client.Client

	StatusFunc      func() client.SubResourceWriter
	GetFunc         func(context.Context, client.ObjectKey, client.Object, ...client.GetOption) error
	CreateFunc      func(context.Context, client.Object, ...client.CreateOption) error
	DeleteFunc      func(context.Context, client.Object, ...client.DeleteOption) error
	DeleteAllOfFunc func(context.Context, client.Object, ...client.DeleteAllOfOption) error
}

func (*ClientMock) Create

func (cm *ClientMock) Create(
	ctx context.Context, obj client.Object, opts ...client.CreateOption,
) error

func (*ClientMock) Delete

func (cm *ClientMock) Delete(
	ctx context.Context, obj client.Object, opts ...client.DeleteOption,
) error

func (*ClientMock) DeleteAllOf

func (cm *ClientMock) DeleteAllOf(
	ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption,
) error

func (*ClientMock) Get

func (cm *ClientMock) Get(
	ctx context.Context, objKey client.ObjectKey, obj client.Object, opts ...client.GetOption,
) error

func (*ClientMock) Status

func (cm *ClientMock) Status() client.SubResourceWriter

type ControllerMock

type ControllerMock struct {
	StartFunc      func(ctx context.Context) (<-chan error, error)
	GetManagerFunc func() k8s.Manager
}

func (*ControllerMock) GetManager

func (m *ControllerMock) GetManager() k8s.Manager

func (*ControllerMock) Start

func (m *ControllerMock) Start(ctx context.Context) (<-chan error, error)

type ManagerMock

type ManagerMock struct {
	manager.Manager

	GetClientFunc func() client.Client
}

func (*ManagerMock) GetClient

func (mm *ManagerMock) GetClient() client.Client

type PatcherMock added in v1.7.13

type PatcherMock struct {
	mock.Mock
}

func (*PatcherMock) ApplyPodAnnotations added in v1.7.13

func (m *PatcherMock) ApplyPodAnnotations(
	ctx context.Context, name, namespace string, entries map[string]string,
) error

type SubResourceWriterMock

type SubResourceWriterMock struct {
	client.SubResourceWriter

	UpdateFunc func(context.Context, client.Object, ...client.SubResourceUpdateOption) error
}

func (*SubResourceWriterMock) Update

type ValdK8sClientMock added in v1.7.12

type ValdK8sClientMock struct {
	mock.Mock
}

func (*ValdK8sClientMock) Create added in v1.7.12

func (m *ValdK8sClientMock) Create(
	ctx context.Context, obj k8s.Object, opts ...k8s.CreateOption,
) error

func (*ValdK8sClientMock) Delete added in v1.7.12

func (m *ValdK8sClientMock) Delete(
	ctx context.Context, obj k8s.Object, opts ...crclient.DeleteOption,
) error

func (*ValdK8sClientMock) Get added in v1.7.12

func (m *ValdK8sClientMock) Get(
	ctx context.Context, name, namespace string, obj k8s.Object, opts ...crclient.GetOption,
) error

func (*ValdK8sClientMock) LabelSelector added in v1.7.12

func (m *ValdK8sClientMock) LabelSelector(
	key string, op selection.Operator, vals []string,
) (labels.Selector, error)

func (*ValdK8sClientMock) List added in v1.7.12

func (m *ValdK8sClientMock) List(
	ctx context.Context, list crclient.ObjectList, opts ...k8s.ListOption,
) error

func (*ValdK8sClientMock) MatchingLabels added in v1.7.13

func (m *ValdK8sClientMock) MatchingLabels(labels map[string]string) k8s.MatchingLabels

func (*ValdK8sClientMock) Patch added in v1.7.12

func (m *ValdK8sClientMock) Patch(
	ctx context.Context, obj k8s.Object, patch crclient.Patch, opts ...crclient.PatchOption,
) error

func (*ValdK8sClientMock) Update added in v1.7.12

func (m *ValdK8sClientMock) Update(
	ctx context.Context, obj k8s.Object, opts ...crclient.UpdateOption,
) error

func (*ValdK8sClientMock) Watch added in v1.7.12

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL