mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Add references of registry and image from imageutils
This commit is contained in:
parent
f49fe2a750
commit
3377737af2
@ -26,6 +26,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/kubelet/images"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
"github.com/onsi/gomega"
|
||||
@ -353,28 +354,28 @@ while true; do sleep 1; done
|
||||
}
|
||||
|
||||
ginkgo.It("should not be able to pull image from invalid registry [NodeConformance]", func() {
|
||||
image := "invalid.com/invalid/alpine:3.1"
|
||||
image := imageutils.GetE2EImage(imageutils.InvalidRegistryImage)
|
||||
imagePullTest(image, false, v1.PodPending, true, false)
|
||||
})
|
||||
|
||||
ginkgo.It("should not be able to pull non-existing image from gcr.io [NodeConformance]", func() {
|
||||
image := "k8s.gcr.io/invalid-image:invalid-tag"
|
||||
image := imageutils.GetE2EImage(imageutils.Invalid)
|
||||
imagePullTest(image, false, v1.PodPending, true, false)
|
||||
})
|
||||
|
||||
ginkgo.It("should be able to pull image from gcr.io [LinuxOnly] [NodeConformance]", func() {
|
||||
image := "gcr.io/google-containers/debian-base:0.4.1"
|
||||
image := imageutils.GetE2EImage(imageutils.DebianBase)
|
||||
imagePullTest(image, false, v1.PodRunning, false, false)
|
||||
})
|
||||
|
||||
ginkgo.It("should be able to pull image from gcr.io [NodeConformance]", func() {
|
||||
framework.SkipUnlessNodeOSDistroIs("windows")
|
||||
image := "gcr.io/kubernetes-e2e-test-images/windows-nanoserver:v1"
|
||||
image := imageutils.GetE2EImage(imageutils.WindowsNanoServer)
|
||||
imagePullTest(image, false, v1.PodRunning, false, true)
|
||||
})
|
||||
|
||||
ginkgo.It("should be able to pull image from docker hub [LinuxOnly] [NodeConformance]", func() {
|
||||
image := "alpine:3.7"
|
||||
image := imageutils.GetE2EImage(imageutils.Alpine)
|
||||
imagePullTest(image, false, v1.PodRunning, false, false)
|
||||
})
|
||||
|
||||
@ -386,18 +387,18 @@ while true; do sleep 1; done
|
||||
})
|
||||
|
||||
ginkgo.It("should not be able to pull from private registry without secret [NodeConformance]", func() {
|
||||
image := "gcr.io/authenticated-image-pulling/alpine:3.7"
|
||||
image := imageutils.GetE2EImage(imageutils.AuthenticatedAlpine)
|
||||
imagePullTest(image, false, v1.PodPending, true, false)
|
||||
})
|
||||
|
||||
ginkgo.It("should be able to pull from private registry with secret [LinuxOnly] [NodeConformance]", func() {
|
||||
image := "gcr.io/authenticated-image-pulling/alpine:3.7"
|
||||
image := imageutils.GetE2EImage(imageutils.AuthenticatedAlpine)
|
||||
imagePullTest(image, true, v1.PodRunning, false, false)
|
||||
})
|
||||
|
||||
ginkgo.It("should be able to pull from private registry with secret [NodeConformance]", func() {
|
||||
framework.SkipUnlessNodeOSDistroIs("windows")
|
||||
image := "gcr.io/authenticated-image-pulling/windows-nanoserver:v1"
|
||||
image := imageutils.GetE2EImage(imageutils.AuthenticatedWindowsNanoServer)
|
||||
imagePullTest(image, true, v1.PodRunning, false, true)
|
||||
})
|
||||
})
|
||||
|
@ -28,6 +28,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -145,7 +146,7 @@ func StackdriverExporterPod(podName, namespace, podLabel, metricName string, met
|
||||
func stackdriverExporterContainerSpec(name string, namespace string, metricName string, metricValue int64) corev1.Container {
|
||||
return corev1.Container{
|
||||
Name: name,
|
||||
Image: "k8s.gcr.io/sd-dummy-exporter:v0.2.0",
|
||||
Image: imageutils.GetE2EImage(imageutils.SdDummyExporter),
|
||||
ImagePullPolicy: corev1.PullPolicy("Always"),
|
||||
Command: []string{
|
||||
"/bin/sh",
|
||||
@ -214,7 +215,7 @@ func prometheusExporterPodSpec(metricName string, metricValue int64, port int32)
|
||||
Containers: []corev1.Container{
|
||||
{
|
||||
Name: "prometheus-exporter",
|
||||
Image: "k8s.gcr.io/prometheus-dummy-exporter:v0.1.0",
|
||||
Image: imageutils.GetE2EImage(imageutils.PrometheusDummyExporter),
|
||||
ImagePullPolicy: corev1.PullPolicy("Always"),
|
||||
Command: []string{"/prometheus_dummy_exporter", "--metric-name=" + metricName,
|
||||
fmt.Sprintf("--metric-value=%v", metricValue), fmt.Sprintf("=--port=%d", port)},
|
||||
@ -222,7 +223,7 @@ func prometheusExporterPodSpec(metricName string, metricValue int64, port int32)
|
||||
},
|
||||
{
|
||||
Name: "prometheus-to-sd",
|
||||
Image: "k8s.gcr.io/prometheus-to-sd:v0.5.0",
|
||||
Image: imageutils.GetE2EImage(imageutils.PrometheusToSd),
|
||||
ImagePullPolicy: corev1.PullPolicy("Always"),
|
||||
Command: []string{"/monitor", fmt.Sprintf("--source=:http://localhost:%d", port),
|
||||
"--stackdriver-prefix=custom.googleapis.com", "--pod-id=$(POD_ID)", "--namespace-id=$(POD_NAMESPACE)"},
|
||||
|
@ -295,7 +295,7 @@ var _ = SIGDescribe("Network", func() {
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "startup-script",
|
||||
Image: "gcr.io/google-containers/startup-script:v1",
|
||||
Image: imageutils.GetE2EImage(imageutils.StartupScript),
|
||||
Command: []string{
|
||||
"bash", "-c", "while true; do sleep 2; nc boom-server 9000& done",
|
||||
},
|
||||
|
@ -15,6 +15,7 @@ go_library(
|
||||
"//test/e2e/framework:go_default_library",
|
||||
"//test/e2e/framework/ingress:go_default_library",
|
||||
"//test/e2e/framework/providers/gce:go_default_library",
|
||||
"//test/utils/image:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -28,6 +28,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
"k8s.io/kubernetes/test/e2e/framework/ingress"
|
||||
@ -453,7 +454,7 @@ func generateScaleTestBackendDeploymentSpec(numReplicas int32) *apps.Deployment
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: scaleTestBackendName,
|
||||
Image: "k8s.gcr.io/echoserver:1.10",
|
||||
Image: imageutils.GetE2EImage(imageutils.EchoServer),
|
||||
Ports: []v1.ContainerPort{{ContainerPort: 8080}},
|
||||
ReadinessProbe: &v1.Probe{
|
||||
Handler: v1.Handler{
|
||||
|
@ -19,10 +19,6 @@ package scheduling
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
// ensure libs have a chance to initialize
|
||||
_ "github.com/stretchr/testify/assert"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
@ -33,6 +29,15 @@ import (
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||
testutils "k8s.io/kubernetes/test/utils"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
// ensure libs have a chance to initialize
|
||||
_ "github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
pauseImage = imageutils.GetE2EImage(imageutils.Pause)
|
||||
)
|
||||
|
||||
func getTestTaint() v1.Taint {
|
||||
@ -61,7 +66,7 @@ func createPodForTaintsTest(hasToleration bool, tolerationSeconds int, podName,
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "pause",
|
||||
Image: "k8s.gcr.io/pause:3.1",
|
||||
Image: pauseImage,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -80,7 +85,7 @@ func createPodForTaintsTest(hasToleration bool, tolerationSeconds int, podName,
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "pause",
|
||||
Image: "k8s.gcr.io/pause:3.1",
|
||||
Image: pauseImage,
|
||||
},
|
||||
},
|
||||
Tolerations: []v1.Toleration{{Key: "kubernetes.io/e2e-evict-taint-key", Value: "evictTaintVal", Effect: v1.TaintEffectNoExecute}},
|
||||
@ -99,7 +104,7 @@ func createPodForTaintsTest(hasToleration bool, tolerationSeconds int, podName,
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "pause",
|
||||
Image: "k8s.gcr.io/pause:3.1",
|
||||
Image: pauseImage,
|
||||
},
|
||||
},
|
||||
// default - tolerate forever
|
||||
|
@ -26,9 +26,12 @@ import (
|
||||
|
||||
// RegistryList holds public and private image registries
|
||||
type RegistryList struct {
|
||||
GcAuthenticatedRegistry string `yaml:"gcAuthenticatedRegistry"`
|
||||
DockerLibraryRegistry string `yaml:"dockerLibraryRegistry"`
|
||||
E2eRegistry string `yaml:"e2eRegistry"`
|
||||
InvalidRegistry string `yaml:"invalidRegistry"`
|
||||
GcRegistry string `yaml:"gcRegistry"`
|
||||
GoogleContainerRegistry string `yaml:"googleContainerRegistry"`
|
||||
PrivateRegistry string `yaml:"privateRegistry"`
|
||||
SampleRegistry string `yaml:"sampleRegistry"`
|
||||
}
|
||||
@ -57,9 +60,12 @@ func (i *Config) SetVersion(version string) {
|
||||
|
||||
func initReg() RegistryList {
|
||||
registry := RegistryList{
|
||||
GcAuthenticatedRegistry: "gcr.io/authenticated-image-pulling",
|
||||
DockerLibraryRegistry: "docker.io/library",
|
||||
E2eRegistry: "gcr.io/kubernetes-e2e-test-images",
|
||||
InvalidRegistry: "invalid.com/invalid",
|
||||
GcRegistry: "k8s.gcr.io",
|
||||
GoogleContainerRegistry: "gcr.io/google-containers",
|
||||
PrivateRegistry: "gcr.io/k8s-authenticated-test",
|
||||
SampleRegistry: "gcr.io/google-samples",
|
||||
}
|
||||
@ -84,7 +90,10 @@ var (
|
||||
registry = initReg()
|
||||
dockerLibraryRegistry = registry.DockerLibraryRegistry
|
||||
e2eRegistry = registry.E2eRegistry
|
||||
gcAuthenticatedRegistry = registry.GcAuthenticatedRegistry
|
||||
gcRegistry = registry.GcRegistry
|
||||
googleContainerRegistry = registry.GoogleContainerRegistry
|
||||
invalidRegistry = registry.InvalidRegistry
|
||||
// PrivateRegistry is an image repository that requires authentication
|
||||
PrivateRegistry = registry.PrivateRegistry
|
||||
sampleRegistry = registry.SampleRegistry
|
||||
@ -100,12 +109,18 @@ const (
|
||||
AdmissionWebhook
|
||||
// Agnhost image
|
||||
Agnhost
|
||||
// Alpine image
|
||||
Alpine
|
||||
// APIServer image
|
||||
APIServer
|
||||
// AppArmorLoader image
|
||||
AppArmorLoader
|
||||
// AuditProxy image
|
||||
AuditProxy
|
||||
// AuthenticatedAlpine image
|
||||
AuthenticatedAlpine
|
||||
// AuthenticatedWindowsNanoServer image
|
||||
AuthenticatedWindowsNanoServer
|
||||
// BusyBox image
|
||||
BusyBox
|
||||
// CheckMetadataConcealment image
|
||||
@ -116,6 +131,8 @@ const (
|
||||
CudaVectorAdd2
|
||||
// Dnsutils image
|
||||
Dnsutils
|
||||
// DebianBase image
|
||||
DebianBase
|
||||
// EchoServer image
|
||||
EchoServer
|
||||
// EntrypointTester image
|
||||
@ -132,6 +149,10 @@ const (
|
||||
Hostexec
|
||||
// InClusterClient image
|
||||
InClusterClient
|
||||
// Invalid image
|
||||
Invalid
|
||||
// InvalidRegistryImage image
|
||||
InvalidRegistryImage
|
||||
// IpcUtils image
|
||||
IpcUtils
|
||||
// Iperf image
|
||||
@ -177,14 +198,22 @@ const (
|
||||
Porter
|
||||
// PortForwardTester image
|
||||
PortForwardTester
|
||||
// PrometheusDummyExporter image
|
||||
PrometheusDummyExporter
|
||||
// PrometheusToSd image
|
||||
PrometheusToSd
|
||||
// Redis image
|
||||
Redis
|
||||
// ResourceConsumer image
|
||||
ResourceConsumer
|
||||
// ResourceController image
|
||||
ResourceController
|
||||
// SdDummyExporter image
|
||||
SdDummyExporter
|
||||
// ServeHostname image
|
||||
ServeHostname
|
||||
// StartupScript image
|
||||
StartupScript
|
||||
// TestWebserver image
|
||||
TestWebserver
|
||||
// VolumeNFSServer image
|
||||
@ -195,6 +224,8 @@ const (
|
||||
VolumeGlusterServer
|
||||
// VolumeRBDServer image
|
||||
VolumeRBDServer
|
||||
// WindowsNanoServer image
|
||||
WindowsNanoServer
|
||||
)
|
||||
|
||||
func initImageConfigs() map[int]Config {
|
||||
@ -202,6 +233,8 @@ func initImageConfigs() map[int]Config {
|
||||
configs[CRDConversionWebhook] = Config{e2eRegistry, "crd-conversion-webhook", "1.13rev2"}
|
||||
configs[AdmissionWebhook] = Config{e2eRegistry, "webhook", "1.15v1"}
|
||||
configs[Agnhost] = Config{e2eRegistry, "agnhost", "1.0"}
|
||||
configs[Alpine] = Config{dockerLibraryRegistry, "alpine", "3.7"}
|
||||
configs[AuthenticatedAlpine] = Config{gcAuthenticatedRegistry, "alpine", "3.7"}
|
||||
configs[APIServer] = Config{e2eRegistry, "sample-apiserver", "1.10"}
|
||||
configs[AppArmorLoader] = Config{e2eRegistry, "apparmor-loader", "1.0"}
|
||||
configs[AuditProxy] = Config{e2eRegistry, "audit-proxy", "1.0"}
|
||||
@ -210,6 +243,7 @@ func initImageConfigs() map[int]Config {
|
||||
configs[CudaVectorAdd] = Config{e2eRegistry, "cuda-vector-add", "1.0"}
|
||||
configs[CudaVectorAdd2] = Config{e2eRegistry, "cuda-vector-add", "2.0"}
|
||||
configs[Dnsutils] = Config{e2eRegistry, "dnsutils", "1.1"}
|
||||
configs[DebianBase] = Config{googleContainerRegistry, "debian-base", "0.4.1"}
|
||||
configs[EchoServer] = Config{e2eRegistry, "echoserver", "2.2"}
|
||||
configs[EntrypointTester] = Config{e2eRegistry, "entrypoint-tester", "1.0"}
|
||||
configs[Etcd] = Config{gcRegistry, "etcd", "3.3.10"}
|
||||
@ -218,6 +252,8 @@ func initImageConfigs() map[int]Config {
|
||||
configs[GBRedisSlave] = Config{sampleRegistry, "gb-redisslave", "v3"}
|
||||
configs[Hostexec] = Config{e2eRegistry, "hostexec", "1.1"}
|
||||
configs[InClusterClient] = Config{e2eRegistry, "inclusterclient", "1.0"}
|
||||
configs[Invalid] = Config{gcRegistry, "invalid-image", "invalid-tag"}
|
||||
configs[InvalidRegistryImage] = Config{invalidRegistry, "alpine", "3.1"}
|
||||
configs[IpcUtils] = Config{e2eRegistry, "ipc-utils", "1.0"}
|
||||
configs[Iperf] = Config{e2eRegistry, "iperf", "1.0"}
|
||||
configs[JessieDnsutils] = Config{e2eRegistry, "jessie-dnsutils", "1.0"}
|
||||
@ -241,15 +277,20 @@ func initImageConfigs() map[int]Config {
|
||||
configs[Perl] = Config{dockerLibraryRegistry, "perl", "5.26"}
|
||||
configs[Porter] = Config{e2eRegistry, "porter", "1.0"}
|
||||
configs[PortForwardTester] = Config{e2eRegistry, "port-forward-tester", "1.0"}
|
||||
configs[PrometheusDummyExporter] = Config{e2eRegistry, "prometheus-dummy-exporter", "v0.1.0"}
|
||||
configs[PrometheusToSd] = Config{e2eRegistry, "prometheus-to-sd", "v0.5.0"}
|
||||
configs[Redis] = Config{e2eRegistry, "redis", "1.0"}
|
||||
configs[ResourceConsumer] = Config{e2eRegistry, "resource-consumer", "1.5"}
|
||||
configs[ResourceController] = Config{e2eRegistry, "resource-consumer-controller", "1.0"}
|
||||
configs[SdDummyExporter] = Config{gcRegistry, "sd-dummy-exporter", "v0.2.0"}
|
||||
configs[ServeHostname] = Config{e2eRegistry, "serve-hostname", "1.1"}
|
||||
configs[StartupScript] = Config{googleContainerRegistry, "startup-script", "v1"}
|
||||
configs[TestWebserver] = Config{e2eRegistry, "test-webserver", "1.0"}
|
||||
configs[VolumeNFSServer] = Config{e2eRegistry, "volume/nfs", "1.0"}
|
||||
configs[VolumeISCSIServer] = Config{e2eRegistry, "volume/iscsi", "2.0"}
|
||||
configs[VolumeGlusterServer] = Config{e2eRegistry, "volume/gluster", "1.0"}
|
||||
configs[VolumeRBDServer] = Config{e2eRegistry, "volume/rbd", "1.0.1"}
|
||||
configs[WindowsNanoServer] = Config{e2eRegistry, "windows-nanoserver", "v1"}
|
||||
return configs
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user