Skip to content

Commit fa977dc

Browse files
committed
chore(imagebuilder): use rclone replace mc
1 parent 1bc9d8c commit fa977dc

6 files changed

Lines changed: 23 additions & 21 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ RUN export GO111MODULE=on \
99

1010
FROM registry.drycc.cc/drycc/base:${CODENAME}
1111

12-
ENV DRYCC_UID=1001 \
12+
ARG DRYCC_UID=1001 \
1313
DRYCC_GID=1001 \
1414
DRYCC_HOME_DIR=/workspace \
15-
MC_VERSION="2025.08.13.08.35.41" \
15+
RCLONE_VERSION="1.71.1" \
1616
JQ_VERSION="1.7.1"
1717

1818
RUN groupadd drycc --gid ${DRYCC_GID} \
@@ -24,7 +24,7 @@ COPY rootfs/container-entrypoint.sh /container-entrypoint.sh
2424
COPY --from=build /usr/local/bin/boot /usr/bin/boot
2525

2626
RUN install-packages git openssh-server coreutils xz-utils tar \
27-
&& install-stack mc $MC_VERSION \
27+
&& install-stack rclone $RCLONE_VERSION \
2828
&& install-stack jq $JQ_VERSION \
2929
&& mkdir -p /var/run/sshd \
3030
&& rm -rf /etc/ssh/ssh_host* \

charts/builder/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ env:
6464
name: storage-creds
6565
key: secretkey
6666
- name: "DRYCC_STORAGE_PATH_STYLE"
67-
value: "on"
67+
value: "true"
6868
{{- end }}
6969
- name: "DRYCC_REGISTRY_LOCATION"
7070
value: {{ ternary "on-cluster" "off-cluster" .Values.registry.enabled }}

charts/builder/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ storageBucket: "registry"
6161
storageEndpoint: ""
6262
storageAccesskey: ""
6363
storageSecretkey: ""
64-
storagePathStyle: "auto"
64+
storagePathStyle: "true"
6565

6666
# The following parameters will no longer use the built-in registry component.
6767
registryHost: ""

pkg/conf/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestGetStorageParams(t *testing.T) {
1616
"DRYCC_STORAGE_ENDPOINT": "http://localhost:8088",
1717
"DRYCC_STORAGE_ACCESSKEY": "admin",
1818
"DRYCC_STORAGE_SECRETKEY": "adminpass",
19-
"DRYCC_STORAGE_PATH_STYLE": "on",
19+
"DRYCC_STORAGE_PATH_STYLE": "true",
2020
}
2121
params, err := GetStorageParams(env)
2222
if err != nil {

pkg/gitreceive/imagebuilder_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestGetImagebuilderEnvOffclusterErr(t *testing.T) {
1717
env.Envs = map[string]string{
1818
"DRYCC_STORAGE_BUCKET": "builder",
1919
"DRYCC_STORAGE_ENDPOINT": "drycc-storage",
20-
"DRYCC_STORAGE_PATH_STYLE": "auto",
20+
"DRYCC_STORAGE_PATH_STYLE": "true",
2121
"DRYCC_REGISTRY_LOCATION": "off-cluster",
2222
}
2323
_, err := getImagebuilderEnv(&image, config, env)
@@ -32,15 +32,15 @@ func TestGetImagebuilderEnvOffclusterSuccess(t *testing.T) {
3232
env.Envs = map[string]string{
3333
"DRYCC_STORAGE_BUCKET": "builder",
3434
"DRYCC_STORAGE_ENDPOINT": "drycc-storage",
35-
"DRYCC_STORAGE_PATH_STYLE": "auto",
35+
"DRYCC_STORAGE_PATH_STYLE": "true",
3636
"DRYCC_REGISTRY_HOST": "quay.io",
3737
"DRYCC_REGISTRY_ORGANIZATION": "kmala",
3838
"DRYCC_REGISTRY_LOCATION": "off-cluster",
3939
}
4040
expectedData := map[string]string{
4141
"DRYCC_STORAGE_BUCKET": "builder",
4242
"DRYCC_STORAGE_ENDPOINT": "drycc-storage",
43-
"DRYCC_STORAGE_PATH_STYLE": "auto",
43+
"DRYCC_STORAGE_PATH_STYLE": "true",
4444
"DRYCC_REGISTRY_LOCATION": "off-cluster",
4545
"DRYCC_REGISTRY_HOST": "quay.io",
4646
"DRYCC_REGISTRY_ORGANIZATION": "kmala",
@@ -63,15 +63,15 @@ func TestGetImagebuilderEnvOnclusterSuccess(t *testing.T) {
6363
env.Envs = map[string]string{
6464
"DRYCC_STORAGE_BUCKET": "builder",
6565
"DRYCC_STORAGE_ENDPOINT": "drycc-storage",
66-
"DRYCC_STORAGE_PATH_STYLE": "auto",
66+
"DRYCC_STORAGE_PATH_STYLE": "true",
6767
"DRYCC_REGISTRY_HOST": "drycc-registry",
6868
"DRYCC_REGISTRY_PROXY_HOST": "127.0.0.1:8000",
6969
"DRYCC_REGISTRY_LOCATION": "on-cluster",
7070
}
7171
expectedData := map[string]string{
7272
"DRYCC_STORAGE_BUCKET": "builder",
7373
"DRYCC_STORAGE_ENDPOINT": "drycc-storage",
74-
"DRYCC_STORAGE_PATH_STYLE": "auto",
74+
"DRYCC_STORAGE_PATH_STYLE": "true",
7575
"DRYCC_REGISTRY_HOST": "drycc-registry",
7676
"DRYCC_REGISTRY_LOCATION": "on-cluster",
7777
"DRYCC_REGISTRY_PROXY_HOST": "127.0.0.1:8000",

rootfs/bin/create_bucket

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
set -e
44

5-
mc alias set storage \
6-
"${DRYCC_STORAGE_ENDPOINT}" \
7-
"${DRYCC_STORAGE_ACCESSKEY}" \
8-
"${DRYCC_STORAGE_SECRETKEY}" \
9-
--path "${DRYCC_STORAGE_PATH_STYLE}"
5+
mkdir -p ~/.config/rclone
6+
touch ~/.config/rclone/rclone.conf
7+
rclone config create storage s3 \
8+
provider=Other \
9+
access_key_id="${DRYCC_STORAGE_ACCESSKEY}" \
10+
secret_access_key="${DRYCC_STORAGE_SECRETKEY}" \
11+
endpoint="${DRYCC_STORAGE_ENDPOINT}" \
12+
force_path_style="${DRYCC_STORAGE_PATH_STYLE:-true}" --no-output
1013

11-
mc ping storage -x
12-
if ! mc admin info storage > /dev/null 2>&1; then
14+
if ! rclone lsd storage: > /dev/null 2>&1; then
1315
sleep 9s
14-
else
15-
mc ready storage
16+
echo "waiting for object storage to become ready..."
1617
fi
17-
mc mb --ignore-existing storage/"${DRYCC_STORAGE_BUCKET}"
18+
19+
rclone mkdir "storage:${DRYCC_STORAGE_BUCKET}"

0 commit comments

Comments
 (0)