Skip to content

Commit

Permalink
Set volumeStatus.FileLocation to PVC name for kubevirt eve
Browse files Browse the repository at this point in the history
VolumeStatus of FileLocation may not be set for volumes in kubevirt eve since they
are PVCs. They will not have a explicit path under /persist/. Set the filelocation to PVC name.
Which will be used by the volumehandler to get volume details.

This will fix the app disk metrics.

Signed-off-by: Pramodh Pallapothu <pramodh@zededa.com>
  • Loading branch information
Pramodh Pallapothu authored and eriknordmark committed Dec 28, 2024
1 parent 7d90642 commit 982f91c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/pillar/cmd/volumemgr/handlediskmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,13 @@ func createOrUpdateDiskMetrics(ctx *volumemgrContext, wdName string) {
func createOrUpdateAppDiskMetrics(ctx *volumemgrContext, volumeStatus *types.VolumeStatus) error {
log.Functionf("createOrUpdateAppDiskMetrics(%s, %s)", volumeStatus.VolumeID, volumeStatus.FileLocation)
if volumeStatus.FileLocation == "" {
// Nothing we can do? XXX can we retrieve size from CAS?
return nil
if !ctx.hvTypeKube {
// Nothing we can do? XXX can we retrieve size from CAS?
return nil
} else {
// Kubevirt eve volumes have no location on /persist, they are PVCs
volumeStatus.FileLocation = volumeStatus.GetPVCName()
}
}
actualSize, maxSize, diskType, dirtyFlag, err := volumehandlers.GetVolumeHandler(log, ctx, volumeStatus).GetVolumeDetails()
if err != nil {
Expand Down

0 comments on commit 982f91c

Please sign in to comment.