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

testutils

package
v1.42.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KubeControllersUserSecret = corev1.Secret{
	TypeMeta: metav1.TypeMeta{
		Kind:       "Secret",
		APIVersion: "v1",
	},
	ObjectMeta: metav1.ObjectMeta{
		Name:      "tigera-ee-kube-controllers-elasticsearch-access",
		Namespace: common.OperatorNamespace(),
	},
	Data: map[string][]byte{
		"username": []byte("password"),
		"password": []byte("password"),
	},
}

Functions

func GetCalicoSystemGlobalPolicyFromResources added in v1.42.0

func GetCalicoSystemGlobalPolicyFromResources(name string, resources []client.Object) *v3.GlobalNetworkPolicy

func GetCalicoSystemPolicyFromResources added in v1.42.0

func GetCalicoSystemPolicyFromResources(name types.NamespacedName, resources []client.Object) *v3.NetworkPolicy

func GetExpectedGlobalPolicyFromFile added in v1.30.0

func GetExpectedGlobalPolicyFromFile(name string) *v3.GlobalNetworkPolicy

func GetExpectedPolicyFromFile added in v1.28.0

func GetExpectedPolicyFromFile(name string) *v3.NetworkPolicy

func GetExpectedPolicyFromFileWithReplacements added in v1.38.11

func GetExpectedPolicyFromFileWithReplacements(name string, replacements map[string]string) *v3.NetworkPolicy

func SelectPolicyByClusterTypeAndProvider added in v1.28.0

func SelectPolicyByClusterTypeAndProvider(scenario CalicoSystemScenario, policies map[string]*v3.NetworkPolicy) *v3.NetworkPolicy

SelectPolicyByClusterTypeAndProvider selects a variant of a policy that varies depending on cluster and provider type.

func SelectPolicyByProvider added in v1.28.0

func SelectPolicyByProvider(scenario CalicoSystemScenario, noProviderPolicy *v3.NetworkPolicy, openshiftProviderPolicy *v3.NetworkPolicy) *v3.NetworkPolicy

SelectPolicyByProvider simply selects a variant of a policy that varies depending on provider type only.

Types

type CalicoSystemScenario added in v1.42.0

type CalicoSystemScenario struct {
	ManagedCluster    bool
	ManagementCluster bool
	OpenShift         bool
	DPIEnabled        bool
}

CalicoSystemScenario represents valid render cases for calico-system policies. Render components should test that their calico-system policies correctly adapt for each relevant potential case. Update if new scenarios arise.

type IPMode added in v1.30.0

type IPMode string
const (
	IPV4      IPMode = "IPV4"
	IPV6      IPMode = "IPV6"
	DualStack IPMode = "Dual-stack"
)

Jump to

Keyboard shortcuts

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