Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup csi.openstorage.org parameters after adding to VolumeLabels #1440

Conversation

ggriffiths
Copy link
Contributor

@ggriffiths ggriffiths commented Feb 25, 2020

Signed-off-by: Grant Griffiths [email protected]

What this PR does / why we need it:
We were leaving csi.openstorage.org parameters around in locator.VolumeLabels. This is not needed, as we copy these fields directly. These fields are only needed for transporting these values from the our external-provisioner fork to our CSI Driver.

See this example of the existing behavior. Each pvc.Label occurs twice. Once in the csi.openstorage.org/pvc-labels field, and once as it's own field.

csi.openstorage.org/pvc-labels={"app":"minio"
    "chart":"minio-3.0.1",
    "heritage":"Helm",
    "release":"minio-reliability",
},
csi.openstorage.org/pvc-name=minio-reliability,
csi.openstorage.org/pvc-namespace=minio,
csi.openstorage.org/pvc-annotations={"volume.beta.kubernetes.io/storage-provisioner":"pxd.portworx.com"},
namespace=minio,
pvc=minio-reliability,
release=minio-reliability,
app=minio,
chart=minio-3.0.1,
heritage=Helm

Which issue(s) this PR fixes (optional)
Closes #

Special notes for your reviewer:

@ggriffiths
Copy link
Contributor Author

ggriffiths commented Feb 25, 2020

Before, we were leaving around a bunch of metadata. Cleaned this up, see below.

tested - results:

[grant@PDC4-SM26-N8 examples]$ cat pvc.yaml 
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: no-auth-mysql-data
  annotations:
    volume.beta.kubernetes.io/storage-class: portworx-sc
  labels:
    abc: "456"
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
[root@grant-k8s-node0 /]# /opt/pwx/bin/pxctl v i 116151127435958097
Volume  :  116151127435958097
        Name                     :  pvc-4385a0c9-9b12-4bf2-921b-9dca657044e8
        Size                     :  2.0 GiB
        Format                   :  ext4
        HA                       :  1
        IO Priority              :  HIGH
        Creation time            :  Feb 25 23:21:10 UTC 2020
        Shared                   :  no
        Status                   :  up
        State                    :  detached
        Labels                   :  abc=456,namespace=default,pvc=no-auth-mysql-data

@ggriffiths ggriffiths assigned harsh-px and unassigned harsh-px Feb 25, 2020
@ggriffiths ggriffiths requested a review from harsh-px February 25, 2020 23:33
Copy link
Contributor

@harsh-px harsh-px left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants