Merge branch 'master' of github.com:kubernetes/minikube into fix-download-test

pull/10219/head
Sharif Elgamal 2021-01-25 09:48:13 -08:00
commit 3e7a72129f
3 changed files with 164 additions and 166 deletions

View File

@ -40,14 +40,12 @@ import (
)
func TestDownloadOnly(t *testing.T) {
for _, r := range []string{"crio", "docker", "containerd"} {
t.Run(r, func(t *testing.T) {
// Stores the startup run result for later error messages
var rrr *RunResult
profile := UniqueProfileName(r)
profile := UniqueProfileName("download-only")
ctx, cancel := context.WithTimeout(context.Background(), Minutes(30))
defer Cleanup(t, profile, cancel)
containerRuntime := ContainerRuntime()
versions := []string{
constants.OldestKubernetesVersion,
@ -66,7 +64,7 @@ func TestDownloadOnly(t *testing.T) {
t.Run("check json events", func(t *testing.T) {
// --force to avoid uid check
args := append([]string{"start", "-o=json", "--download-only", "-p", profile, "--force", "--alsologtostderr", fmt.Sprintf("--kubernetes-version=%s", v), fmt.Sprintf("--container-runtime=%s", r)}, StartArgs()...)
args := append([]string{"start", "-o=json", "--download-only", "-p", profile, "--force", "--alsologtostderr", fmt.Sprintf("--kubernetes-version=%s", v), fmt.Sprintf("--container-runtime=%s", containerRuntime)}, StartArgs()...)
rt, err := Run(t, exec.CommandContext(ctx, Target(), args...))
if rrr == nil {
// Preserve the initial run-result for debugging
@ -98,9 +96,9 @@ func TestDownloadOnly(t *testing.T) {
if NoneDriver() {
t.Skip("None driver does not have preload")
}
if download.PreloadExists(v, r, true) {
if download.PreloadExists(v, containerRuntime, true) {
// Just make sure the tarball path exists
if _, err := os.Stat(download.TarballPath(v, r)); err != nil {
if _, err := os.Stat(download.TarballPath(v, containerRuntime)); err != nil {
t.Errorf("failed to verify preloaded tarball file exists: %v", err)
}
preloadExists = true
@ -158,6 +156,7 @@ func TestDownloadOnly(t *testing.T) {
t.Errorf("expected the file for binary exist at %q but got error %v", fp, err)
}
})
})
}
@ -185,8 +184,7 @@ func TestDownloadOnly(t *testing.T) {
t.Errorf("failed to delete. args: %q: %v", rr.Command(), err)
}
})
})
}
}
func TestDownloadOnlyKic(t *testing.T) {

View File

@ -26,14 +26,10 @@ import (
"testing"
)
// TestOffline makes sure minikube works without internet, once it the user has already cached the images, This test has to run after TestDownloadOnly!
// TestOffline makes sure minikube works without internet, once it the user has already cached the images, This test has to run after TestDownloadOnly
func TestOffline(t *testing.T) {
t.Run("group", func(t *testing.T) {
for _, rt := range []string{"docker", "crio", "containerd"} {
rt := rt
t.Run(rt, func(t *testing.T) {
MaybeParallel(t)
rt := ContainerRuntime()
if rt != "docker" && arm64Platform() {
t.Skipf("skipping %s - only docker runtime supported on arm64. See https://github.com/kubernetes/minikube/issues/10144", t.Name())
}
@ -46,7 +42,7 @@ func TestOffline(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), Minutes(15))
defer CleanupWithLogs(t, profile, cancel)
startArgs := []string{"start", "-p", profile, "--alsologtostderr", "-v=1", "--memory=2000", "--wait=true", "--container-runtime", rt}
startArgs := []string{"start", "-p", profile, "--alsologtostderr", "-v=1", "--memory=2000", "--wait=true"}
startArgs = append(startArgs, StartArgs()...)
c := exec.CommandContext(ctx, Target(), startArgs...)
env := os.Environ()
@ -60,7 +56,4 @@ func TestOffline(t *testing.T) {
// Fatal so that we may collect logs before stop/delete steps
t.Fatalf("%s failed: %v", rr.Command(), err)
}
})
}
})
}

View File

@ -24,8 +24,15 @@ spec:
app: mysql
spec:
containers:
- image: mysql:5.6
- image: mysql:5.7
name: mysql
resources:
requests:
memory: "512Mi"
cpu: "600m"
limits:
memory: "700Mi"
cpu: "700m"
env:
# Use secret in real usage
- name: MYSQL_ROOT_PASSWORD