Skip to content

Commit

Permalink
Merge pull request #132 from francescotimperi/github-app
Browse files Browse the repository at this point in the history
  • Loading branch information
francescotimperi committed Nov 8, 2023
2 parents 1c90247 + 4c685ba commit 5b15d36
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions deploy/nuvolaris-permissions/whisk-user-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ spec:
description: password to access the internal MINIO instance
type: string
quota:
description: maximum quota assignable in mb to each defined bucket, If omitted il will be equivalent to unlimited
type: integer
description: maximum quota assignable in mb to each defined bucket. Defaults to auto which will not set any specific quota
type: string
data:
description: used to configure the user MINIO dedicated buckets
type: object
Expand Down
11 changes: 7 additions & 4 deletions nuvolaris/minio.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,14 @@ def create_nuv_storage(data):
logging.info(f"*** configured MINIO storage for nuvolaris")

def assign_bucket_quota(bucket_name, quota, minioClient:MinioClient):
logging.info(f"*** setting quota on bucket {bucket_name} with hardlimit to {quota}m")
res = minioClient.assign_quota_to_bucket(bucket_name,quota)
if not quota.lower() in ['auto'] and quota.isnumeric():
logging.info(f"*** setting quota on bucket {bucket_name} with hardlimit to {quota}m")
res = minioClient.assign_quota_to_bucket(bucket_name,quota)

if res:
logging.info(f"*** quota on bucket {bucket_name} set successfully")
if res:
logging.info(f"*** quota on bucket {bucket_name} set successfully")
else:
logging.warn(f"*** skipping quota set on bucket {bucket_name}. Requested quota values is {quota}")


def create_ow_storage(state, ucfg: UserConfig, user_metadata: UserMetadata, owner=None):
Expand Down
2 changes: 1 addition & 1 deletion tests/kind/whisk-user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
password: fttredispwd
object-storage:
password: vPtIjR2MFMlYY7U5BY6N7TTogZXnJa8cl6ygPGnJIXOJonfA6MuNpVAdLN7m8iVc
quota: 100
quota: "100"
data:
enabled: true
bucket: franztt-data
Expand Down

0 comments on commit 5b15d36

Please sign in to comment.