mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
tests: Replaces images used with agnhost (part 2)
Quite a few images are only used a few times in a few tests. Thus, the images are being centralized into the agnhost image, reducing the number of images that have to be pulled and used. This PR replaces the usage of the following images with agnhost: - net - netexec - nettest - webhook
This commit is contained in:
parent
ae3c44d043
commit
9e81f3b50b
@ -118,7 +118,7 @@ var _ = SIGDescribe("AdmissionWebhook", func() {
|
||||
// Note that in 1.9 we will have backwards incompatible change to
|
||||
// admission webhooks, so the image will be updated to 1.9 sometime in
|
||||
// the development 1.9 cycle.
|
||||
deployWebhookAndService(f, imageutils.GetE2EImage(imageutils.AdmissionWebhook), context)
|
||||
deployWebhookAndService(f, imageutils.GetE2EImage(imageutils.Agnhost), context)
|
||||
})
|
||||
|
||||
ginkgo.AfterEach(func() {
|
||||
@ -342,11 +342,11 @@ func deployWebhookAndService(f *framework.Framework, image string, context *cert
|
||||
Name: "sample-webhook",
|
||||
VolumeMounts: mounts,
|
||||
Args: []string{
|
||||
"webhook",
|
||||
"--tls-cert-file=/webhook.local.config/certificates/tls.crt",
|
||||
"--tls-private-key-file=/webhook.local.config/certificates/tls.key",
|
||||
"--alsologtostderr",
|
||||
"-v=4",
|
||||
"2>&1",
|
||||
},
|
||||
Image: image,
|
||||
},
|
||||
|
@ -36,7 +36,7 @@ const (
|
||||
etcHostsOriginalPath = "/etc/hosts-original"
|
||||
)
|
||||
|
||||
var etcHostsImageName = imageutils.GetE2EImage(imageutils.Netexec)
|
||||
var etcHostsImageName = imageutils.GetE2EImage(imageutils.Agnhost)
|
||||
|
||||
type KubeletManagedHostConfig struct {
|
||||
hostNetworkPod *v1.Pod
|
||||
|
@ -49,7 +49,8 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() {
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "pod-handle-http-request",
|
||||
Image: imageutils.GetE2EImage(imageutils.Netexec),
|
||||
Image: imageutils.GetE2EImage(imageutils.Agnhost),
|
||||
Args: []string{"netexec"},
|
||||
Ports: []v1.ContainerPort{
|
||||
{
|
||||
ContainerPort: 8080,
|
||||
|
@ -55,13 +55,11 @@ var CommonImageWhiteList = sets.NewString(
|
||||
imageutils.GetE2EImage(imageutils.IpcUtils),
|
||||
imageutils.GetE2EImage(imageutils.Mounttest),
|
||||
imageutils.GetE2EImage(imageutils.MounttestUser),
|
||||
imageutils.GetE2EImage(imageutils.Netexec),
|
||||
imageutils.GetE2EImage(imageutils.Nginx),
|
||||
imageutils.GetE2EImage(imageutils.ServeHostname),
|
||||
imageutils.GetE2EImage(imageutils.TestWebserver),
|
||||
imageutils.GetE2EImage(imageutils.VolumeNFSServer),
|
||||
imageutils.GetE2EImage(imageutils.VolumeGlusterServer),
|
||||
imageutils.GetE2EImage(imageutils.Net),
|
||||
)
|
||||
|
||||
type testImagesStruct struct {
|
||||
|
@ -73,7 +73,7 @@ const (
|
||||
RegexIPv6 = "(?:(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-fA-F]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9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|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,5}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,6}(?:(?:[0-9a-fA-F]{1,4})))?::))))"
|
||||
)
|
||||
|
||||
var netexecImageName = imageutils.GetE2EImage(imageutils.Netexec)
|
||||
var netexecImageName = imageutils.GetE2EImage(imageutils.Agnhost)
|
||||
|
||||
// NewNetworkingTestConfig creates and sets up a new test config helper.
|
||||
func NewNetworkingTestConfig(f *Framework) *NetworkingTestConfig {
|
||||
@ -426,8 +426,8 @@ func (config *NetworkingTestConfig) createNetShellPodSpec(podName, hostname stri
|
||||
Name: "webserver",
|
||||
Image: netexecImageName,
|
||||
ImagePullPolicy: v1.PullIfNotPresent,
|
||||
Command: []string{
|
||||
"/netexec",
|
||||
Args: []string{
|
||||
"netexec",
|
||||
fmt.Sprintf("--http-port=%d", EndpointHTTPPort),
|
||||
fmt.Sprintf("--udp-port=%d", EndpointUDPPort),
|
||||
},
|
||||
@ -470,8 +470,8 @@ func (config *NetworkingTestConfig) createTestPodSpec() *v1.Pod {
|
||||
Name: "webserver",
|
||||
Image: netexecImageName,
|
||||
ImagePullPolicy: v1.PullIfNotPresent,
|
||||
Command: []string{
|
||||
"/netexec",
|
||||
Args: []string{
|
||||
"netexec",
|
||||
fmt.Sprintf("--http-port=%d", EndpointHTTPPort),
|
||||
fmt.Sprintf("--udp-port=%d", EndpointUDPPort),
|
||||
},
|
||||
|
@ -654,8 +654,8 @@ func (j *ServiceTestJig) newRCTemplate(namespace string) *v1.ReplicationControll
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "netexec",
|
||||
Image: imageutils.GetE2EImage(imageutils.Netexec),
|
||||
Args: []string{"--http-port=80", "--udp-port=80"},
|
||||
Image: imageutils.GetE2EImage(imageutils.Agnhost),
|
||||
Args: []string{"netexec", "--http-port=80", "--udp-port=80"},
|
||||
ReadinessProbe: &v1.Probe{
|
||||
PeriodSeconds: 3,
|
||||
Handler: v1.Handler{
|
||||
@ -836,8 +836,8 @@ func newNetexecPodSpec(podName string, httpPort, udpPort int32, hostNetwork bool
|
||||
{
|
||||
Name: "netexec",
|
||||
Image: netexecImageName,
|
||||
Command: []string{
|
||||
"/netexec",
|
||||
Args: []string{
|
||||
"netexec",
|
||||
fmt.Sprintf("--http-port=%d", httpPort),
|
||||
fmt.Sprintf("--udp-port=%d", udpPort),
|
||||
},
|
||||
|
@ -450,7 +450,7 @@ func ProxyMode(f *Framework) (string, error) {
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "detector",
|
||||
Image: imageutils.GetE2EImage(imageutils.Net),
|
||||
Image: imageutils.GetE2EImage(imageutils.Agnhost),
|
||||
Command: []string{"/bin/sleep", "3600"},
|
||||
},
|
||||
},
|
||||
|
@ -665,11 +665,11 @@ func GeneratePodSecurityContext(fsGroup *int64, seLinuxOptions *v1.SELinuxOption
|
||||
}
|
||||
|
||||
// GetTestImage returns the image name with the given input
|
||||
// If the Node OS is windows, currently we return Nettest image for Windows node
|
||||
// If the Node OS is windows, currently we return Agnhost image for Windows node
|
||||
// due to the issue of #https://github.com/kubernetes-sigs/windows-testing/pull/35.
|
||||
func GetTestImage(image string) string {
|
||||
if framework.NodeOSDistroIs("windows") {
|
||||
return imageutils.GetE2EImage(imageutils.Nettest)
|
||||
return imageutils.GetE2EImage(imageutils.Agnhost)
|
||||
}
|
||||
return image
|
||||
}
|
||||
|
@ -69,7 +69,8 @@ func pfPod(expectedClientData, chunks, chunkSize, chunkIntervalMillis string, bi
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "readiness",
|
||||
Image: imageutils.GetE2EImage(imageutils.Netexec),
|
||||
Image: imageutils.GetE2EImage(imageutils.Agnhost),
|
||||
Args: []string{"netexec"},
|
||||
ReadinessProbe: &v1.Probe{
|
||||
Handler: v1.Handler{
|
||||
Exec: &v1.ExecAction{
|
||||
|
@ -37,7 +37,7 @@ import (
|
||||
"github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var kubeProxyE2eImage = imageutils.GetE2EImage(imageutils.Net)
|
||||
var kubeProxyE2eImage = imageutils.GetE2EImage(imageutils.Agnhost)
|
||||
|
||||
var _ = SIGDescribe("Network", func() {
|
||||
const (
|
||||
@ -102,8 +102,8 @@ var _ = SIGDescribe("Network", func() {
|
||||
Name: "e2e-net-client",
|
||||
Image: kubeProxyE2eImage,
|
||||
ImagePullPolicy: "Always",
|
||||
Command: []string{
|
||||
"/net", "-serve", fmt.Sprintf("0.0.0.0:%d", testDaemonHTTPPort),
|
||||
Args: []string{
|
||||
"net", "--serve", fmt.Sprintf("0.0.0.0:%d", testDaemonHTTPPort),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -124,10 +124,10 @@ var _ = SIGDescribe("Network", func() {
|
||||
Name: "e2e-net-server",
|
||||
Image: kubeProxyE2eImage,
|
||||
ImagePullPolicy: "Always",
|
||||
Command: []string{
|
||||
"/net",
|
||||
"-runner", "nat-closewait-server",
|
||||
"-options",
|
||||
Args: []string{
|
||||
"net",
|
||||
"--runner", "nat-closewait-server",
|
||||
"--options",
|
||||
fmt.Sprintf(`{"LocalAddr":"0.0.0.0:%v", "PostFindTimeoutSeconds":%v}`,
|
||||
testDaemonTCPPort,
|
||||
postFinTimeoutSeconds),
|
||||
|
@ -1272,7 +1272,7 @@ var _ = SIGDescribe("Services", func() {
|
||||
}()
|
||||
|
||||
t.Name = "slow-terminating-unready-pod"
|
||||
t.Image = imageutils.GetE2EImage(imageutils.Netexec)
|
||||
t.Image = imageutils.GetE2EImage(imageutils.Agnhost)
|
||||
port := 80
|
||||
terminateSeconds := int64(600)
|
||||
|
||||
@ -1292,7 +1292,7 @@ var _ = SIGDescribe("Services", func() {
|
||||
},
|
||||
}
|
||||
rcSpec := framework.RcByNameContainer(t.Name, 1, t.Image, t.Labels, v1.Container{
|
||||
Args: []string{fmt.Sprintf("--http-port=%d", port)},
|
||||
Args: []string{"netexec", fmt.Sprintf("--http-port=%d", port)},
|
||||
Name: t.Name,
|
||||
Image: t.Image,
|
||||
Ports: []v1.ContainerPort{{ContainerPort: int32(port), Protocol: v1.ProtocolTCP}},
|
||||
|
@ -51,7 +51,8 @@ func testPreStop(c clientset.Interface, ns string) {
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "server",
|
||||
Image: imageutils.GetE2EImage(imageutils.Nettest),
|
||||
Image: imageutils.GetE2EImage(imageutils.Agnhost),
|
||||
Args: []string{"nettest"},
|
||||
Ports: []v1.ContainerPort{{ContainerPort: 8080}},
|
||||
},
|
||||
},
|
||||
|
@ -51,7 +51,6 @@ var NodeImageWhiteList = sets.NewString(
|
||||
imageutils.GetE2EImage(imageutils.Nginx),
|
||||
imageutils.GetE2EImage(imageutils.Perl),
|
||||
imageutils.GetE2EImage(imageutils.ServeHostname),
|
||||
imageutils.GetE2EImage(imageutils.Netexec),
|
||||
imageutils.GetE2EImage(imageutils.Nonewprivs),
|
||||
imageutils.GetPauseImageName(),
|
||||
gpu.GetGPUDevicePluginImage(),
|
||||
|
@ -105,8 +105,6 @@ var (
|
||||
const (
|
||||
// CRDConversionWebhook image
|
||||
CRDConversionWebhook = iota
|
||||
// AdmissionWebhook image
|
||||
AdmissionWebhook
|
||||
// Agnhost image
|
||||
Agnhost
|
||||
// Alpine image
|
||||
@ -163,12 +161,6 @@ const (
|
||||
MounttestUser
|
||||
// Nautilus image
|
||||
Nautilus
|
||||
// Net image
|
||||
Net
|
||||
// Netexec image
|
||||
Netexec
|
||||
// Nettest image
|
||||
Nettest
|
||||
// Nginx image
|
||||
Nginx
|
||||
// NginxNew image
|
||||
@ -217,8 +209,7 @@ const (
|
||||
func initImageConfigs() map[int]Config {
|
||||
configs := map[int]Config{}
|
||||
configs[CRDConversionWebhook] = Config{e2eRegistry, "crd-conversion-webhook", "1.13rev2"}
|
||||
configs[AdmissionWebhook] = Config{e2eRegistry, "webhook", "1.15v1"}
|
||||
configs[Agnhost] = Config{e2eRegistry, "agnhost", "2.0"}
|
||||
configs[Agnhost] = Config{e2eRegistry, "agnhost", "2.1"}
|
||||
configs[Alpine] = Config{dockerLibraryRegistry, "alpine", "3.7"}
|
||||
configs[AuthenticatedAlpine] = Config{gcAuthenticatedRegistry, "alpine", "3.7"}
|
||||
configs[APIServer] = Config{e2eRegistry, "sample-apiserver", "1.10"}
|
||||
@ -245,9 +236,6 @@ func initImageConfigs() map[int]Config {
|
||||
configs[Mounttest] = Config{e2eRegistry, "mounttest", "1.0"}
|
||||
configs[MounttestUser] = Config{e2eRegistry, "mounttest-user", "1.0"}
|
||||
configs[Nautilus] = Config{e2eRegistry, "nautilus", "1.0"}
|
||||
configs[Net] = Config{e2eRegistry, "net", "1.0"}
|
||||
configs[Netexec] = Config{e2eRegistry, "netexec", "1.1"}
|
||||
configs[Nettest] = Config{e2eRegistry, "nettest", "1.0"}
|
||||
configs[Nginx] = Config{dockerLibraryRegistry, "nginx", "1.14-alpine"}
|
||||
configs[NginxNew] = Config{dockerLibraryRegistry, "nginx", "1.15-alpine"}
|
||||
configs[Nonewprivs] = Config{e2eRegistry, "nonewprivs", "1.0"}
|
||||
|
Loading…
Reference in New Issue
Block a user