Skip to content

fix(BD-labels):add device attributes and location details as bd labels #618

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

Merged
merged 25 commits into from
Nov 23, 2021

Conversation

Ab-hishek
Copy link

@Ab-hishek Ab-hishek commented Aug 25, 2021

Signed-off-by: Abhishek Agarwal [email protected]

Why is this PR required? What issue does it fix?:
issue- #615

What this PR does?:
This PR adds some generic labels to the block device resources which are already present inside the BD CR spec along with some topology(location) details as labels for the block devices to be able to easily classify devices on the basis of these labels.

The labels will be added by making use of ndm configmap. The update that configmap requires is the addition of new field metaconfigs:

    # metconfig can be used to decorate the block device with different types of labels
    # that are available on the node or come in a device properties.
    # node labels - the node where bd is discovered. A whitlisted label prefixes
    # attribute labels - a property of the BD can be added as a ndm label as ndm.io/<property>=<property-value>
    metaconfigs:
      - key: node-labels
        name: node labels
        pattern:" kubernetes.io*,beta.kubernetes.io*"
      - key: device-labels
        name: device labels
        type: ".spec.details.vendor,.spec.details.model,.spec.details.driveType,.spec.filesystem.fsType"

Does this PR require any upgrade changes?:

If the changes in this PR are manually verified, list down the scenarios covered::

  1. Deleted ndm operator deployment and ndm manager daemonset.
  2. Deployed fresh ndm resources.
  3. Checked the BD resources labels after deployment. Verified that the device attribute labels and node location labels as getting added
master@master-virtual-machine:~$ kubectl describe bd blockdevice-0bbf3a32162c35d160379bdc5534f73a -n openebs
Name:         blockdevice-0bbf3a32162c35d160379bdc5534f73a
Namespace:    openebs
Labels:       beta.kubernetes.io/arch=amd64
              beta.kubernetes.io/os=linux
              kubernetes.io/arch=amd64
              kubernetes.io/hostname=node1-virtual-machine
              kubernetes.io/os=linux
              ndm.io/blockdevice-type=blockdevice
              ndm.io/driveType=HDD
              ndm.io/fsType=zfs_member
              ndm.io/managed=true
              ndm.io/model=Virtual_disk
              ndm.io/vendor=VMware
              nodename=node1-virtual-machine
Annotations:  internal.openebs.io/partition-uuid: 5ad22014-22bd-4b50-b3fc-46b77160d7ed
              internal.openebs.io/uuid-scheme: legacy
API Version:  openebs.io/v1alpha1
Kind:         BlockDevice
Spec:
  Capacity:
    Logical Sector Size:   512
    Physical Sector Size:  512
    Storage:               53686025728
  Details:
    Compliance:            SPC-
    Device Type:           partition
    Drive Type:            HDD
    Firmware Revision:     1.0 
    Hardware Sector Size:  512
    Logical Block Size:    512
    Model:                 Virtual_disk
    Physical Block Size:   512
    Serial:                
    Vendor:                VMware
  Devlinks:
    Kind:  by-path
    Links:
      /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1
  Filesystem:
    Fs Type:  zfs_member
  Node Attributes:
    Node Name:  node1-virtual-machine
  Partitioned:  No
  Path:         /dev/sdb1
Status:
  Claim State:  Unclaimed
  State:        Active
Events:         <none>

Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

@lgtm-com
Copy link

lgtm-com bot commented Aug 25, 2021

This pull request introduces 1 alert when merging 8fdf4f5 into 426eeaa - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@Ab-hishek Ab-hishek added the pr/hold-review Needs rework. label Aug 25, 2021
@lgtm-com
Copy link

lgtm-com bot commented Aug 25, 2021

This pull request introduces 2 alerts when merging 3ef8aa5 into 426eeaa - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

Signed-off-by: Abhishek Agarwal <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2021

Codecov Report

Merging #618 (77878d3) into develop (9fe3968) will decrease coverage by 1.22%.
The diff coverage is 15.29%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #618      +/-   ##
===========================================
- Coverage    46.09%   44.87%   -1.23%     
===========================================
  Files           78       79       +1     
  Lines         3820     3964     +144     
===========================================
+ Hits          1761     1779      +18     
- Misses        1901     2018     +117     
- Partials       158      167       +9     
Impacted Files Coverage Δ
cmd/ndm_daemonset/controller/controller.go 13.18% <0.00%> (-1.45%) ⬇️
cmd/ndm_daemonset/controller/ndmconfig.go 73.33% <ø> (ø)
cmd/ndm_daemonset/probe/changehandler.go 0.00% <0.00%> (ø)
cmd/ndm_daemonset/controller/blockdevice.go 51.26% <11.32%> (-32.57%) ⬇️
cmd/ndm_daemonset/controller/blockdevicestore.go 71.42% <25.00%> (-1.49%) ⬇️
...md/ndm_daemonset/controller/sparsefilegenerator.go 81.01% <40.00%> (-2.99%) ⬇️
cmd/ndm_daemonset/probe/addhandler.go 67.97% <42.85%> (-3.36%) ⬇️
cmd/ndm_daemonset/probe/udevprobe.go 46.64% <50.00%> (-1.59%) ⬇️
pkg/partition/partition.go 30.26% <0.00%> (-11.56%) ⬇️
cmd/ndm_daemonset/probe/uuid.go 94.73% <0.00%> (-5.27%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fe3968...77878d3. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Aug 25, 2021

This pull request introduces 2 alerts when merging dca0b0f into 426eeaa - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@Ab-hishek Ab-hishek self-assigned this Aug 25, 2021
Abhishek Agarwal added 2 commits August 26, 2021 00:45
Signed-off-by: Abhishek Agarwal <[email protected]>
@Ab-hishek Ab-hishek removed the pr/hold-review Needs rework. label Aug 26, 2021
@Ab-hishek Ab-hishek requested a review from akhilerm August 26, 2021 07:41
@lgtm-com
Copy link

lgtm-com bot commented Aug 26, 2021

This pull request introduces 2 alerts when merging f274c21 into 426eeaa - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented Aug 26, 2021

This pull request introduces 2 alerts when merging ad03f13 into 426eeaa - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@Ab-hishek Ab-hishek requested a review from kmova August 27, 2021 14:11
@Ab-hishek Ab-hishek requested a review from kmova August 29, 2021 07:59
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

@a4abhishek a few more nitpick comments.

@Ab-hishek Ab-hishek requested a review from akhilerm October 21, 2021 15:38
akhilerm
akhilerm previously approved these changes Oct 26, 2021
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

LGTM, just a comment on the generated operator file

akhilerm
akhilerm previously approved these changes Oct 26, 2021
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

LGTM

@akhilerm akhilerm requested a review from z0marlin November 16, 2021 06:44
Signed-off-by: Abhishek Agarwal <[email protected]>
akhilerm
akhilerm previously approved these changes Nov 23, 2021
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

LGTM.

Need to add a reference link to the original code from the k8s repo

Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

LGTM

@akhilerm akhilerm requested a review from z0marlin November 23, 2021 05:33
Copy link
Contributor

@z0marlin z0marlin left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for working on this.

@akhilerm akhilerm merged commit beb21ae into openebs-archive:develop Nov 23, 2021
niladrih added a commit to openebs/website that referenced this pull request Apr 1, 2022
cmontemuino added a commit to cmontemuino/openebs-charts that referenced this pull request Dec 7, 2023
Add `metaconfigs` capability introduced in openebs-archive/node-disk-manager#618

fixes 338

Signed-off-by: cmontemuino <[email protected]>
cmontemuino added a commit to cmontemuino/openebs-charts that referenced this pull request Dec 14, 2023
Add `metaconfigs` capability introduced in openebs-archive/node-disk-manager#618

fixes 338

Signed-off-by: cmontemuino <[email protected]>
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.

Add device attributes and location details as labels to BD resources
5 participants