mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-01 22:34:14 +00:00
tests: Removed hardcoded images from yaml files
Some tests use .yaml files to deploy pods, which have hardcoded images. Those images cannot be used for Windows containers. The image names can be injected by the tests themselves, based on the configured registries.
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
"k8s.io/apiserver/pkg/authentication/serviceaccount"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||
commonutils "k8s.io/kubernetes/test/e2e/common"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
"k8s.io/kubernetes/test/e2e/framework/testfiles"
|
||||
|
||||
@@ -62,8 +63,8 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
||||
framework.KubeDescribe("Liveness", func() {
|
||||
It("liveness pods should be automatically restarted", func() {
|
||||
test := "test/fixtures/doc-yaml/user-guide/liveness"
|
||||
execYaml := readFile(test, "exec-liveness.yaml")
|
||||
httpYaml := readFile(test, "http-liveness.yaml")
|
||||
execYaml := readFile(test, "exec-liveness.yaml.in")
|
||||
httpYaml := readFile(test, "http-liveness.yaml.in")
|
||||
nsFlag := fmt.Sprintf("--namespace=%v", ns)
|
||||
|
||||
framework.RunKubectlOrDieInput(execYaml, "create", "-f", "-", nsFlag)
|
||||
@@ -111,7 +112,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
||||
It("should create a pod that reads a secret", func() {
|
||||
test := "test/fixtures/doc-yaml/user-guide/secrets"
|
||||
secretYaml := readFile(test, "secret.yaml")
|
||||
podYaml := readFile(test, "secret-pod.yaml")
|
||||
podYaml := readFile(test, "secret-pod.yaml.in")
|
||||
|
||||
nsFlag := fmt.Sprintf("--namespace=%v", ns)
|
||||
podName := "secret-test-pod"
|
||||
@@ -131,7 +132,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
||||
framework.KubeDescribe("Downward API", func() {
|
||||
It("should create a pod that prints his name and namespace", func() {
|
||||
test := "test/fixtures/doc-yaml/user-guide/downward-api"
|
||||
podYaml := readFile(test, "dapi-pod.yaml")
|
||||
podYaml := readFile(test, "dapi-pod.yaml.in")
|
||||
nsFlag := fmt.Sprintf("--namespace=%v", ns)
|
||||
podName := "dapi-test-pod"
|
||||
|
||||
@@ -151,5 +152,5 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
||||
|
||||
func readFile(test, file string) string {
|
||||
from := filepath.Join(test, file)
|
||||
return string(testfiles.ReadOrDie(from, Fail))
|
||||
return commonutils.SubstituteImageName(string(testfiles.ReadOrDie(from, Fail)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user