Documentation
¶
Overview ¶
Package drivertest stands in for what the executor drivers talk to — a container runtime's CLI and a Kubernetes API server — so a test can drive the real drivers end to end (Task 20403): the container driver's staged lease files on disk, and the Kubernetes driver's lease Secret in the stand-in API server, are what a revocation has to reach.
Neither runs anything. The runtime reports one image as present and every container as running until it is removed or killed; the API server keeps every Pod pending. Both are test-only: production code must not import this package (tests/arch enforces it).
Index ¶
Constants ¶
const Image = "docker.io/library/alpine@sha256:" +
"d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc"
Image is a pinned reference the stand-in runtime reports as present.
Variables ¶
This section is empty.
Functions ¶
func ContainerRuntime ¶
ContainerRuntime writes, into dir, a `docker` that answers the container driver as a running container would and stops it when removed or killed, and returns its path. Its name has to be docker: the driver accepts no other runtime.
Types ¶
type KubeAPI ¶
type KubeAPI struct {
// contains filtered or unexported fields
}
KubeAPI serves the Pod and Secret calls the Kubernetes driver makes, and keeps every Pod pending — running, as far as a revocation is concerned — so a test can see what a revocation does to a live Pod's lease Secret.
func NewKubeAPI ¶
NewKubeAPI starts one, closed when the test ends.
func (*KubeAPI) KeyHolding ¶
KeyHolding returns the key of secret holding value, or "".
func (*KubeAPI) PodDeleted ¶
PodDeleted reports whether any Pod was deleted.
func (*KubeAPI) REST ¶
func (f *KubeAPI) REST() *kubernetes.RESTConfig
REST is the connection a driver uses to reach it.
func (*KubeAPI) SecretData ¶
SecretData returns a copy of secret's data.
type KubeSource ¶
type KubeSource struct{ Rest *kubernetes.RESTConfig }
KubeSource hands the Kubernetes driver the stand-in API server's connection.
func (KubeSource) Acquire ¶
func (s KubeSource) Acquire(context.Context, string) (*kubernetes.Credentials, error)
Acquire implements kubernetes.CredentialSource.
func (KubeSource) Describe ¶
func (s KubeSource) Describe() string
Describe implements kubernetes.CredentialSource.
func (KubeSource) Release ¶
func (s KubeSource) Release(string)
Release implements kubernetes.CredentialSource.
func (KubeSource) Renew ¶
func (s KubeSource) Renew(ctx context.Context, _ string) (*kubernetes.Credentials, error)
Renew implements kubernetes.CredentialSource.