Merge branch 'master' of github.com:kubernetes/minikube into fix-download-test
commit
3e7a72129f
|
@ -40,14 +40,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDownloadOnly(t *testing.T) {
|
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
|
// Stores the startup run result for later error messages
|
||||||
var rrr *RunResult
|
var rrr *RunResult
|
||||||
|
profile := UniqueProfileName("download-only")
|
||||||
profile := UniqueProfileName(r)
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(30))
|
ctx, cancel := context.WithTimeout(context.Background(), Minutes(30))
|
||||||
defer Cleanup(t, profile, cancel)
|
defer Cleanup(t, profile, cancel)
|
||||||
|
containerRuntime := ContainerRuntime()
|
||||||
|
|
||||||
versions := []string{
|
versions := []string{
|
||||||
constants.OldestKubernetesVersion,
|
constants.OldestKubernetesVersion,
|
||||||
|
@ -66,7 +64,7 @@ func TestDownloadOnly(t *testing.T) {
|
||||||
|
|
||||||
t.Run("check json events", func(t *testing.T) {
|
t.Run("check json events", func(t *testing.T) {
|
||||||
// --force to avoid uid check
|
// --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...))
|
rt, err := Run(t, exec.CommandContext(ctx, Target(), args...))
|
||||||
if rrr == nil {
|
if rrr == nil {
|
||||||
// Preserve the initial run-result for debugging
|
// Preserve the initial run-result for debugging
|
||||||
|
@ -98,9 +96,9 @@ func TestDownloadOnly(t *testing.T) {
|
||||||
if NoneDriver() {
|
if NoneDriver() {
|
||||||
t.Skip("None driver does not have preload")
|
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
|
// 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)
|
t.Errorf("failed to verify preloaded tarball file exists: %v", err)
|
||||||
}
|
}
|
||||||
preloadExists = true
|
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)
|
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)
|
t.Errorf("failed to delete. args: %q: %v", rr.Command(), err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDownloadOnlyKic(t *testing.T) {
|
func TestDownloadOnlyKic(t *testing.T) {
|
||||||
|
|
|
@ -26,14 +26,10 @@ import (
|
||||||
"testing"
|
"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) {
|
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)
|
MaybeParallel(t)
|
||||||
|
rt := ContainerRuntime()
|
||||||
if rt != "docker" && arm64Platform() {
|
if rt != "docker" && arm64Platform() {
|
||||||
t.Skipf("skipping %s - only docker runtime supported on arm64. See https://github.com/kubernetes/minikube/issues/10144", t.Name())
|
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))
|
ctx, cancel := context.WithTimeout(context.Background(), Minutes(15))
|
||||||
defer CleanupWithLogs(t, profile, cancel)
|
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()...)
|
startArgs = append(startArgs, StartArgs()...)
|
||||||
c := exec.CommandContext(ctx, Target(), startArgs...)
|
c := exec.CommandContext(ctx, Target(), startArgs...)
|
||||||
env := os.Environ()
|
env := os.Environ()
|
||||||
|
@ -60,7 +56,4 @@ func TestOffline(t *testing.T) {
|
||||||
// Fatal so that we may collect logs before stop/delete steps
|
// Fatal so that we may collect logs before stop/delete steps
|
||||||
t.Fatalf("%s failed: %v", rr.Command(), err)
|
t.Fatalf("%s failed: %v", rr.Command(), err)
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,15 @@ spec:
|
||||||
app: mysql
|
app: mysql
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: mysql:5.6
|
- image: mysql:5.7
|
||||||
name: mysql
|
name: mysql
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "512Mi"
|
||||||
|
cpu: "600m"
|
||||||
|
limits:
|
||||||
|
memory: "700Mi"
|
||||||
|
cpu: "700m"
|
||||||
env:
|
env:
|
||||||
# Use secret in real usage
|
# Use secret in real usage
|
||||||
- name: MYSQL_ROOT_PASSWORD
|
- name: MYSQL_ROOT_PASSWORD
|
||||||
|
|
Loading…
Reference in New Issue