{{- $myNS := lookup "v1" "Namespace" "" .Release.Namespace }}
{{- $seaweedfs := index $myNS.metadata.annotations "namespace.cozystack.io/seaweedfs" }}
apiVersion: objectstorage.k8s.io/v1alpha1
kind: BucketClaim
metadata:
  name: {{ .Release.Name }}
spec:
  bucketClassName: {{ $seaweedfs }}
  protocols:
    - s3
---
apiVersion: objectstorage.k8s.io/v1alpha1
kind: BucketAccess
metadata:
  name: {{ .Release.Name }}
spec:
  bucketAccessClassName: {{ $seaweedfs }}
  bucketClaimName: {{ .Release.Name }}
  credentialsSecretName: {{ .Release.Name }}
  protocol: s3
