Skip to content

fix: wrong symlink path building for drive signing#2436

Merged
kristina-solovyova merged 2 commits intoweka:mainfrom
Gab-Menezes:main
Apr 20, 2026
Merged

fix: wrong symlink path building for drive signing#2436
kristina-solovyova merged 2 commits intoweka:mainfrom
Gab-Menezes:main

Conversation

@Gab-Menezes
Copy link
Copy Markdown
Contributor

@Gab-Menezes Gab-Menezes commented Apr 7, 2026

Fixes the symlink path for when signing by deviceId and vendorId.

Logs from the signing operation:

2026-04-07 04:09:53,994 - root - INFO - Found 0 drives with cluster_guid
2026-04-07 04:09:53,994 - root - INFO - Final excluded paths: []
2026-04-07 04:09:53,994 - root - INFO - Signing drives. Vendor ID: 144d, Device ID: a826
2026-04-07 04:09:53,995 - root - INFO - Running command: lspci -d 144d:a826 | sort | awk '{print $1}'
2026-04-07 04:09:54,012 - root - INFO - Command lspci -d 144d:a826 | sort | awk '{print $1}' finished with code 0
2026-04-07 04:09:54,012 - root - INFO - Command lspci -d 144d:a826 | sort | awk '{print $1}' stdout: 0000:1a:00.0
0000:1b:00.0
0000:2b:00.0
0000:2c:00.0

2026-04-07 04:09:54,012 - root - INFO - Running command: /weka-sign-drive sign -- /dev/disk/by-path/pci-0000:0000:1a:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:1b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2c:00.0-nvme-1
2026-04-07 04:09:54,018 - root - INFO - Command /weka-sign-drive sign -- /dev/disk/by-path/pci-0000:0000:1a:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:1b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2c:00.0-nvme-1 finished with code 1
2026-04-07 04:09:54,018 - root - INFO - Command /weka-sign-drive sign -- /dev/disk/by-path/pci-0000:0000:1a:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:1b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2c:00.0-nvme-1 stdout: Processing 4 device(s): [/dev/disk/by-path/pci-0000:0000:1a:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:1b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2c:00.0-nvme-1]

2026-04-07 04:09:54,018 - root - INFO - Command /weka-sign-drive sign -- /dev/disk/by-path/pci-0000:0000:1a:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:1b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2b:00.0-nvme-1 /dev/disk/by-path/pci-0000:0000:2c:00.0-nvme-1 stderr: Error processing /dev/disk/by-path/pci-0000:0000:2c:00.0-nvme-1: error checking device usage: failed to resolve device path: lstat /dev/disk/by-path/pci-0000:0000:2c:00.0-nvme-1: no such file or directory
Error processing /dev/disk/by-path/pci-0000:0000:1b:00.0-nvme-1: error checking device usage: failed to resolve device path: lstat /dev/disk/by-path/pci-0000:0000:1b:00.0-nvme-1: no such file or directory
Error processing /dev/disk/by-path/pci-0000:0000:1a:00.0-nvme-1: error checking device usage: failed to resolve device path: lstat /dev/disk/by-path/pci-0000:0000:1a:00.0-nvme-1: no such file or directory
Error processing /dev/disk/by-path/pci-0000:0000:2b:00.0-nvme-1: error checking device usage: failed to resolve device path: lstat /dev/disk/by-path/pci-0000:0000:2b:00.0-nvme-1: no such file or directory

The string 0000 is added wrongly leading the the wrong path, the command lspci -d {vendor_id}:{device_id} | sort | awk '{print $1}' already returns the 0000 prefix.

~$ lspci -d 144d:a826 | sort | awk '{print $1}'
0000:1a:00.0
0000:1b:00.0
0000:2b:00.0
0000:2c:00.0

Here is the WekaPolicy

apiVersion: weka.weka.io/v1alpha1
kind: WekaPolicy
metadata:
  name: sign-drives
  namespace: weka
spec:
  type: sign-drives
  payload:
    signDrivesPayload:
      type: device-identifiers
      pciDevices:
        vendorId: "144d"
        deviceId: "a826"
      nodeSelector:
        weka.io/supports-backends: "true"

@Gab-Menezes Gab-Menezes requested a review from a team as a code owner April 7, 2026 04:30
Copilot AI review requested due to automatic review settings April 7, 2026 04:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes incorrect /dev/disk/by-path symlink construction when signing drives discovered via lspci vendor/device IDs, preventing duplicate 0000: in the generated PCI path.

Changes:

  • Update PCI by-path device string formatting to avoid prepending 0000: when lspci already includes the domain.
  • Apply the same fix for both direct signing and proxy signing paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Apr 7, 2026

Graphite Automations

"Add anton/matt/sergey/kristina as reviwers on operator PRs" took an action on this PR • (04/07/26)

3 reviewers were added to this PR based on Anton Bykov's automation.

@Gab-Menezes
Copy link
Copy Markdown
Contributor Author

hey @kristina-solovyova can we get this merged ? I would like very much for the next version of the operator to have this fixed.

Having to manually sign the drives because of this bug is a bit annoying.

@kristina-solovyova
Copy link
Copy Markdown
Collaborator

hey @kristina-solovyova can we get this merged ? I would like very much for the next version of the operator to have this fixed.

hay @Gab-Menezes! Thank you for the fix
Yes, I'm rebasing and merging it

@kristina-solovyova kristina-solovyova merged commit b4be71e into weka:main Apr 20, 2026
11 checks passed
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.

3 participants