kube-object-storage / lib-bucket-provisioner

Library for the dynamic provisioning of object store buckets to be used by object store providers.
Apache License 2.0
21 stars 22 forks source link

Additional Config was missing in OBC spec #190

Closed thotz closed 4 years ago

thotz commented 4 years ago

I have used below CR for creating obc for adding support for quota in OBC via additional config

apiVersion: objectbucket.io/v1alpha1
kind: ObjectBucketClaim
metadata:
  name: ceph-delete-bucket
spec:
  # To create a new bucket specify either `bucketName` or 
  # `generateBucketName` here. Both cannot be used. To access
  # an existing bucket the bucket name needs to be defined in
  # the StorageClass referenced here, and both `bucketName` and
  # `generateBucketName` must be omitted in the OBC.
  #bucketName: 
  generateBucketName: ceph-bkt
  storageClassName: rook-ceph-delete-bucket
  AdditionalConfig:
    maxObjects: 1000
    maxSize: 2

Apparently above info is missing in ObjectBucketClaimSpec and not able to fetch in the rook operator code

thotz commented 4 years ago

@copejon @jeffvance any ideas

jeffvance commented 4 years ago

@thotz, can you show output of kubctl get obc -oyaml?

thotz commented 4 years ago

@thotz, can you show output of kubctl get obc -oyaml? @jeffvance refer below

kubectl get obc ceph-delete-bucket -o yaml
apiVersion: objectbucket.io/v1alpha1
kind: ObjectBucketClaim
metadata:
creationTimestamp: "2020-06-03T06:05:56Z"
finalizers:
- objectbucket.io/finalizer
generation: 3
labels:
bucket-provisioner: rook-ceph.ceph.rook.io-bucket
name: ceph-delete-bucket
namespace: default
resourceVersion: "684117"
selfLink: /apis/objectbucket.io/v1alpha1/namespaces/default/objectbucketclaims/ceph-delete-bucket
uid: 5312cd5c-b3c3-4617-b046-8139b158896a
spec:
ObjectBucketName: obc-default-ceph-delete-bucket
bucketName: ceph-bkt-7a9adbc6-3f67-4503-b252-15d9aa1ea9f9
generateBucketName: ceph-bkt
storageClassName: rook-ceph-delete-bucket
status:
phase: Bound
guymguym commented 4 years ago

@thotz Seems like you used a uppercase A in AdditionalConfig. Should be lowercase - additionalConfig... See the json tag here: https://github.com/kube-object-storage/lib-bucket-provisioner/blob/02cba53742aed9a57c6541bb8dbf97346bc92835/pkg/apis/objectbucket.io/v1alpha1/objectbucketclaim_types.go#L51

thotz commented 4 years ago

It worked. Thanks @guymguym . Hence closing this issue

jeffvance commented 4 years ago

Good catch @guymguym !

jeffvance commented 4 years ago

Though it would be nice if we validated that field.