Skip to content

Commit

Permalink
fix: Bucket postfix trailing slash (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk authored Jan 16, 2025
1 parent bd9bc86 commit 9ef4faf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: operator-wandb
description: A Helm chart for deploying W&B to Kubernetes
type: application
version: 0.23.6
version: 0.23.7
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
24 changes: 24 additions & 0 deletions charts/operator-wandb/templates/_bucket.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,42 @@ secretKey: {{ $secretKey }}
accessKeyName: {{ .Values.global.bucket.secret.accessKeyName }}
secretKeyName: {{ .Values.global.bucket.secret.secretKeyName }}
secretName: {{ include "wandb.bucket.secret" . }}
{{- if eq $path "" -}}

{{- if eq $provider "az" -}}
{{- $url = "az://$(BUCKET_NAME)" -}}
{{- end -}}

{{- if eq $provider "gcs" -}}
{{- $url = "gs://$(BUCKET_NAME)" -}}
{{- end -}}

{{- if eq $provider "s3" -}}
{{- if or (and $accessKey $secretKey) .Values.global.bucket.secret.secretName -}}
{{- $url = "s3://$(BUCKET_ACCESS_KEY):$(BUCKET_SECRET_KEY)@$(BUCKET_NAME)" -}}
{{- else -}}
{{- $url = "s3://$(BUCKET_NAME)" -}}
{{- end -}}
{{- end -}}

{{- else -}}

{{- if eq $provider "az" -}}
{{- $url = "az://$(BUCKET_NAME)/$(BUCKET_PATH)" -}}
{{- end -}}

{{- if eq $provider "gcs" -}}
{{- $url = "gs://$(BUCKET_NAME)/$(BUCKET_PATH)" -}}
{{- end -}}

{{- if eq $provider "s3" -}}
{{- if or (and $accessKey $secretKey) .Values.global.bucket.secret.secretName -}}
{{- $url = "s3://$(BUCKET_ACCESS_KEY):$(BUCKET_SECRET_KEY)@$(BUCKET_NAME)/$(BUCKET_PATH)" -}}
{{- else -}}
{{- $url = "s3://$(BUCKET_NAME)/$(BUCKET_PATH)" -}}
{{- end -}}
{{- end -}}

{{- end -}}
{{- $url = trimSuffix "/" $url }}
url: {{ $url }}
Expand Down

0 comments on commit 9ef4faf

Please sign in to comment.