package common
import "k8s.io/kubernetes/test/e2e/common"
Index ¶
- Constants
- Variables
- func GetContainerStartedTime(p *v1.Pod, containerName string) (time.Time, error)
- func GetTransitionTimeForReadyCondition(p *v1.Pod) (time.Time, error)
- func NewRCByName(c clientset.Interface, ns, name string, replicas int32, gracePeriod *int64, containerArgs []string) (*v1.ReplicationController, error)
- func NewSVCByName(c clientset.Interface, ns, name string) error
- func RestartNodes(c clientset.Interface, nodes []v1.Node) error
- func RunLivenessTest(f *framework.Framework, pod *v1.Pod, expectNumRestarts int, timeout time.Duration)
- func SIGNetworkDescribe(text string, body func()) bool
- func SIGNodeDescribe(text string, body func()) bool
- func SIGStorageDescribe(text string, body func()) bool
- func SubstituteImageName(content string) string
- type ConformanceContainer
- func (cc *ConformanceContainer) Create()
- func (cc *ConformanceContainer) Delete() error
- func (cc *ConformanceContainer) GetPhase() (v1.PodPhase, error)
- func (cc *ConformanceContainer) GetStatus() (v1.ContainerStatus, error)
- func (cc *ConformanceContainer) IsReady() (bool, error)
- func (cc *ConformanceContainer) Present() (bool, error)
- type ContainerState
- type KubeletManagedHostConfig
- type PrivilegedPodTestConfig
- type Suite
Constants ¶
const ( // ContainerStatusRetryTimeout represents polling threshold before giving up to get the container status ContainerStatusRetryTimeout = time.Minute * 5 // ContainerStatusPollInterval represents duration between polls to get the container status ContainerStatusPollInterval = time.Second * 1 )
Variables ¶
var PrePulledImages = sets.NewString( imageutils.GetE2EImage(imageutils.Agnhost), imageutils.GetE2EImage(imageutils.BusyBox), imageutils.GetE2EImage(imageutils.IpcUtils), imageutils.GetE2EImage(imageutils.Nginx), imageutils.GetE2EImage(imageutils.Httpd), imageutils.GetE2EImage(imageutils.VolumeNFSServer), imageutils.GetE2EImage(imageutils.VolumeGlusterServer), imageutils.GetE2EImage(imageutils.NonRoot), )
PrePulledImages are a list of images used in e2e/common tests. These images should be prepulled before tests starts, so that the tests won't fail due image pulling flakes. Currently, this is only used by node e2e test. See also updateImageAllowList() in ../../e2e_node/image_list.go TODO(random-liu): Change the image puller pod to use similar mechanism.
Functions ¶
func GetContainerStartedTime ¶
GetContainerStartedTime returns the time when the given container started and error if any
func GetTransitionTimeForReadyCondition ¶
GetTransitionTimeForReadyCondition returns the time when the given pod became ready and error if any
func NewRCByName ¶
func NewRCByName(c clientset.Interface, ns, name string, replicas int32, gracePeriod *int64, containerArgs []string) (*v1.ReplicationController, error)
NewRCByName creates a replication controller with a selector by name of name.
func NewSVCByName ¶
NewSVCByName creates a service by name.
func RestartNodes ¶
RestartNodes restarts specific nodes.
func RunLivenessTest ¶
func RunLivenessTest(f *framework.Framework, pod *v1.Pod, expectNumRestarts int, timeout time.Duration)
RunLivenessTest verifies the number of restarts for pod with given expected number of restarts
func SIGNetworkDescribe ¶
SIGNetworkDescribe annotates the test with the SIG Network label.
func SIGNodeDescribe ¶
SIGNodeDescribe annotates the test with the SIG Node label.
func SIGStorageDescribe ¶
SIGStorageDescribe annotates the test with the SIG Storage label.
func SubstituteImageName ¶
SubstituteImageName replaces image name in content.
Types ¶
type ConformanceContainer ¶
type ConformanceContainer struct { Container v1.Container RestartPolicy v1.RestartPolicy Volumes []v1.Volume ImagePullSecrets []string PodClient *framework.PodClient PodSecurityContext *v1.PodSecurityContext // contains filtered or unexported fields }
ConformanceContainer defines the types for running container conformance test cases One pod one container
func (*ConformanceContainer) Create ¶
func (cc *ConformanceContainer) Create()
Create creates the defined conformance container
func (*ConformanceContainer) Delete ¶
func (cc *ConformanceContainer) Delete() error
Delete deletes the defined conformance container
func (*ConformanceContainer) GetPhase ¶
func (cc *ConformanceContainer) GetPhase() (v1.PodPhase, error)
GetPhase returns the phase of the pod lifecycle and error if any
func (*ConformanceContainer) GetStatus ¶
func (cc *ConformanceContainer) GetStatus() (v1.ContainerStatus, error)
GetStatus returns the details of the current status of this container and error if any
func (*ConformanceContainer) IsReady ¶
func (cc *ConformanceContainer) IsReady() (bool, error)
IsReady returns whether this container is ready and error if any
func (*ConformanceContainer) Present ¶
func (cc *ConformanceContainer) Present() (bool, error)
Present returns whether this pod is present and error if any
type ContainerState ¶
type ContainerState string
ContainerState represents different states of its lifecycle
const ( // ContainerStateWaiting represents 'Waiting' container state ContainerStateWaiting ContainerState = "Waiting" // ContainerStateRunning represents 'Running' container state ContainerStateRunning ContainerState = "Running" // ContainerStateTerminated represents 'Terminated' container state ContainerStateTerminated ContainerState = "Terminated" // ContainerStateUnknown represents 'Unknown' container state ContainerStateUnknown ContainerState = "Unknown" )
func GetContainerState ¶
func GetContainerState(state v1.ContainerState) ContainerState
GetContainerState returns current state the container represents among its lifecyle
type KubeletManagedHostConfig ¶
type KubeletManagedHostConfig struct {
// contains filtered or unexported fields
}
KubeletManagedHostConfig defines the types for running managed etc hosts test cases
type PrivilegedPodTestConfig ¶
type PrivilegedPodTestConfig struct {
// contains filtered or unexported fields
}
PrivilegedPodTestConfig is configuration struct for privileged pod test TODO: Merge with tests in security_context.go
type Suite ¶
type Suite string
Suite represents test suite.
const ( // E2E represents a test suite for e2e. E2E Suite = "e2e" // NodeE2E represents a test suite for node e2e. NodeE2E Suite = "node e2e" )
var CurrentSuite Suite
CurrentSuite represents current test suite.
Source Files ¶
configmap.go configmap_volume.go container.go container_probe.go docker_containers.go downward_api.go downwardapi_volume.go empty_dir.go expansion.go framework.go host_path.go init_container.go kubelet.go kubelet_etc_hosts.go lease.go lifecycle_hook.go networking.go node_lease.go pods.go podtemplates.go privileged.go projected_combined.go projected_configmap.go projected_downwardapi.go projected_secret.go runtime.go runtimeclass.go secrets.go secrets_volume.go security_context.go sysctl.go util.go volumes.go
- Version
- v1.21.0-beta.0
- Published
- Feb 23, 2021
- Platform
- linux/amd64
- Imports
- 63 packages
- Last checked
- 1 minute ago –
Tools for package owners.