Skip to content

Commit

Permalink
Try swapping registry:2 for the registry add-on
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmoor committed Dec 17, 2021
1 parent 889ee0e commit 6adda00
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration-layers-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ jobs:
- name: Run integration-test-layers
run: |
make travis-setup
make minikube-setup
make integration-test-layers
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
- name: Run integration-test-misc
run : |
make travis-setup
make minikube-setup
make integration-test-misc
1 change: 1 addition & 0 deletions .github/workflows/integration-run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ jobs:
- name: Run integration-test-run
run: |
make travis-setup
make minikube-setup
make integration-test-run
18 changes: 16 additions & 2 deletions integration/k8s-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,30 @@ spec:
spec:
hostNetwork: true
containers:
# - name: debug
# image: gcr.io/distroless/base:debug
# command: ["/busybox/sh", "-c"]
# args:
# - |
# echo LISTING WORKSPACE
# find /host-root -type f
# volumeMounts:
# - name: host-root
# mountPath: /host-root
- name: kaniko
image: localhost:5000/executor:latest
workingDir: /workspace
args: [ "--context=dir:///workspace",
"--destination={{.KanikoImage}}"]
volumeMounts:
- name: context
mountPath: /workspace
- name: context
mountPath: /workspace
restartPolicy: Never
volumes:
- name: context
hostPath:
path: {{.Context}}
# - name: host-root
# hostPath:
# path: /
backoffLimit: 1
4 changes: 2 additions & 2 deletions integration/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestK8s(t *testing.T) {
t.Logf("Waiting for K8s kaniko build job to finish: %s\n",
"job/kaniko-test-"+job.Name)

kubeWaitCmd := exec.Command("kubectl", "wait", "--for=condition=complete", "--timeout=5m",
kubeWaitCmd := exec.Command("kubectl", "wait", "--for=condition=complete", "--timeout=1m",
"job/kaniko-test-"+job.Name)
if out, errR := RunCommandWithoutTest(kubeWaitCmd); errR != nil {
t.Log(kubeWaitCmd.Args)
Expand All @@ -110,7 +110,7 @@ func TestK8s(t *testing.T) {
t.Log(string(outD))
}

logsCmd := exec.Command("kubectl", "logs", "job/kaniko-test-"+job.Name)
logsCmd := exec.Command("kubectl", "logs", "--all-containers", "job/kaniko-test-"+job.Name)
outL, errL := RunCommandWithoutTest(logsCmd)
if errL != nil {
t.Error(errL)
Expand Down
24 changes: 21 additions & 3 deletions scripts/minikube-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@

set -ex

curl -Lo minikube https://storage.googleapis.com/minikube-builds/master/minikube-linux-amd64
sudo install minikube /usr/local/bin/minikube
minikube start --profile=minikube --driver=docker
# conntrack is required for minikube 1.19 and higher for none driver
if ! conntrack --version &>/dev/null; then
echo "WARNING: No contrack is not installed"
sudo apt-get update -qq
sudo apt-get -qq -y install conntrack
fi

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/

sudo apt-get update
sudo apt-get install -y liblz4-tool
cat /proc/cpuinfo

minikube start --vm-driver=none --force
minikube status
minikube addons enable registry
kubectl cluster-info

kubectl port-forward --namespace kube-system service/registry 5000:80 &
1 change: 0 additions & 1 deletion scripts/travis-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubun
sudo apt-get update
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64 && chmod +x container-diff-linux-amd64 && sudo mv container-diff-linux-amd64 /usr/local/bin/container-diff
docker run -d -p 5000:5000 --restart always --name registry registry:2

mkdir -p $HOME/.docker/
echo '{}' > $HOME/.docker/config.json

0 comments on commit 6adda00

Please sign in to comment.