Skip to content

Commit a7f785f

Browse files
committed
chore(storage): use path style replace lookup
1 parent 2e6778d commit a7f785f

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

charts/registry/templates/_helper.tpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ env:
2525
name: registry-secret
2626
key: password
2727
{{- if (.Values.storageEndpoint) }}
28-
- name: "DRYCC_STORAGE_LOOKUP"
29-
valueFrom:
30-
secretKeyRef:
31-
name: registry-secret
32-
key: storage-lookup
3328
- name: "DRYCC_STORAGE_BUCKET"
3429
valueFrom:
3530
secretKeyRef:
@@ -50,9 +45,12 @@ env:
5045
secretKeyRef:
5146
name: registry-secret
5247
key: storage-secretkey
48+
- name: "DRYCC_STORAGE_PATH_STYLE"
49+
valueFrom:
50+
secretKeyRef:
51+
name: registry-secret
52+
key: storage-path-style
5353
{{- else if .Values.storage.enabled }}
54-
- name: "DRYCC_STORAGE_LOOKUP"
55-
value: "path"
5654
- name: "DRYCC_STORAGE_BUCKET"
5755
value: "registry"
5856
- name: "DRYCC_STORAGE_ENDPOINT"
@@ -67,5 +65,7 @@ env:
6765
secretKeyRef:
6866
name: storage-creds
6967
key: secretkey
68+
- name: "DRYCC_STORAGE_PATH_STYLE"
69+
value: "on"
7070
{{- end }}
7171
{{- end }}

charts/registry/templates/registry-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ data:
1111
password: {{ include "common.secrets.lookup" (dict "secret" "registry-secret" "key" "password" "defaultValue" (.Values.password | default (randAlphaNum 32)) "context" $) }}
1212
redirect: {{ .Values.redirect | b64enc }}
1313
{{- if (.Values.storageEndpoint) }}
14-
storage-lookup: {{ .Values.storageLookup | b64enc }}
1514
storage-bucket: {{ .Values.storageBucket | b64enc }}
1615
storage-endpoint: {{ .Values.storageEndpoint | b64enc }}
1716
storage-accesskey: {{ .Values.storageAccesskey | b64enc }}
1817
storage-secretkey: {{ .Values.storageSecretkey | b64enc }}
18+
storage-path-style: {{ .Values.storagePathStyle | b64enc }}
1919
{{- end }}

charts/registry/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ resources: {}
6161
concurrencyPolicy: "Replace"
6262

6363
# The following parameters will no longer use the built-in storage component.
64-
storageLookup: "auto"
6564
storageBucket: "builder"
6665
storageEndpoint: ""
6766
storageAccesskey: ""
6867
storageSecretkey: ""
68+
storagePathStyle: "auto"
6969

7070
storage:
7171
enabled: true

contrib/ci/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ REGISTRY_JOB=$(podman run -d --rm \
2222
-e DRYCC_REGISTRY_REDIRECT=false \
2323
-e DRYCC_REGISTRY_USERNAME=admin \
2424
-e DRYCC_REGISTRY_PASSWORD=admin \
25-
-e DRYCC_STORAGE_LOOKUP=path \
2625
-e DRYCC_STORAGE_BUCKET=registry \
2726
-e DRYCC_STORAGE_ENDPOINT="http://${STORAGE_IP}:9000" \
2827
-e DRYCC_STORAGE_ACCESSKEY="${DRYCC_STORAGE_ACCESSKEY}" \
2928
-e DRYCC_STORAGE_SECRETKEY="${DRYCC_STORAGE_SECRETKEY}" \
29+
-e DRYCC_STORAGE_PATH_STYLE=on \
3030
"$1" start-registry)
3131

3232
# shellcheck disable=SC2317

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ const (
1414
registryHtpasswd = "/opt/drycc/registry/etc/htpasswd"
1515
registryConfigEnvVar = "DRYCC_REGISTRY_CONFIG"
1616
registryRedirectEnvVar = "DRYCC_REGISTRY_REDIRECT"
17-
storageLookupEnvVar = "DRYCC_STORAGE_LOOKUP"
1817
storageBucketEnvVar = "DRYCC_STORAGE_BUCKET"
1918
storageEndpointEnvVar = "DRYCC_STORAGE_ENDPOINT"
2019
storageAccesskeyEnvVar = "DRYCC_STORAGE_ACCESSKEY"
2120
storageSecretkeyEnvVar = "DRYCC_STORAGE_SECRETKEY"
21+
storagePathStyleEnvVar = "DRYCC_STORAGE_PATH_STYLE"
2222
defaultCommand = "serve"
2323
)
2424

@@ -40,7 +40,7 @@ func main() {
4040
os.Setenv("REGISTRY_STORAGE_S3_SECRETKEY", os.Getenv(storageSecretkeyEnvVar))
4141
os.Setenv("REGISTRY_STORAGE_S3_BUCKET", os.Getenv(storageBucketEnvVar))
4242

43-
if os.Getenv(storageLookupEnvVar) == "path" {
43+
if os.Getenv(storagePathStyleEnvVar) == "on" {
4444
os.Setenv("REGISTRY_STORAGE_S3_FORCEPATHSTYLE", "true")
4545
}
4646

rootfs/bin/init-registry

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

33
set -e
44

5-
mc config host add storage \
5+
mc alias set storage \
66
"${DRYCC_STORAGE_ENDPOINT}" \
77
"${DRYCC_STORAGE_ACCESSKEY}" \
88
"${DRYCC_STORAGE_SECRETKEY}" \
9-
--lookup "${DRYCC_STORAGE_LOOKUP}" \
10-
--api s3v4
9+
--path "${DRYCC_STORAGE_PATH_STYLE}"
10+
1111
mc ping storage -x
1212
mc mb --ignore-existing storage/"${DRYCC_STORAGE_BUCKET}"
1313

0 commit comments

Comments
 (0)