Skip to content

Commit

Permalink
wrap k8s api error in GetNodeID (#535)
Browse files Browse the repository at this point in the history
Fixes issue #493

when zfs-localpv is broken due to an k8s api issue,
it just says 'GetNodeID failed for node'.
this change adds the actual api error

Signed-off-by: Arvid E. Picciani <[email protected]>
  • Loading branch information
aep authored May 22, 2024
1 parent fd3afc5 commit e40e135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/zfs/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func init() {
func GetNodeID(nodename string) (string, error) {
node, err := k8sapi.GetNode(nodename)
if err != nil {
return "", fmt.Errorf("failed to get the node %s", nodename)
return "", fmt.Errorf("failed to get the node %s: %w", nodename, err)
}

nodeid, ok := node.Labels[ZFSTopologyKey]
Expand Down

0 comments on commit e40e135

Please sign in to comment.