e2e

package
v0.0.0-...-9b5a78d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright 2020 IBM Corporation

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

Constants

This section is empty.

Variables

View Source
var (
	DefaultSignPolicyCRName = "sign-policy"
)

Functions

func ChangeKubeContextToDefaultUser

func ChangeKubeContextToDefaultUser(framework *Framework, namespace, expected string) error

func ChangeKubeContextToKubeAdmin

func ChangeKubeContextToKubeAdmin() error

func CheckConfigMap

func CheckConfigMap(framework *Framework, namespace, expected string) error

func CheckEventNoSignature

func CheckEventNoSignature(framework *Framework, namespace, expected string) error

func CheckIVResources

func CheckIVResources(framework *Framework, kind, namespace, expected string) error

func CheckPodStatus

func CheckPodStatus(framework *Framework, namespace, expected string) error

func GetPodCondition

func GetPodCondition(status *corev1.PodStatus, conditionType corev1.PodConditionType) (int, *corev1.PodCondition)

GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetPodName

func GetPodName(framework *Framework, namespace, expected string) string

func GetPodReadyCondition

func GetPodReadyCondition(status corev1.PodStatus) *corev1.PodCondition

GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.

func GetSecretName

func GetSecretName(framework *Framework, namespace, expected string) (string, error)

func IsPodReady

func IsPodReady(pod *corev1.Pod) bool

IsPodReady returns true if a pod is ready; false otherwise.

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status corev1.PodStatus) bool

IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.

func IsTargetPodReadyConditionTrue

func IsTargetPodReadyConditionTrue(pods *corev1.PodList, expected string) (found, ready bool)

func Kubectl

func Kubectl(args ...string) error

Kubectl executes kubectl commands

func KubectlOut

func KubectlOut(args ...string) (error, string)

func Load

func Load(data []byte) (*clientcmdapi.Config, error)

func LoadConfig

func LoadConfig(config, context string) (*rest.Config, error)

func LoadConfigMap

func LoadConfigMap(framework *Framework, namespace, expected string) (error, *corev1.ConfigMap)

func LoadFromFile

func LoadFromFile(filename string) (*clientcmdapi.Config, error)

func RestclientConfig

func RestclientConfig(config, context string) (*clientcmdapi.Config, error)

Types

type Framework

type Framework struct {
	BaseName string

	KubeConfig  string
	KubeContext string
	Kubectl     string

	// KubeClientConfig which was used to create the connection.
	KubeClientConfig *rest.Config

	// Kubernetes API clientsets
	KubeClientSet          kubernetes.Interface
	APIExtensionsClientSet apiextcs.Interface
	RSPClient              rspclient.ApisV1alpha1Interface
	SignPolicyClient       spclient.ApisV1alpha1Interface
	VerifierConfigClient   vcclient.ApisV1alpha1Interface

	// Namespace in which all test resources should reside
	Namespace *v1.Namespace
}

Jump to

Keyboard shortcuts

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