openebs-archive / maya

Manage Container Attached Storage (CAS) - Data Engines in Kubernetes
https://docs.openebs.io
Apache License 2.0
184 stars 201 forks source link

fix(api): add ownerReference for BDC #1795

Closed niladrih closed 3 years ago

niladrih commented 3 years ago

Why is this PR required? What issue does it fix?: LocalPV Device from openebs/dynamic-localpv-provisioner requires addition of ownerReference for the BDC to the PVC. This file is included in the vendor directory for the dynamic-localpv-provisioner repo.

The workflow involved here:

  1. Add ownerReference for BDC in https://github.com/openebs/maya/tree/master/pkg/blockdeviceclaim/v1alpha1/build.go
  2. Update vendoring directory in openebs/dynamic-localpv-provisioner
  3. Add owner reference option in https://github.com/openebs/dynamic-localpv-provisioner/tree/master/cmd/provisioner-localpv/app/helper_blockdevice.go
  4. Pass PVC to reference to getBlockDevicePath method
  5. blockdeviceclaim/v1alpha1/build.go attaches owner reference.

Ref: Cleanup of stale BDCs in https://github.com/openebs/openebs/issues/3263

What this PR does?:

  1. Changes the input signature for WithOwnerReference method to empty interface to be able to get both (v1.PersistentVolumeClaim) and (apis.StoragePoolClaim) as input.
  2. Adds reference block to issue ownerReference to PVC.

Signed-off-by: Niladri Halder niladri.halder@mayadata.io

niladrih commented 3 years ago

I made the changes. Any idea why Travis is failing @akhilerm ?