Skip to content

Commit bef26d9

Browse files
authored
fix(minio): uses wrong image name in some cases (#5839)
1 parent be0b48c commit bef26d9

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

addons/minio/2025-10-15T17-29-55Z/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ function minio() {
5151

5252
if [ -n "$minio_ha_exists" ]; then
5353
# don't update the statefulset or deployment, just change the images they use
54-
kubectl set image -n minio statefulset/ha-minio minio=minio/minio:RELEASE.2025-10-15T17-29-55Z
54+
kubectl set image -n minio statefulset/ha-minio minio=kurlsh/minio:RELEASE.2025-10-15T17-29-55Z
5555

5656
# the deployment will have been deleted if data has been migrated to the statefulset, so don't error if the image isn't updated
57-
kubectl set image -n minio deployment/minio minio=minio/minio:RELEASE.2025-10-15T17-29-55Z 2>/dev/null || true
57+
kubectl set image -n minio deployment/minio minio=kurlsh/minio:RELEASE.2025-10-15T17-29-55Z 2>/dev/null || true
5858
else
5959
# create the statefulset/deployment/service/secret/etc
6060
render_yaml_file_2 "$src/tmpl-kustomization.yaml" > "$dst/kustomization.yaml"

addons/minio/template/base/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ function minio() {
5151

5252
if [ -n "$minio_ha_exists" ]; then
5353
# don't update the statefulset or deployment, just change the images they use
54-
kubectl set image -n minio statefulset/ha-minio minio=minio/minio:__MINIO_VERSION__
54+
kubectl set image -n minio statefulset/ha-minio minio=kurlsh/minio:__MINIO_VERSION__
5555

5656
# the deployment will have been deleted if data has been migrated to the statefulset, so don't error if the image isn't updated
57-
kubectl set image -n minio deployment/minio minio=minio/minio:__MINIO_VERSION__ 2>/dev/null || true
57+
kubectl set image -n minio deployment/minio minio=kurlsh/minio:__MINIO_VERSION__ 2>/dev/null || true
5858
else
5959
# create the statefulset/deployment/service/secret/etc
6060
render_yaml_file_2 "$src/tmpl-kustomization.yaml" > "$dst/kustomization.yaml"

addons/minio/template/generate.sh

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,46 @@ function generate() {
2929
sed -i "s/__MINIO_DIR_NAME__/$DIR_NAME/g" "$dir/install.sh"
3030
}
3131

32+
function parse_flags() {
33+
for i in "$@"; do
34+
case ${1} in
35+
--force)
36+
force_flag="1"
37+
shift
38+
;;
39+
--version=*)
40+
version_flag="${i#*=}"
41+
shift
42+
;;
43+
*)
44+
echo "Unknown flag $1"
45+
exit 1
46+
;;
47+
esac
48+
done
49+
}
50+
3251
function main() {
33-
VERSION=${1-}
52+
local force_flag=
53+
local version_flag=
54+
55+
parse_flags "$@"
56+
57+
VERSION="$version_flag"
3458
if [ -z "$VERSION" ]; then
3559
get_latest_version
3660
fi
3761

3862
DIR_NAME=${VERSION#"RELEASE."}
3963

40-
if [ -d "../${DIR_NAME}" ]; then
41-
echo "MinIO ${VERSION} add-on already exists"
42-
exit 0
64+
if [ -d "../$VERSION" ]; then
65+
if [ "$force_flag" == "1" ]; then
66+
echo "forcibly updating existing version of MinIO"
67+
rm -rf "../$VERSION"
68+
else
69+
echo "not updating existing version of MinIO"
70+
return
71+
fi
4372
fi
4473

4574
generate

0 commit comments

Comments
 (0)