Skip to content

Commit 9a3b336

Browse files
committed
Merge branch 'master' of github.com:kubernetes/minikube into mkbot-0.0.22
2 parents 96d5ad7 + 9e16dd8 commit 9a3b336

File tree

7 files changed

+281
-10
lines changed

7 files changed

+281
-10
lines changed

.github/workflows/master.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,109 @@ jobs:
282282
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
283283
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
284284
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
285+
286+
functional_podman_ubuntu:
287+
needs: [ build_minikube ]
288+
env:
289+
TIME_ELAPSED: time
290+
JOB_NAME: functional_podman_ubuntu
291+
GOPOGH_RESULT: ""
292+
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
293+
runs-on: ubuntu-20.04
294+
steps:
295+
- name: Install kubectl
296+
shell: bash
297+
run: |
298+
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl
299+
sudo install kubectl /usr/local/bin/kubectl
300+
kubectl version --client=true
301+
302+
- name: Install Podman
303+
shell: bash
304+
run: |
305+
sudo apt update
306+
sudo apt install -y podman
307+
echo "--------------------------"
308+
podman version || true
309+
echo "--------------------------"
310+
podman info || true
311+
echo "--------------------------"
312+
podman system df || true
313+
echo "--------------------------"
314+
podman system info --format='{{json .}}'|| true
315+
echo "--------------------------"
316+
podman ps || true
317+
echo "--------------------------"
318+
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
319+
- uses: actions/setup-go@v2
320+
with:
321+
go-version: ${{env.GO_VERSION}}
322+
stable: true
323+
- name: Install gopogh
324+
shell: bash
325+
run: |
326+
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.6.0/gopogh-linux-amd64
327+
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
328+
- name: Download Binaries
329+
uses: actions/download-artifact@v1
330+
with:
331+
name: minikube_binaries
332+
- name: Run Integration Test
333+
continue-on-error: false
334+
# bash {0} to allow test to continue to next step. in case of
335+
shell: bash {0}
336+
run: |
337+
cd minikube_binaries
338+
mkdir -p report
339+
mkdir -p testhome
340+
chmod a+x e2e-*
341+
chmod a+x minikube-*
342+
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
343+
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
344+
START_TIME=$(date -u +%s)
345+
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=podman -v=6 --alsologtostderr -test.run TestFunctional -test.timeout=10m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
346+
END_TIME=$(date -u +%s)
347+
TIME_ELAPSED=$(($END_TIME-$START_TIME))
348+
min=$((${TIME_ELAPSED}/60))
349+
sec=$((${TIME_ELAPSED}%60))
350+
TIME_ELAPSED="${min} min $sec seconds "
351+
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
352+
- name: Generate HTML Report
353+
shell: bash
354+
run: |
355+
cd minikube_binaries
356+
export PATH=${PATH}:`go env GOPATH`/bin
357+
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
358+
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
359+
echo status: ${STAT}
360+
FailNum=$(echo $STAT | jq '.NumberOfFail')
361+
TestsNum=$(echo $STAT | jq '.NumberOfTests')
362+
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
363+
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
364+
echo 'STAT<<EOF' >> $GITHUB_ENV
365+
echo "${STAT}" >> $GITHUB_ENV
366+
echo 'EOF' >> $GITHUB_ENV
367+
- uses: actions/upload-artifact@v1
368+
with:
369+
name: functional_podman_ubuntu
370+
path: minikube_binaries/report
371+
- name: The End Result functional_podman_ubuntu
372+
shell: bash
373+
run: |
374+
echo ${GOPOGH_RESULT}
375+
numFail=$(echo $STAT | jq '.NumberOfFail')
376+
numPass=$(echo $STAT | jq '.NumberOfPass')
377+
echo "*******************${numPass} Passes :) *******************"
378+
echo $STAT | jq '.PassedTests' || true
379+
echo "*******************************************************"
380+
echo "---------------- ${numFail} Failures :( ----------------------------"
381+
echo $STAT | jq '.FailedTests' || true
382+
echo "-------------------------------------------------------"
383+
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
384+
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
385+
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
386+
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
387+
285388
functional_virtualbox_macos:
286389
needs: [build_minikube]
287390
env:
@@ -882,6 +985,7 @@ jobs:
882985
functional_docker_ubuntu,
883986
functional_docker_containerd_ubuntu,
884987
functional_docker_ubuntu_arm64,
988+
functional_podman_ubuntu,
885989
functional_virtualbox_macos,
886990
functional_docker_windows,
887991
functional_hyperv_windows,
@@ -900,6 +1004,7 @@ jobs:
9001004
cp -r ./functional_docker_ubuntu ./all_reports/
9011005
cp -r ./functional_docker_containerd_ubuntu ./all_reports/
9021006
cp -r ./functional_docker_ubuntu_arm64 ./all_reports/
1007+
cp -r ./functional_podman_ubuntu ./all_reports/
9031008
cp -r ./functional_virtualbox_macos ./all_reports/
9041009
cp -r ./functional_docker_windows ./all_reports/
9051010
cp -r ./functional_hyperv_windows ./all_reports/

.github/workflows/pr.yml

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
go-version: ${{env.GO_VERSION}}
118118
stable: true
119119
- name: Install gopogh
120-
121120
shell: bash
122121
run: |
123122
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.6.0/gopogh-linux-amd64
@@ -280,6 +279,109 @@ jobs:
280279
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
281280
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
282281
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
282+
283+
functional_podman_ubuntu:
284+
needs: [ build_minikube ]
285+
env:
286+
TIME_ELAPSED: time
287+
JOB_NAME: functional_podman_ubuntu
288+
GOPOGH_RESULT: ""
289+
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
290+
runs-on: ubuntu-20.04
291+
steps:
292+
- name: Install kubectl
293+
shell: bash
294+
run: |
295+
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl
296+
sudo install kubectl /usr/local/bin/kubectl
297+
kubectl version --client=true
298+
299+
- name: Install Podman
300+
shell: bash
301+
run: |
302+
sudo apt update
303+
sudo apt install -y podman
304+
echo "--------------------------"
305+
podman version || true
306+
echo "--------------------------"
307+
podman info || true
308+
echo "--------------------------"
309+
podman system df || true
310+
echo "--------------------------"
311+
podman system info --format='{{json .}}'|| true
312+
echo "--------------------------"
313+
podman ps || true
314+
echo "--------------------------"
315+
# go 1.14.6+ is needed because of this bug https://github.com/golang/go/issues/39308
316+
- uses: actions/setup-go@v2
317+
with:
318+
go-version: ${{env.GO_VERSION}}
319+
stable: true
320+
- name: Install gopogh
321+
shell: bash
322+
run: |
323+
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.6.0/gopogh-linux-amd64
324+
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
325+
- name: Download Binaries
326+
uses: actions/download-artifact@v1
327+
with:
328+
name: minikube_binaries
329+
- name: Run Integration Test
330+
continue-on-error: false
331+
# bash {0} to allow test to continue to next step. in case of
332+
shell: bash {0}
333+
run: |
334+
cd minikube_binaries
335+
mkdir -p report
336+
mkdir -p testhome
337+
chmod a+x e2e-*
338+
chmod a+x minikube-*
339+
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
340+
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
341+
START_TIME=$(date -u +%s)
342+
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=podman -v=6 --alsologtostderr -test.run TestFunctional -test.timeout=10m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
343+
END_TIME=$(date -u +%s)
344+
TIME_ELAPSED=$(($END_TIME-$START_TIME))
345+
min=$((${TIME_ELAPSED}/60))
346+
sec=$((${TIME_ELAPSED}%60))
347+
TIME_ELAPSED="${min} min $sec seconds "
348+
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
349+
- name: Generate HTML Report
350+
shell: bash
351+
run: |
352+
cd minikube_binaries
353+
export PATH=${PATH}:`go env GOPATH`/bin
354+
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
355+
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
356+
echo status: ${STAT}
357+
FailNum=$(echo $STAT | jq '.NumberOfFail')
358+
TestsNum=$(echo $STAT | jq '.NumberOfTests')
359+
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
360+
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
361+
echo 'STAT<<EOF' >> $GITHUB_ENV
362+
echo "${STAT}" >> $GITHUB_ENV
363+
echo 'EOF' >> $GITHUB_ENV
364+
- uses: actions/upload-artifact@v1
365+
with:
366+
name: functional_podman_ubuntu
367+
path: minikube_binaries/report
368+
- name: The End Result functional_podman_ubuntu
369+
shell: bash
370+
run: |
371+
echo ${GOPOGH_RESULT}
372+
numFail=$(echo $STAT | jq '.NumberOfFail')
373+
numPass=$(echo $STAT | jq '.NumberOfPass')
374+
echo "*******************${numPass} Passes :) *******************"
375+
echo $STAT | jq '.PassedTests' || true
376+
echo "*******************************************************"
377+
echo "---------------- ${numFail} Failures :( ----------------------------"
378+
echo $STAT | jq '.FailedTests' || true
379+
echo "-------------------------------------------------------"
380+
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
381+
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
382+
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
383+
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
384+
283385
functional_virtualbox_macos:
284386
needs: [build_minikube]
285387
env:
@@ -879,6 +981,7 @@ jobs:
879981
[
880982
functional_docker_ubuntu,
881983
functional_docker_containerd_ubuntu,
984+
functional_podman_ubuntu,
882985
functional_docker_ubuntu_arm64,
883986
functional_virtualbox_macos,
884987
functional_docker_windows,
@@ -897,6 +1000,7 @@ jobs:
8971000
ls -lah
8981001
cp -r ./functional_docker_ubuntu ./all_reports/
8991002
cp -r ./functional_docker_containerd_ubuntu ./all_reports/
1003+
cp -r ./functional_podman_ubuntu ./all_reports/
9001004
cp -r ./functional_docker_ubuntu_arm64 ./all_reports/
9011005
cp -r ./functional_virtualbox_macos ./all_reports/
9021006
cp -r ./functional_docker_windows ./all_reports/

hack/jenkins/common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ function retry_github_status() {
447447

448448
while [[ "${attempt}" -lt 8 ]]; do
449449
local out=$(mktemp)
450-
code=$(curl -o "${out}" -s --write-out "%{http_code}" -L \
451-
"https://api.github.com/repos/kubernetes/minikube/statuses/${commit}?access_token=${token}" \
450+
code=$(curl -o "${out}" -s --write-out "%{http_code}" -L -u minikube-bot:${token} \
451+
"https://api.github.com/repos/kubernetes/minikube/statuses/${commit}" \
452452
-H "Content-Type: application/json" \
453453
-X POST \
454454
-d "{\"state\": \"${state}\", \"description\": \"Jenkins: ${desc}\", \"target_url\": \"${target}\", \"context\": \"${context}\"}" || echo 999)

hack/jenkins/run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ function retry_github_status() {
428428

429429
while [[ "${attempt}" -lt 8 ]]; do
430430
local out=$(mktemp)
431-
code=$(curl -o "${out}" -s --write-out "%{http_code}" -L \
432-
"https://api.github.com/repos/kubernetes/minikube/statuses/${commit}?access_token=${token}" \
431+
code=$(curl -o "${out}" -s --write-out "%{http_code}" -L -u minikube-bot:${token} \
432+
"https://api.github.com/repos/kubernetes/minikube/statuses/${commit}" \
433433
-H "Content-Type: application/json" \
434434
-X POST \
435435
-d "{\"state\": \"${state}\", \"description\": \"Jenkins: ${desc}\", \"target_url\": \"${target}\", \"context\": \"${context}\"}" || echo 999)

site/content/en/docs/contrib/tests.en.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ validateBuildImage makes sures that `minikube image build` works as expected
8888
validateListImages makes sures that `minikube image ls` works as expected
8989

9090
#### validateDockerEnv
91-
check functionality of minikube after evaling docker-env
91+
check functionality of minikube after evaluating docker-env
92+
93+
#### validatePodmanEnv
94+
check functionality of minikube after evaluating podman-env
9295

9396
#### validateStartWithProxy
9497
validateStartWithProxy makes sure minikube start respects the HTTP_PROXY environment variable
@@ -351,4 +354,4 @@ TestKubernetesUpgrade upgrades Kubernetes from oldest to newest
351354
## TestMissingContainerUpgrade
352355
TestMissingContainerUpgrade tests a Docker upgrade where the underlying container is missing
353356

354-
TEST COUNT: 112
357+
TEST COUNT: 113

test/integration/functional_test.go

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import (
4646
"k8s.io/minikube/pkg/util/retry"
4747

4848
"github.com/elazarl/goproxy"
49-
retryablehttp "github.com/hashicorp/go-retryablehttp"
49+
"github.com/hashicorp/go-retryablehttp"
5050
"github.com/otiai10/copy"
5151
"github.com/phayes/freeport"
5252
"github.com/pkg/errors"
@@ -131,6 +131,7 @@ func TestFunctional(t *testing.T) {
131131
{"CertSync", validateCertSync},
132132
{"UpdateContextCmd", validateUpdateContextCmd},
133133
{"DockerEnv", validateDockerEnv},
134+
{"PodmanEnv", validatePodmanEnv},
134135
{"NodeLabels", validateNodeLabels},
135136
{"LoadImage", validateLoadImage},
136137
{"RemoveImage", validateRemoveImage},
@@ -399,8 +400,7 @@ func validateListImages(ctx context.Context, t *testing.T, profile string) {
399400
}
400401
}
401402

402-
// check functionality of minikube after evaling docker-env
403-
// TODO: Add validatePodmanEnv for crio runtime: #10231
403+
// check functionality of minikube after evaluating docker-env
404404
func validateDockerEnv(ctx context.Context, t *testing.T, profile string) {
405405
if NoneDriver() {
406406
t.Skipf("none driver does not support docker-env")
@@ -460,6 +460,61 @@ func validateDockerEnv(ctx context.Context, t *testing.T, profile string) {
460460
}
461461
}
462462

463+
// check functionality of minikube after evaluating podman-env
464+
func validatePodmanEnv(ctx context.Context, t *testing.T, profile string) {
465+
if NoneDriver() {
466+
t.Skipf("none driver does not support podman-env")
467+
}
468+
469+
if cr := ContainerRuntime(); cr != "podman" {
470+
t.Skipf("only validate podman env with docker container runtime, currently testing %s", cr)
471+
}
472+
473+
if runtime.GOOS != "linux" {
474+
t.Skipf("only validate podman env on linux, currently testing %s", runtime.GOOS)
475+
}
476+
477+
defer PostMortemLogs(t, profile)
478+
479+
mctx, cancel := context.WithTimeout(ctx, Seconds(120))
480+
defer cancel()
481+
482+
c := exec.CommandContext(mctx, "/bin/bash", "-c", "eval $("+Target()+" -p "+profile+" podman-env) && "+Target()+" status -p "+profile)
483+
// we should be able to get minikube status with a bash which evaluated podman-env
484+
rr, err := Run(t, c)
485+
486+
if mctx.Err() == context.DeadlineExceeded {
487+
t.Errorf("failed to run the command by deadline. exceeded timeout. %s", rr.Command())
488+
}
489+
if err != nil {
490+
t.Fatalf("failed to do status after eval-ing podman-env. error: %v", err)
491+
}
492+
if !strings.Contains(rr.Output(), "Running") {
493+
t.Fatalf("expected status output to include 'Running' after eval podman-env but got: *%s*", rr.Output())
494+
}
495+
if !strings.Contains(rr.Output(), "in-use") {
496+
t.Fatalf("expected status output to include `in-use` after eval podman-env but got *%s*", rr.Output())
497+
}
498+
499+
mctx, cancel = context.WithTimeout(ctx, Seconds(60))
500+
defer cancel()
501+
// do a eval $(minikube -p profile podman-env) and check if we are point to docker inside minikube
502+
c = exec.CommandContext(mctx, "/bin/bash", "-c", "eval $("+Target()+" -p "+profile+" podman-env) && docker images")
503+
rr, err = Run(t, c)
504+
505+
if mctx.Err() == context.DeadlineExceeded {
506+
t.Errorf("failed to run the command in 30 seconds. exceeded 30s timeout. %s", rr.Command())
507+
}
508+
if err != nil {
509+
t.Fatalf("failed to run minikube podman-env. args %q : %v ", rr.Command(), err)
510+
}
511+
512+
expectedImgInside := "gcr.io/k8s-minikube/storage-provisioner"
513+
if !strings.Contains(rr.Output(), expectedImgInside) {
514+
t.Fatalf("expected 'docker images' to have %q inside minikube. but the output is: *%s*", expectedImgInside, rr.Output())
515+
}
516+
}
517+
463518
// validateStartWithProxy makes sure minikube start respects the HTTP_PROXY environment variable
464519
func validateStartWithProxy(ctx context.Context, t *testing.T, profile string) {
465520
defer PostMortemLogs(t, profile)

test/integration/functional_test_mount_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // no
5656
t.Skip("skipping: mount broken on windows: https://github.com/kubernetes/minikube/issues/8303")
5757
}
5858

59+
if GithubActionRunner() && PodmanDriver() {
60+
t.Skip("skipping: https://github.com/kubernetes/minikube/issues/11293")
61+
}
62+
5963
tempDir, err := ioutil.TempDir("", "mounttest")
6064
defer func() { // clean up tempdir
6165
err := os.RemoveAll(tempDir)

0 commit comments

Comments
 (0)