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

Add resource labels #140

Closed copejon closed 5 years ago

copejon commented 5 years ago

Fixes #133 #57

Adds a label (<provisioner_name>: "") to the OBC, OB, CM, and Secret. By k8s convention, provisioner names are usually in the form of qualified.name/foo. Labels values may only have ., _, or - special characters whereas label keys are parsed in the same manner as provisioner names. Thus, assigning the name to the label key does not create an intuitive experience when getting object by label.

The method for getting by label is the same: kubectl get <obj> -l provisionerName

A little refactoring was done on CreateSecret and CreateConfigMap to separate process concerns (defining the object vs creating the object) and to clean up function signatures.

TODO: adjust unit tests

jeffvance commented 5 years ago

LGTM

copejon commented 5 years ago

@guymguym So in adding a setable version value, we'll be adding a new param to NewProvisioner(). What do you think about making that a separate PR, given it's an API breaking change? This PR would still add basic labeling with the provisioner name as the key.

jeffvance commented 5 years ago

Summary of discussion with @guymguym: The lib's Provisioner struct can have a label-value string field added. This becomes the value of <provisioner-name>=<label-value> label with the default value being "".

copejon commented 5 years ago

closing in favor of #159