-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat(controller,filter): add blockdevice tag label while claiming #400
feat(controller,filter): add blockdevice tag label while claiming #400
Conversation
- refactored the label constants. moved from filter to client - added openebs.io/block-device-tag label Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
BDC controller used a pointer reference of the selector. This has been changed to copy the selector and use it. This is done so that an update on the BDC object does not cause the selector to get updated with a different value other than the one which was applied by user. Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
846d3aa
to
4693974
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment on the naming. the changes look good!
Codecov Report
@@ Coverage Diff @@
## master #400 +/- ##
=======================================
Coverage 49.28% 49.28%
=======================================
Files 55 55
Lines 2439 2439
=======================================
Hits 1202 1202
Misses 1141 1141
Partials 96 96
Continue to review full report at Codecov.
|
add a new filter to to filter out block devices based on the block-device-tag label. The filter has also been added to the list of filters which are applied while auto selecting a block device. Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
31c650f
to
a7c998a
Compare
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
a7c998a
to
378ab4c
Compare
…enebs-archive#400) - add support for new label `openebs.io/block-device-tag` - add a new filter while claiming block devices. If `openebs.io/block-device-tag` is present on a BlockDevice, only BDCs having a matching selector will be able to claim that block device - Fix a bug where selector is accidentally updated on BDC while updating other fields. BDC controller used a pointer reference of the selector. This has been changed to copy the selector and use it. This is done so that an update on the BDC object does not cause the selector to get updated with a different value other than the one which was applied by user. - Add unit tests for new filter Sample BDC Yaml which makes use of `openebs.io/block-device-tag` label ```yaml apiVersion: openebs.io/v1alpha1 kind: BlockDeviceClaim metadata: finalizers: - openebs.io/bdc-protection name: bdc-ss35 namespace: default spec: blockDeviceName: blockdevice-91d422d8517f935431daae722f8fdfa0 resources: requests: storage: 10M selector: matchLabels: openebs.io/block-device-tag: X status: phase: Bound ``` BlockDevice that was claimed by the above BDC ```yaml kind: BlockDevice metadata: labels: kubernetes.io/hostname: gke-akhil-ndm-pool-1-4349c998-vt36 ndm.io/blockdevice-type: blockdevice ndm.io/managed: "true" openebs.io/block-device-tag: X name: blockdevice-91d422d8517f935431daae722f8fdfa0 namespace: default spec: capacity: storage: 53687091200 claimRef: apiVersion: openebs.io/v1alpha1 kind: BlockDeviceClaim name: bdc-ss35 namespace: default resourceVersion: "72629912" uid: f6c7af75-783e-11ea-9bcf-42010a80015a details: compliance: SPC-4 deviceType: disk driveType: HDD firmwareRevision: '1 ' hardwareSectorSize: 512 logicalBlockSize: 512 model: PersistentDisk physicalBlockSize: 4096 serial: akhil-disk-3 vendor: Google devlinks: - kind: by-id links: - /dev/disk/by-id/scsi-0Google_PersistentDisk_akhil-disk-3 - /dev/disk/by-id/google-akhil-disk-3 - kind: by-path links: - /dev/disk/by-path/pci-0000:00:03.0-scsi-0:0:2:0 nodeAttributes: nodeName: gke-akhil-ndm-pool-1-4349c998-vt36 path: /dev/sdc status: claimState: Claimed state: Active ``` Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
- add support for new label `openebs.io/block-device-tag` - add a new filter while claiming block devices. If `openebs.io/block-device-tag` is present on a BlockDevice, only BDCs having a matching selector will be able to claim that block device - Fix a bug where selector is accidentally updated on BDC while updating other fields. BDC controller used a pointer reference of the selector. This has been changed to copy the selector and use it. This is done so that an update on the BDC object does not cause the selector to get updated with a different value other than the one which was applied by user. - Add unit tests for new filter Sample BDC Yaml which makes use of `openebs.io/block-device-tag` label ```yaml apiVersion: openebs.io/v1alpha1 kind: BlockDeviceClaim metadata: finalizers: - openebs.io/bdc-protection name: bdc-ss35 namespace: default spec: blockDeviceName: blockdevice-91d422d8517f935431daae722f8fdfa0 resources: requests: storage: 10M selector: matchLabels: openebs.io/block-device-tag: X status: phase: Bound ``` BlockDevice that was claimed by the above BDC ```yaml kind: BlockDevice metadata: labels: kubernetes.io/hostname: gke-akhil-ndm-pool-1-4349c998-vt36 ndm.io/blockdevice-type: blockdevice ndm.io/managed: "true" openebs.io/block-device-tag: X name: blockdevice-91d422d8517f935431daae722f8fdfa0 namespace: default spec: capacity: storage: 53687091200 claimRef: apiVersion: openebs.io/v1alpha1 kind: BlockDeviceClaim name: bdc-ss35 namespace: default resourceVersion: "72629912" uid: f6c7af75-783e-11ea-9bcf-42010a80015a details: compliance: SPC-4 deviceType: disk driveType: HDD firmwareRevision: '1 ' hardwareSectorSize: 512 logicalBlockSize: 512 model: PersistentDisk physicalBlockSize: 4096 serial: akhil-disk-3 vendor: Google devlinks: - kind: by-id links: - /dev/disk/by-id/scsi-0Google_PersistentDisk_akhil-disk-3 - /dev/disk/by-id/google-akhil-disk-3 - kind: by-path links: - /dev/disk/by-path/pci-0000:00:03.0-scsi-0:0:2:0 nodeAttributes: nodeName: gke-akhil-ndm-pool-1-4349c998-vt36 path: /dev/sdc status: claimState: Claimed state: Active ``` Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
openebs.io/block-device-tag
openebs.io/block-device-tag
is present on a BlockDevice, only BDCs having a matching selector will be able to claim that block deviceSample BDC Yaml which makes use of
openebs.io/block-device-tag
labelBlockDevice that was claimed by the above BDC