Help us shape the future of Go! Take the 2026 Go Developer Survey

kubernetes

package
v1.17.18 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvVarCRDDirectory = "DAPR_INTEGRATION_CRD_DIRECTORY"
)

Variables

This section is empty.

Functions

func DaprPod added in v1.17.18

func DaprPod(ns, name, appID, config string) corev1.Pod

DaprPod returns a pod as the injector leaves it for appID, assigned the given dapr.io/config annotation value.

Types

type Kubernetes

type Kubernetes struct {
	// contains filtered or unexported fields
}

Kubernetes is a mock Kubernetes API server process.

func New

func New(t *testing.T, fopts ...Option) *Kubernetes

func (*Kubernetes) Cleanup

func (k *Kubernetes) Cleanup(t *testing.T)

func (*Kubernetes) Informer added in v1.13.0

func (k *Kubernetes) Informer() *informer.Informer

func (*Kubernetes) KubeconfigPath added in v1.13.0

func (k *Kubernetes) KubeconfigPath(t *testing.T) string

func (*Kubernetes) Port

func (k *Kubernetes) Port() int

func (*Kubernetes) Run

func (k *Kubernetes) Run(t *testing.T, ctx context.Context)

type Option

type Option func(*options)

Option is a function that configures the mock Kubernetes process.

func WithBaseOperatorAPI added in v1.13.0

func WithBaseOperatorAPI(t *testing.T, td spiffeid.TrustDomain, ns string, sentryPort int) Option

func WithClusterDaprComponentList added in v1.13.0

func WithClusterDaprComponentList(t *testing.T, comps *compapi.ComponentList) Option

func WithClusterDaprComponentListFromStore added in v1.13.0

func WithClusterDaprComponentListFromStore(t *testing.T, store *store.Store) Option

func WithClusterDaprConfigurationList added in v1.13.0

func WithClusterDaprConfigurationList(t *testing.T, configs *configapi.ConfigurationList) Option

func WithClusterDaprHTTPEndpointList added in v1.13.0

func WithClusterDaprHTTPEndpointList(t *testing.T, endpoints *httpendapi.HTTPEndpointList) Option

func WithClusterDaprResiliencyList added in v1.13.0

func WithClusterDaprResiliencyList(t *testing.T, res *resapi.ResiliencyList) Option

func WithClusterDaprSubscriptionList added in v1.13.0

func WithClusterDaprSubscriptionList(t *testing.T, subs *subv1api.SubscriptionList) Option

func WithClusterDaprSubscriptionListFromStore added in v1.14.0

func WithClusterDaprSubscriptionListFromStore(t *testing.T, store *store.Store) Option

func WithClusterDaprSubscriptionListV2 added in v1.14.0

func WithClusterDaprSubscriptionListV2(t *testing.T, subs *subv2api.SubscriptionList) Option

func WithClusterDaprSubscriptionV2ListFromStore added in v1.14.0

func WithClusterDaprSubscriptionV2ListFromStore(t *testing.T, store *store.Store) Option

func WithClusterDeploymentList added in v1.13.0

func WithClusterDeploymentList(t *testing.T, deploys *appsv1.DeploymentList) Option

func WithClusterNamespaceList added in v1.15.0

func WithClusterNamespaceList(t *testing.T, namespaces *corev1.NamespaceList) Option

func WithClusterNamespaceListFromStore added in v1.15.0

func WithClusterNamespaceListFromStore(t *testing.T, store *store.Store) Option

func WithClusterPodList added in v1.13.0

func WithClusterPodList(t *testing.T, pods *corev1.PodList) Option

func WithClusterServiceAccountList added in v1.14.0

func WithClusterServiceAccountList(t *testing.T, services *corev1.ServiceAccountList) Option

func WithClusterServiceList added in v1.13.0

func WithClusterServiceList(t *testing.T, services *corev1.ServiceList) Option

func WithClusterStatefulSetList added in v1.13.0

func WithClusterStatefulSetList(t *testing.T, ss *appsv1.StatefulSetList) Option

func WithConfigMapGet

func WithConfigMapGet(t *testing.T, configmap *corev1.ConfigMap) Option

func WithDaprConfigurationGet

func WithDaprConfigurationGet(t *testing.T, config *configapi.Configuration) Option

func WithDaprPodList added in v1.17.18

func WithDaprPodList(t *testing.T, ns string, pods ...corev1.Pod) Option

WithDaprPodList serves the pods on the namespaced pod list path the operator reads to resolve an app's assigned configuration.

func WithDaprPods added in v1.17.18

func WithDaprPods(t *testing.T, ns string, appConfigs map[string]string) Option

WithDaprPods serves one DaprPod per app ID, named after the app ID and assigned the mapped configuration, so the operator authorizes each app's GetConfiguration.

func WithDaprResiliencyGet added in v1.13.0

func WithDaprResiliencyGet(t *testing.T, ns, name string, res *resapi.Resiliency) Option

func WithNamespacedPodList added in v1.17.18

func WithNamespacedPodList(t *testing.T, ns string, pods *corev1.PodList) Option

func WithNamespacedPodListSelector added in v1.17.18

func WithNamespacedPodListSelector(t *testing.T, ns, selector string, pods *corev1.PodList) Option

WithNamespacedPodListSelector serves pods on the namespaced pod list path and asserts every request uses the given label selector.

func WithPath

func WithPath(path string, handler http.HandlerFunc) Option

func WithSecretGet

func WithSecretGet(t *testing.T, secret *corev1.Secret) Option

func WithSecretList added in v1.13.6

func WithSecretList(t *testing.T, secrets *corev1.SecretList) Option

func WithStatefulSetGet added in v1.14.0

func WithStatefulSetGet(t *testing.T, statefulset *appsv1.StatefulSet) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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