Documentation ¶
Overview ¶
Package kubetest provides API for writing Kubernetes specific tests
Index ¶
- Constants
- func CollectXcons(ch <-chan *crossconnect.CrossConnectEvent, n int, timeout time.Duration) (map[string]*crossconnect.CrossConnect, error)
- func CreateAdmissionWebhookDeployment(k8s *K8s, name, image, namespace string) *appsv1.Deployment
- func CreateAdmissionWebhookSecret(k8s *K8s, name, namespace string) (*v1.Secret, tls.Certificate)
- func CreateAdmissionWebhookService(k8s *K8s, name, namespace string) *v1.Service
- func CreateCrossConnectMonitorDeployment(k8s *K8s, image string) *appsv1.Deployment
- func CreateCrossConnectMonitorService(k8s *K8s) *v1.Service
- func CreateMutatingWebhookConfiguration(k8s *K8s, c tls.Certificate, name, namespace string) *arv1beta1.MutatingWebhookConfiguration
- func CreatePrometheusClusterRoles(k8s *K8s) []nsmrbac.Role
- func CreatePrometheusConfigMap(k8s *K8s) *v1.ConfigMap
- func CreatePrometheusDeployment(k8s *K8s) *appsv1.Deployment
- func CreatePrometheusService(k8s *K8s) *v1.Service
- func CrossConnectClientAt(k8s *K8s, pod *v1.Pod) (<-chan *crossconnect.CrossConnectEvent, func())
- func DefaultForwarderVariables(plane string) map[string]string
- func DefaultPlaneVariablesKernel() map[string]string
- func DefaultPlaneVariablesVPP() map[string]string
- func DeleteAdmissionWebhook(k8s *K8s, secretName string, awc *arv1beta1.MutatingWebhookConfiguration, ...)
- func DeleteCrossConnectMonitor(k8s *K8s, depl *appsv1.Deployment, svc *v1.Service)
- func DeletePrometheus(k8s *K8s, roles []nsmrbac.Role, depl *appsv1.Deployment, svc *v1.Service)
- func DeployAdmissionWebhook(k8s *K8s, name, image, namespace string, timeout time.Duration) (*arv1beta1.MutatingWebhookConfiguration, *appsv1.Deployment, *v1.Service)
- func DeployCorefile(k8s *K8s, name, content string) error
- func DeployCrossConnectMonitor(k8s *K8s, image string) (*appsv1.Deployment, *v1.Service)
- func DeployDirtyICMP(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployICMP(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployICMPAndCoredns(k8s *K8s, node *v1.Node, name, corednsConfigName string, timeout time.Duration) *v1.Pod
- func DeployICMPWithConfig(k8s *K8s, node *v1.Node, name string, timeout time.Duration, gracePeriod int64) *v1.Pod
- func DeployMonitoringNSC(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployMonitoringNSCAndCoredns(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployNSC(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployNSCMonitor(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployNSCWebhook(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployNSCWithEnv(k8s *K8s, node *v1.Node, name string, timeout time.Duration, ...) *v1.Pod
- func DeployNSMRS(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployNSMRSWithConfig(k8s *K8s, node *v1.Node, name string, timeout time.Duration, ...) *v1.Pod
- func DeployNeighborNSE(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployNscAndNsmCoredns(k8s *K8s, node *v1.Node, name, corefileName string, timeout time.Duration) *v1.Pod
- func DeployPrometheus(k8s *K8s) ([]nsmrbac.Role, *appsv1.Deployment, *v1.Service)
- func DeployProxyNSMgr(k8s *K8s, node *v1.Node, name string, timeout time.Duration) (pnsmd *v1.Pod, err error)
- func DeployProxyNSMgrWithConfig(k8s *K8s, node *v1.Node, name string, timeout time.Duration, ...) (pnsmd *v1.Pod, err error)
- func DeployUpdatingNSE(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployVppAgentICMP(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func DeployVppAgentNSC(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
- func ExpectNSEsCountToBe(k8s *K8s, countWas, countExpected int)
- func ExpectNSMsCountToBe(k8s *K8s, countWas, countExpected int)
- func FindJaegerPod(k8s *K8s) *v1.Pod
- func GetJaegerTraces(k8s *K8s, jaegerPod *v1.Pod) map[string]string
- func GetNodeExternalIP(node *v1.Node) (string, error)
- func GetNodeInternalIP(node *v1.Node) (string, error)
- func GetVppAgentNSEAddr(k8s *K8s, nsc *v1.Pod) (net.IP, error)
- func InitSpireSecurity(k8s *K8s) func()
- func IsBrokeTestsEnabled() bool
- func IsNsePinged(k8s *K8s, from *v1.Pod) (result bool)
- func IsVppAgentNsePinged(k8s *K8s, from *v1.Pod) (result bool)
- func NSLookup(k8s *K8s, pod *v1.Pod, hostname string) bool
- func NewEventChecker(t *testing.T, actualCh <-chan *crossconnect.CrossConnectEvent) (expectedFunc func(EventChecker), waitFunc func())
- func NewJaegerTracesFinder(k8s *K8s) artifacts.Finder
- func NewK8sLogFinder(k8s *K8s) artifacts.Finder
- func NoHealNSMgrPodConfig(k8s *K8s) []*pods.NSMgrPodConfig
- func PingByHostName(k8s *K8s, pod *v1.Pod, hostname string) bool
- func PrepareRegistryClients(k8s *K8s, nsmd *v1.Pod) (registry.NetworkServiceRegistryClient, registry.NsmRegistryClient, func())
- func RunProxyNSMgrService(k8s *K8s) func()
- func ServiceRegistryAt(k8s *K8s, nsmgr *v1.Pod) (serviceregistry.ServiceRegistry, func())
- func UseIPv6() bool
- func WaitNSMgrDeployed(k8s *K8s, nsmd *v1.Pod, timeout time.Duration)
- func XconToString(xcon *crossconnect.CrossConnect) string
- type EventChecker
- type ExtK8s
- type K8s
- func NewK8s(g *WithT, prepare bool) (*K8s, error)
- func NewK8sForConfig(g *WithT, prepare bool, kubeconfig string) (*K8s, error)
- func NewK8sWithClientset(clientset kubernetes.Interface, namespace string) *K8s
- func NewK8sWithoutRoles(g *WithT, prepare bool) (*K8s, error)
- func NewK8sWithoutRolesForConfig(g *WithT, prepare bool, kubeconfigPath string) (*K8s, error)
- func (k8s *K8s) Cleanup()
- func (k8s *K8s) CleanupCRDs()
- func (k8s *K8s) CleanupConfigMaps()
- func (k8s *K8s) CleanupDeployments()
- func (k8s *K8s) CleanupEndpointsCRDs()
- func (k8s *K8s) CleanupMutatingWebhookConfigurations()
- func (k8s *K8s) CleanupSecrets(secrets ...string)
- func (k8s *K8s) CleanupServices(services ...string)
- func (k8s *K8s) CreateConfigMap(cm *v1.ConfigMap) (*v1.ConfigMap, error)
- func (k8s *K8s) CreateDeployment(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)
- func (k8s *K8s) CreateMutatingWebhookConfiguration(mutatingWebhookConf *arv1beta1.MutatingWebhookConfiguration) (*arv1beta1.MutatingWebhookConfiguration, error)
- func (k8s *K8s) CreatePod(template *v1.Pod) *v1.Pod
- func (k8s *K8s) CreatePods(templates ...*v1.Pod) []*v1.Pod
- func (k8s *K8s) CreatePodsRaw(timeout time.Duration, failTest bool, templates ...*v1.Pod) ([]*v1.Pod, error)
- func (k8s *K8s) CreateRoles(rolesList ...string) ([]nsmrbac.Role, error)
- func (k8s *K8s) CreateSecret(secret *v1.Secret, namespace string) (*v1.Secret, error)
- func (k8s *K8s) CreateService(service *v1.Service, namespace string) (*v1.Service, error)
- func (k8s *K8s) CreateServiceAccounts()
- func (k8s *K8s) CreateTestNamespace(namespace string) (string, error)
- func (k8s *K8s) DeleteDeployment(deployment *appsv1.Deployment, namespace string) error
- func (k8s *K8s) DeleteMutatingWebhookConfiguration(mutatingWebhookConf *arv1beta1.MutatingWebhookConfiguration) error
- func (k8s *K8s) DeleteNSEs(names ...string) error
- func (k8s *K8s) DeleteNetworkServices(names ...string) error
- func (k8s *K8s) DeletePods(pods ...*v1.Pod)
- func (k8s *K8s) DeletePodsByName(noPods ...string)
- func (k8s *K8s) DeletePodsForce(pods ...*v1.Pod)
- func (k8s *K8s) DeleteRoles(rolesList []nsmrbac.Role) ([]nsmrbac.Role, error)
- func (k8s *K8s) DeleteSecret(name, namespace string) error
- func (k8s *K8s) DeleteService(service *v1.Service, namespace string) error
- func (k8s *K8s) DeleteServiceAccounts() error
- func (k8s *K8s) DeleteTestNamespace(namespace string) error
- func (k8s *K8s) DescribePod(pod *v1.Pod)
- func (o *K8s) Exec(pod *v1.Pod, container string, command ...string) (string, string, error)
- func (k8s *K8s) GetClientSet() (kubernetes.Interface, error)
- func (k8s *K8s) GetConfig() *rest.Config
- func (k8s *K8s) GetForwardingPlane() string
- func (k8s *K8s) GetFullLogs(pod *v1.Pod, container string, previous bool) (string, error)
- func (k8s *K8s) GetK8sNamespace() string
- func (k8s *K8s) GetLogs(pod *v1.Pod, container string) (string, error)
- func (k8s *K8s) GetLogsChannel(ctx context.Context, pod *v1.Pod, options *v1.PodLogOptions) (chan string, chan error)
- func (k8s *K8s) GetLogsWithOptions(pod *v1.Pod, options *v1.PodLogOptions) (string, error)
- func (k8s *K8s) GetNSEs() ([]v1alpha1.NetworkServiceEndpoint, error)
- func (k8s *K8s) GetNSMList() ([]v1alpha1.NetworkServiceManager, error)
- func (k8s *K8s) GetNamespace(namespace string) (*v1.Namespace, error)
- func (k8s *K8s) GetNetworkServices() ([]v1alpha1.NetworkService, error)
- func (k8s *K8s) GetNodes() []v1.Node
- func (k8s *K8s) GetNodesWait(requiredNumber int, timeout time.Duration) []v1.Node
- func (k8s *K8s) GetPod(pod *v1.Pod) (*v1.Pod, error)
- func (k8s *K8s) GetPullingImagesDuration(pod *v1.Pod) time.Duration
- func (k8s *K8s) GetVersion() string
- func (k8s *K8s) IsNetworkProblem(pod *v1.Pod) error
- func (k8s *K8s) IsPodReady(pod *v1.Pod) bool
- func (k8s *K8s) ListPods() ([]v1.Pod, error)
- func (k8s *K8s) ListPodsByNs(ns string) []v1.Pod
- func (k8s *K8s) NewPortForwarder(pod *v1.Pod, port int) (*PortForward, error)
- func (k8s *K8s) PrintImageVersion(pod *v1.Pod)
- func (k8s *K8s) SaveArtifacts()
- func (k8s *K8s) SaveTestArtifacts(t *testing.T)
- func (k8s *K8s) SetForwardingPlane(plane string) error
- func (k8s *K8s) UpdatePod(pod *v1.Pod) *v1.Pod
- func (k8s *K8s) UseIPv6() bool
- func (k8s *K8s) WaitLogsContains(pod *v1.Pod, container, pattern string, timeout time.Duration)
- func (k8s *K8s) WaitLogsContainsRegex(pod *v1.Pod, container, pattern string, timeout time.Duration) error
- type MonitorClient
- type MultipleEventChecker
- type NSCCheckInfo
- type NodeConf
- type NscChecker
- type NsePinger
- type OrEventChecker
- type PodDeployResult
- type PodSupplier
- type PortForward
- type SingleEventChecker
- type TestingPodFixture
- type Writer
Constants ¶
const ( // PodStartTimeout - Default pod startup time PodStartTimeout = 3 * time.Minute //NetworkPluginCNIFailure - pattern to check for CNI issue, pattern required to try redeploy pod NetworkPluginCNIFailure = "NetworkPlugin cni failed to set up pod" )
Variables ¶
This section is empty.
Functions ¶
func CollectXcons ¶
func CollectXcons(ch <-chan *crossconnect.CrossConnectEvent, n int, timeout time.Duration) (map[string]*crossconnect.CrossConnect, error)
CollectXcons takes n crossconencts from event channel
func CreateAdmissionWebhookDeployment ¶
func CreateAdmissionWebhookDeployment(k8s *K8s, name, image, namespace string) *appsv1.Deployment
CreateAdmissionWebhookDeployment - Setup Admission Webhook deoloyment
func CreateAdmissionWebhookSecret ¶
CreateAdmissionWebhookSecret - Create admission webhook secret
func CreateAdmissionWebhookService ¶
CreateAdmissionWebhookService - Create Admission Webhook Service
func CreateCrossConnectMonitorDeployment ¶
func CreateCrossConnectMonitorDeployment(k8s *K8s, image string) *appsv1.Deployment
CreateCrossConnectMonitorDeployment creates crossconnect-monitor deployment
func CreateCrossConnectMonitorService ¶
CreateCrossConnectMonitorService creates crossconnect-monitor service
func CreateMutatingWebhookConfiguration ¶
func CreateMutatingWebhookConfiguration(k8s *K8s, c tls.Certificate, name, namespace string) *arv1beta1.MutatingWebhookConfiguration
CreateMutatingWebhookConfiguration - Setup Mutating webhook configuration
func CreatePrometheusClusterRoles ¶
CreatePrometheusClusterRoles creates prometheus roles
func CreatePrometheusConfigMap ¶
CreatePrometheusConfigMap creates prometheus configMap
func CreatePrometheusDeployment ¶
func CreatePrometheusDeployment(k8s *K8s) *appsv1.Deployment
CreatePrometheusDeployment creates prometheus deployment
func CreatePrometheusService ¶
CreatePrometheusService creates prometheus service
func CrossConnectClientAt ¶
func CrossConnectClientAt(k8s *K8s, pod *v1.Pod) (<-chan *crossconnect.CrossConnectEvent, func())
CrossConnectClientAt returns channel of CrossConnectEvents from passed nsmgr pod
func DefaultForwarderVariables ¶
DefaultForwarderVariables - Default variables for forwarder deployment
func DefaultPlaneVariablesKernel ¶
DefaultPlaneVariablesKernel - Default variables for Kernel forwarding deployment
func DefaultPlaneVariablesVPP ¶
DefaultPlaneVariablesVPP - Default variables for VPP deployment
func DeleteAdmissionWebhook ¶
func DeleteAdmissionWebhook(k8s *K8s, secretName string, awc *arv1beta1.MutatingWebhookConfiguration, awDeployment *appsv1.Deployment, awService *v1.Service, namespace string)
DeleteAdmissionWebhook - Delete admission webhook
func DeleteCrossConnectMonitor ¶
func DeleteCrossConnectMonitor(k8s *K8s, depl *appsv1.Deployment, svc *v1.Service)
DeleteCrossConnectMonitor deletes crossconnect-monitor deployment
func DeletePrometheus ¶
DeletePrometheus deletes prometheus roles, configMap, deployment and service
func DeployAdmissionWebhook ¶
func DeployAdmissionWebhook(k8s *K8s, name, image, namespace string, timeout time.Duration) (*arv1beta1.MutatingWebhookConfiguration, *appsv1.Deployment, *v1.Service)
DeployAdmissionWebhook - Setup Admission Webhook
func DeployCorefile ¶
DeployCorefile - Creates configmap with Corefile content
func DeployCrossConnectMonitor ¶
DeployCrossConnectMonitor deploys crossconnect-monitor
func DeployDirtyICMP ¶
DeployDirtyICMP deploys 'icmp-responder-nse' pod with '-dirty' flag set
func DeployICMP ¶
DeployICMP deploys 'icmp-responder-nse' pod with '-routes' flag set
func DeployICMPAndCoredns ¶
func DeployICMPAndCoredns(k8s *K8s, node *v1.Node, name, corednsConfigName string, timeout time.Duration) *v1.Pod
DeployICMPAndCoredns deploys 'icmp-responder-nse' pod with '-routes', '-dns' flag set. Also injected coredns server.
func DeployICMPWithConfig ¶
func DeployICMPWithConfig(k8s *K8s, node *v1.Node, name string, timeout time.Duration, gracePeriod int64) *v1.Pod
DeployICMPWithConfig deploys 'icmp-responder-nse' pod with '-routes' flag set and given grace period
func DeployMonitoringNSC ¶
DeployMonitoringNSC deploys 'monitoring-nsc' pod
func DeployMonitoringNSCAndCoredns ¶
func DeployMonitoringNSCAndCoredns(k8s *K8s, node *v1.Node, name string, timeout time.Duration) *v1.Pod
DeployMonitoringNSCAndCoredns deploys pod of nsm-dns-monitoring-nsc and coredns
func DeployNSCMonitor ¶
DeployNSCMonitor - Setup Default Client
func DeployNSCWebhook ¶
DeployNSCWebhook - Setup Default Client with webhook
func DeployNSCWithEnv ¶
func DeployNSCWithEnv(k8s *K8s, node *v1.Node, name string, timeout time.Duration, env map[string]string) *v1.Pod
DeployNSCWithEnv - Setup Default Client with custom environment
func DeployNSMRS ¶
DeployNSMRS - Setup NSMRS on Cluster with default config
func DeployNSMRSWithConfig ¶
func DeployNSMRSWithConfig(k8s *K8s, node *v1.Node, name string, timeout time.Duration, config *pods.NSMgrPodConfig) *v1.Pod
DeployNSMRSWithConfig - Setup NSMRS on Cluster
func DeployNeighborNSE ¶
DeployNeighborNSE deploys 'icmp-responder-nse' pod with '-neighbors' flag set
func DeployNscAndNsmCoredns ¶
func DeployNscAndNsmCoredns(k8s *K8s, node *v1.Node, name, corefileName string, timeout time.Duration) *v1.Pod
DeployNscAndNsmCoredns deploys pod of default client and coredns
func DeployPrometheus ¶
DeployPrometheus deploys prometheus roles, configMap, deployment and service
func DeployProxyNSMgr ¶
func DeployProxyNSMgr(k8s *K8s, node *v1.Node, name string, timeout time.Duration) (pnsmd *v1.Pod, err error)
DeployProxyNSMgr - Setup Proxy NSMgr on Cluster
func DeployProxyNSMgrWithConfig ¶
func DeployProxyNSMgrWithConfig(k8s *K8s, node *v1.Node, name string, timeout time.Duration, config *pods.NSMgrPodConfig) (pnsmd *v1.Pod, err error)
DeployProxyNSMgrWithConfig - Setup Proxy NSMgr on Cluster with custom config
func DeployUpdatingNSE ¶
DeployUpdatingNSE deploys 'icmp-responder-nse' pod with '-update' flag set
func DeployVppAgentICMP ¶
DeployVppAgentICMP - Setup VPP Agent based ICMP responder NSE
func DeployVppAgentNSC ¶
DeployVppAgentNSC - Setup Default VPP Based Client
func ExpectNSEsCountToBe ¶
ExpectNSEsCountToBe checks if nses count becomes 'countExpected' after a time
func ExpectNSMsCountToBe ¶
ExpectNSMsCountToBe checks if nsms count becomes 'countExpected' after a time
func GetJaegerTraces ¶
GetJaegerTraces rerturns map of service and traces
func GetNodeExternalIP ¶
GetNodeExternalIP - Pop InternalIP from node addresses
func GetNodeInternalIP ¶
GetNodeInternalIP - Pop InternalIP from node addresses
func GetVppAgentNSEAddr ¶
GetVppAgentNSEAddr - GetVppAgentNSEAddr - Return vpp agent NSE address
func InitSpireSecurity ¶
func InitSpireSecurity(k8s *K8s) func()
InitSpireSecurity deploys pod that proxy Spire certificates to test environment
func IsBrokeTestsEnabled ¶
func IsBrokeTestsEnabled() bool
IsBrokeTestsEnabled - Check if broken tests are enabled
func IsNsePinged ¶
IsNsePinged - Checks if the interface to NSE exists and NSE is pinged
func IsVppAgentNsePinged ¶
IsVppAgentNsePinged - Check if vpp agent NSE is pinged
func NewEventChecker ¶
func NewEventChecker(t *testing.T, actualCh <-chan *crossconnect.CrossConnectEvent) (expectedFunc func(EventChecker), waitFunc func())
NewEventChecker starts goroutine that read events from actualCh and compare it with SingleEventChecker passed to expectedFunc
func NewJaegerTracesFinder ¶
NewJaegerTracesFinder creates jaeger artifacts finder
func NewK8sLogFinder ¶
NewK8sLogFinder creates finder for pods logs
func NoHealNSMgrPodConfig ¶
func NoHealNSMgrPodConfig(k8s *K8s) []*pods.NSMgrPodConfig
NoHealNSMgrPodConfig returns config for NSMgr. The config has properties for disabling healing for nse
func PingByHostName ¶
PingByHostName tries ping hostname from the first container of pod
func PrepareRegistryClients ¶
func PrepareRegistryClients(k8s *K8s, nsmd *v1.Pod) (registry.NetworkServiceRegistryClient, registry.NsmRegistryClient, func())
PrepareRegistryClients prepare nse and nsm registry clients
func RunProxyNSMgrService ¶
func RunProxyNSMgrService(k8s *K8s) func()
RunProxyNSMgrService deploys proxy NSMgr service to access proxy NSMgr pods with single DNS name
func ServiceRegistryAt ¶
func ServiceRegistryAt(k8s *K8s, nsmgr *v1.Pod) (serviceregistry.ServiceRegistry, func())
ServiceRegistryAt creates new service registry on 5000 port
func WaitNSMgrDeployed ¶
WaitNSMgrDeployed - wait for NSMgr pod to be fully deployed.
func XconToString ¶
func XconToString(xcon *crossconnect.CrossConnect) string
XconToString converts CrossConnect to string
Types ¶
type EventChecker ¶
type EventChecker interface {
Check(eventCh <-chan *crossconnect.CrossConnectEvent) error
}
EventChecker abstracts checker of particular events from channel
type K8s ¶
type K8s struct {
// contains filtered or unexported fields
}
func NewK8sForConfig ¶
NewK8sForConfig - Creates a new K8s Clientset for the given config with creating roles
func NewK8sWithClientset ¶
func NewK8sWithClientset(clientset kubernetes.Interface, namespace string) *K8s
NewK8sWithClientset creates a k8s with injected API client
func NewK8sWithoutRoles ¶
NewK8sWithoutRoles - Creates a new K8s Clientset for the default config
func NewK8sWithoutRolesForConfig ¶
NewK8sWithoutRolesForConfig - Creates a new K8s Clientset for the given config
func (*K8s) CleanupConfigMaps ¶
func (k8s *K8s) CleanupConfigMaps()
CleanupConfigMaps cleans a configmap
func (*K8s) CleanupDeployments ¶
func (k8s *K8s) CleanupDeployments()
CleanupDeployments cleans up deployment
func (*K8s) CleanupEndpointsCRDs ¶
func (k8s *K8s) CleanupEndpointsCRDs()
CleanupEndpointsCRDs clean Network Service Endpoints from registry
func (*K8s) CleanupMutatingWebhookConfigurations ¶
func (k8s *K8s) CleanupMutatingWebhookConfigurations()
CleanupMutatingWebhookConfigurations cleans mutating webhook with configuration
func (*K8s) CleanupSecrets ¶
CleanupSecrets cleans a secret
func (*K8s) CleanupServices ¶
CleanupServices cleans up services
func (*K8s) CreateConfigMap ¶
CreateConfigMap creates a configmap
func (*K8s) CreateDeployment ¶
func (k8s *K8s) CreateDeployment(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)
CreateDeployment creates deployment
func (*K8s) CreateMutatingWebhookConfiguration ¶
func (k8s *K8s) CreateMutatingWebhookConfiguration(mutatingWebhookConf *arv1beta1.MutatingWebhookConfiguration) (*arv1beta1.MutatingWebhookConfiguration, error)
CreateMutatingWebhookConfiguration creates mutating webhook with configuration
func (*K8s) CreatePods ¶
CreatePods create pods
func (*K8s) CreatePodsRaw ¶
func (k8s *K8s) CreatePodsRaw(timeout time.Duration, failTest bool, templates ...*v1.Pod) ([]*v1.Pod, error)
CreatePodsRaw create raw pods
func (*K8s) CreateRoles ¶
CreateRoles create roles
func (*K8s) CreateSecret ¶
CreateSecret creates a secret
func (*K8s) CreateService ¶
CreateService creates a service
func (*K8s) CreateServiceAccounts ¶
func (k8s *K8s) CreateServiceAccounts()
CreateServiceAccounts create service accounts with passed names
func (*K8s) CreateTestNamespace ¶
CreateTestNamespace creates a test namespace
func (*K8s) DeleteDeployment ¶
func (k8s *K8s) DeleteDeployment(deployment *appsv1.Deployment, namespace string) error
DeleteDeployment deletes deployment
func (*K8s) DeleteMutatingWebhookConfiguration ¶
func (k8s *K8s) DeleteMutatingWebhookConfiguration(mutatingWebhookConf *arv1beta1.MutatingWebhookConfiguration) error
DeleteMutatingWebhookConfiguration deletes mutating webhook with configuration
func (*K8s) DeleteNSEs ¶
DeleteNSEs deletes 'nse' resources by names
func (*K8s) DeleteNetworkServices ¶
DeleteNetworkServices deletes 'networkservice' resources by names
func (*K8s) DeletePodsByName ¶
DeletePodsByName deletes pod if a pod's name contains one of the given strings
func (*K8s) DeletePodsForce ¶
DeletePodsForce delete pods forcefully
func (*K8s) DeleteRoles ¶
DeleteRoles delete roles
func (*K8s) DeleteSecret ¶
DeleteSecret deletes a secret
func (*K8s) DeleteService ¶
DeleteService deletes a service
func (*K8s) DeleteServiceAccounts ¶
DeleteServiceAccounts deletes passed service accounts from cluster
func (*K8s) DeleteTestNamespace ¶
DeleteTestNamespace deletes a test namespace
func (*K8s) GetClientSet ¶
func (k8s *K8s) GetClientSet() (kubernetes.Interface, error)
GetClientSet returns a clientset
func (*K8s) GetForwardingPlane ¶
GetForwardingPlane gets which forwarding plane is going to be used in testing
func (*K8s) GetFullLogs ¶
GetFullLogs - return full logs
func (*K8s) GetK8sNamespace ¶
GetK8sNamespace returns a namespace
func (*K8s) GetLogsChannel ¶
func (k8s *K8s) GetLogsChannel(ctx context.Context, pod *v1.Pod, options *v1.PodLogOptions) (chan string, chan error)
GetLogsChannel returns logs channel from pod with the given options
func (*K8s) GetLogsWithOptions ¶
GetLogsWithOptions returns logs collected from pod with the given options
func (*K8s) GetNSEs ¶
func (k8s *K8s) GetNSEs() ([]v1alpha1.NetworkServiceEndpoint, error)
GetNSEs returns existing 'nse' resources
func (*K8s) GetNSMList ¶
func (k8s *K8s) GetNSMList() ([]v1alpha1.NetworkServiceManager, error)
GetNSMs returns existing 'nse' resources
func (*K8s) GetNamespace ¶
GetNamespace returns a namespace
func (*K8s) GetNetworkServices ¶
func (k8s *K8s) GetNetworkServices() ([]v1alpha1.NetworkService, error)
GetNetworkServices returns existing 'networkservice' resources
func (*K8s) GetNodesWait ¶
GetNodesWait wait for required number of nodes are up and running fine
func (*K8s) GetPullingImagesDuration ¶
GetPullingImagesDuration returns pod images pulling duration
func (*K8s) IsNetworkProblem ¶
IsNetworkProblem - return error if pod has deploy network problems detected in events.
func (*K8s) IsPodReady ¶
IsPodReady returns if a pod is ready
func (*K8s) ListPodsByNs ¶
ListPodsByNs returns pod list by specific namespace
func (*K8s) NewPortForwarder ¶
func (*K8s) PrintImageVersion ¶
PrintImageVersion Prints image version pf pod.
func (*K8s) SaveTestArtifacts ¶
SaveTestArtifacts force saving tests artifacts
func (*K8s) SetForwardingPlane ¶
SetForwardingPlane sets which forwarding plane to be used in testing
func (*K8s) WaitLogsContains ¶
WaitLogsContains waits with timeout for pod::container logs to contain pattern as substring
type MonitorClient ¶
type MonitorClient crossconnect.MonitorCrossConnect_MonitorCrossConnectsClient
MonitorClient is shorter name for crossconnect.MonitorCrossConnect_MonitorCrossConnectsClient
func CreateCrossConnectClient ¶
func CreateCrossConnectClient(k8s *K8s, address string) (MonitorClient, func(), context.CancelFunc)
CreateCrossConnectClient returns CrossConnectMonitorClient to passed address
type MultipleEventChecker ¶
type MultipleEventChecker struct {
Events []EventChecker
}
MultipleEventChecker checks subsequence of events in channel
func (*MultipleEventChecker) Check ¶
func (e *MultipleEventChecker) Check(eventCh <-chan *crossconnect.CrossConnectEvent) error
Check implements method from EventChecker interface
type NSCCheckInfo ¶
type NSCCheckInfo struct {
// contains filtered or unexported fields
}
NSCCheckInfo - Structure to hold client ping information
func CheckNSC ¶
func CheckNSC(k8s *K8s, nscPodNode *v1.Pod) *NSCCheckInfo
CheckNSC - Perform default check for client to NSE operations
func CheckVppAgentNSC ¶
func CheckVppAgentNSC(k8s *K8s, nscPodNode *v1.Pod) *NSCCheckInfo
CheckVppAgentNSC - Perform check of VPP based agent operations.
func (*NSCCheckInfo) PrintLogs ¶
func (info *NSCCheckInfo) PrintLogs()
PrintLogs - Print Client print information
type NodeConf ¶
func SetupNodes ¶
SetupNodes - Setup NSMgr and Forwarder for particular number of nodes in cluster
type NscChecker ¶
type NscChecker = func(*K8s, *v1.Pod) *NSCCheckInfo
NscChecker - Type to pass checked for pod
type OrEventChecker ¶
type OrEventChecker struct { Event1 EventChecker Event2 EventChecker }
OrEventChecker checks that one of checker - Event1 or Event2 successfully finishes
func (*OrEventChecker) Check ¶
func (e *OrEventChecker) Check(eventCh <-chan *crossconnect.CrossConnectEvent) error
Check implements method from EventChecker interface
type PodDeployResult ¶
type PodDeployResult struct {
// contains filtered or unexported fields
}
type PodSupplier ¶
PodSupplier - Type to pass supplier of pod
type PortForward ¶
type PortForward struct { // The port on the pod to forward traffic to. DestinationPort int // The port that the port forward should listen to, random if not set. ListenPort int // contains filtered or unexported fields }
func (*PortForward) Start ¶
func (p *PortForward) Start() error
Start a port forward to a pod - blocks until the tunnel is ready for use.
func (*PortForward) Stop ¶
func (p *PortForward) Stop()
type SingleEventChecker ¶
type SingleEventChecker struct { Timeout time.Duration EventType crossconnect.CrossConnectEventType Empty bool SrcUp bool DstUp bool }
SingleEventChecker checks single event in channel
func (*SingleEventChecker) Check ¶
func (e *SingleEventChecker) Check(eventCh <-chan *crossconnect.CrossConnectEvent) error
Check implements method from EventChecker interface
type TestingPodFixture ¶
type TestingPodFixture interface { DeployNsc(*K8s, *v1.Node, string, time.Duration) *v1.Pod DeployNse(*K8s, *v1.Node, string, time.Duration) *v1.Pod CheckNsc(*K8s, *v1.Pod) *NSCCheckInfo }
TestingPodFixture - Tool for help testing pods
func DefaultTestingPodFixture ¶
func DefaultTestingPodFixture(g *WithT) TestingPodFixture
DefaultTestingPodFixture - Creates default testing tool
func NewCustomTestingPodFixture ¶
func NewCustomTestingPodFixture(g *WithT, deployNscFunc, deployNseFunc PodSupplier, checkNscFunc NscChecker) TestingPodFixture
NewCustomTestingPodFixture - Creates a custom testing tool
func VppAgentTestingPodFixture ¶
func VppAgentTestingPodFixture(g *WithT) TestingPodFixture
VppAgentTestingPodFixture - Creates vpp agent specific testing tool