Skip to content

Commit

Permalink
Allow-downgrades for dockerce and containerd (#1073)
Browse files Browse the repository at this point in the history
If dockerce or/and containerd is/are already present on the machine, then the setup script will not install them if the version installed is already higher than what we require, so I have added a allow-downgrades flag to the installation script

Signed-off-by: Yakul Garg <2000yeshu@gmail.com>

Co-authored-by: Yakul Garg <yakul@debian-BULLSEYE-live-builder-AMD64>
  • Loading branch information
2000yeshu and Yakul Garg committed Oct 15, 2021
1 parent ca58e4f commit 6764efa
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pkg/containerruntime/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Restart=always
EnvironmentFile=-/etc/environment
EOF
apt-get install -y containerd.io={{ .ContainerdVersion }}*
apt-get install -y --allow-downgrades containerd.io={{ .ContainerdVersion }}*
apt-mark hold containerd.io
systemctl daemon-reload
Expand Down
2 changes: 1 addition & 1 deletion pkg/containerruntime/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Restart=always
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
{{- if .ContainerdVersion }}
containerd.io={{ .ContainerdVersion }}* \
docker-ce-cli=5:{{ .DockerVersion }}* \
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y containerd.io=1.4*
apt-get install -y --allow-downgrades containerd.io=1.4*
apt-mark hold containerd.io
systemctl daemon-reload
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/dist-upgrade-on-boot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/multiple-dns-servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/multiple-ssh-keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/openstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/version-1.17.16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/version-1.18.14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/version-1.19.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/version-1.20.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/vsphere-mirrors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/vsphere-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down
2 changes: 1 addition & 1 deletion pkg/userdata/ubuntu/testdata/vsphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ write_files:
EnvironmentFile=-/etc/environment
EOF
apt-get install -y \
apt-get install --allow-downgrades -y \
containerd.io=1.4* \
docker-ce-cli=5:19.03* \
docker-ce=5:19.03*
Expand Down

0 comments on commit 6764efa

Please sign in to comment.