Documentation ¶
Index ¶
- Variables
- func AddPodConditionReady(pod *corev1.Pod)
- func CreateConfigMap(ctx context.Context, client client.Client, key types.NamespacedName, ...) error
- func CreateKubernetesService(ctx context.Context, client client.Client, key types.NamespacedName, ...) error
- func CreateNamespace(ctx context.Context, client client.Client, key types.NamespacedName, ...) error
- func CreatePod(ctx context.Context, client client.Client, key types.NamespacedName, ...) error
- func CreatePodDisruptionBudget(ctx context.Context, client client.Client, key types.NamespacedName, ...) error
- func DeleteNamespace(ctx context.Context, client client.Client, ns *corev1.Namespace) error
- func DeletePodDisruptionBudget(ctx context.Context, client client.Client, ...) error
- func GetPod(ctx context.Context, client client.Client, key types.NamespacedName, ...) error
- func IsValidMeshResource(value string) bool
- func NewConfigMap(namespace string, name string, data map[string]string) *corev1.ConfigMap
- func NewFakeCache(t *testing.T) *meshMocks.MockCacheMapClient
- func NewFakeK8sClient(scheme *runtime.Scheme) client.Client
- func NewFakeK8sClientSet() kubernetes.Interface
- func NewFakeMeshClient(t *testing.T) *meshMocks.MockServiceMeshClient
- func NewFakeResolver(t *testing.T) *meshMocks.MockResolver
- func NewKubernetesService(name string, namespace string) *corev1.Service
- func NewNamespace(name string, labels map[string]string) *corev1.Namespace
- func NewPodDisruptionBudget(name string, namespace string, minAvailable int32, target string) *policyv1beta1.PodDisruptionBudget
- func NewPodWithLabels(name string, namespace string, labels map[string]string) *corev1.Pod
- func NewPodWithServiceMeshProxy(name string, namespace string) *corev1.Pod
- func NewPodWithoutServiceMeshProxy(name string, namespace string) *corev1.Pod
- func NewTestEnvK8sClient(cfg *rest.Config, scheme *runtime.Scheme) client.Client
- func NewTestEnvK8sClientSet(cfg *rest.Config) kubernetes.Interface
- func SetupTestEnv(testEnv *envtest.Environment) *rest.Config
- func UpdateConfigMap(ctx context.Context, client client.Client, cm *corev1.ConfigMap) error
- func UpdateNamespace(ctx context.Context, client client.Client, ns *corev1.Namespace) error
- func UpdatePod(ctx context.Context, client client.Client, pod *corev1.Pod) error
- func UpdateProxyInjectionNamespaceLabel(ctx context.Context, client client.Client, ns *corev1.Namespace, value string) error
- func UpdateProxyInjectionPodLabel(ctx context.Context, client client.Client, pod *corev1.Pod, value string) error
- func UpdateVDBRefPodAnnotation(ctx context.Context, client client.Client, pod *corev1.Pod, value string) error
- type K8sAPIs
Constants ¶
This section is empty.
Variables ¶
View Source
var Resources = []commons.MeshResources{ commons.Mesh, commons.VirtualService, commons.VirtualServiceRouteTable, commons.VirtualDeployment, commons.VirtualDeploymentBinding, commons.IngressGateway, commons.IngressGatewayRouteTable, commons.IngressGatewayDeployment, commons.AccessPolicy, }
Functions ¶
func AddPodConditionReady ¶
func CreateConfigMap ¶
func CreateKubernetesService ¶
func CreateNamespace ¶
func CreatePodDisruptionBudget ¶
func CreatePodDisruptionBudget(ctx context.Context, client client.Client, key types.NamespacedName, pdb *policyv1beta1.PodDisruptionBudget) error
func DeleteNamespace ¶
func DeletePodDisruptionBudget ¶
func DeletePodDisruptionBudget(ctx context.Context, client client.Client, pdb *policyv1beta1.PodDisruptionBudget) error
func IsValidMeshResource ¶
func NewConfigMap ¶
func NewFakeCache ¶
func NewFakeCache(t *testing.T) *meshMocks.MockCacheMapClient
func NewFakeK8sClientSet ¶
func NewFakeK8sClientSet() kubernetes.Interface
func NewFakeMeshClient ¶
func NewFakeMeshClient(t *testing.T) *meshMocks.MockServiceMeshClient
func NewFakeResolver ¶
func NewFakeResolver(t *testing.T) *meshMocks.MockResolver
func NewKubernetesService ¶
func NewPodDisruptionBudget ¶
func NewPodDisruptionBudget(name string, namespace string, minAvailable int32, target string) *policyv1beta1.PodDisruptionBudget
func NewPodWithLabels ¶
func NewTestEnvK8sClient ¶
func NewTestEnvK8sClientSet ¶
func NewTestEnvK8sClientSet(cfg *rest.Config) kubernetes.Interface
func SetupTestEnv ¶
func SetupTestEnv(testEnv *envtest.Environment) *rest.Config
func UpdateConfigMap ¶
func UpdateNamespace ¶
Types ¶
type K8sAPIs ¶
type K8sAPIs interface { Get(ctx context.Context, key types.NamespacedName, obj client.Object) error Create(ctx context.Context, obj client.Object) error Update(ctx context.Context, oldObj client.Object, newObj client.Object) error Delete(ctx context.Context, obj client.Object) error WaitUntilDeleted(ctx context.Context, obj client.Object) error }
K8sAPIs supports common k8s operations for each kind of resource. It will be added to the test framework to facilitate tests.
func NewDefaultK8sAPIs ¶
Click to show internal directories.
Click to hide internal directories.