package
1.33.0-alpha.2
Repository: https://github.com/kubernetes/kubernetes.git
Documentation: pkg.go.dev

# Packages

Package format is an extension of Gomega's format package which improves printing of objects that can be serialized well as YAML, like the structs in the Kubernetes API.
Package junit provides data structures to allow easy XML encoding and decoding of JUnit test results.
Package ktesting is a wrapper around k8s.io/klog/v2/ktesting.

# Functions

AdmissionWebhookHandler creates a HandlerFunc that decodes/encodes AdmissionReview and performs given admit function.
CheckAuditLines searches the audit log for the expected audit lines.
CheckAuditLinesFiltered searches the audit log for the expected audit lines, customAnnotationsFilter controls which audit annotations are added to AuditEvent.CustomAuditAnnotations.
CheckDeploymentRevisionAndImage checks if the input deployment's and its new replica set's revision and image are as expected.
EncodeCertPEM returns PEM-endcoded certificate data.
FailedContainers inspects all containers in a pod and returns failure information for containers that have failed or been restarted.
GetAllReplicaSets returns the old and new replica sets targeted by the given Deployment.
GetCAdvisorRootDir returns the root directory for cAdvisor, if present in the gopath.
GetK8sBuildOutputDir returns the build output directory for k8s For dockerized build, targetArch (eg: 'linux/arm64', 'linux/amd64') must be explicitly specified For non dockerized build, targetArch is ignored.
GetK8sRootDir returns the root directory for kubernetes, if present in the gopath.
GetNewReplicaSet returns a replica set that matches the intent of the given deployment; get ReplicaSetList from client interface.
GetNodeCondition extracts the provided condition from the given status and returns that.
GetOldReplicaSets returns the old replica sets targeted by the given Deployment; get PodList and ReplicaSetList from client interface.
NewAdmissionWebhookServer sets up a webhook server with TLS enabled, returns URL and Close function for the server.
NewPrivateKey creates an RSA private key.
NewSignedCert creates a signed certificate using the given CA certificate and key.
PodRunningReady checks whether pod p's phase is running and it has a ready condition of status true.
RemoveLabelOffNode is for cleaning up labels temporarily added to node, won't fail if target label doesn't exist or has been removed.
Utility for retrying the given function with exponential backoff.
RootDir gets the on-disk kubernetes source directory, returning an error is none is found.
RunDeployment Launches (and verifies correctness) of a Deployment and will wait for all pods it spawns to become "Running".
RunRC Launches (and verifies correctness) of a Replication Controller and will wait for all pods it spawns to become "Running".
RunReplicaSet launches (and verifies correctness) of a ReplicaSet and waits until all the pods it launches to reach the "Running" state.
Simplified version of RunRC, that does not create RC, but creates plain Pods.
StaticPodTemplate returns an implementation of PodTemplate for a fixed pod that is the same regardless of the index.
TerminatedContainers inspects all containers in a pod and returns a map of "container name: termination reason", for all currently terminated containers.
VerifyLabelsRemoved checks if Node for given nodeName does not have any of labels from labelKeys.
Waits for the deployment to complete, and don't check if rolling update strategy is broken.
Waits for the deployment to complete, and check rolling update strategy isn't broken at any times.
WaitForDeploymentRevisionAndImage waits for the deployment's and its new RS's revision and container image to match the given revision and image.
WaitForDeploymentUpdatedReplicasGTE waits for given deployment to be observed by the controller and has at least a number of updatedReplicas.
Wait up to 10 minutes for at least 'replicas' many pods to be Running and at least one matching pod exists.
Wait up to 10 minutes for all matching pods to become Running and at least one matching pod exists.
Verify .Status.Replicas is equal to .Spec.Replicas.

# Variables

LocalhostCert was generated from crypto/tls/generate_cert.go with the following command: go run generate_cert.go --rsa-bits 2048 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h.
LocalhostKey is the private key for LocalhostCert.

# Structs

AuditEvent is a simplified representation of an audit event for testing purposes.
MissingEventsReport provides an analysis if any events are missing.
NodeAllocatableStrategy fills node.status.allocatable and csiNode.spec.drivers[*].allocatable.
Convenient wrapper around cache.Store that returns list of v1.Pod instead of interface{}.
UniqueNodeLabelStrategy sets a unique label for each node.

# Interfaces

PodTemplate is responsible for creating a v1.Pod instance that is ready to be sent to the API server.

# Type aliases