Skip to content

Commit

Permalink
fix(inventory): skip persistent volume if it references non existing …
Browse files Browse the repository at this point in the history
…storageclass (#258)

fixes akash-network/support#268

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Dec 5, 2024
1 parent a489a33 commit 57d3565
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion operator/inventory/rancher.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ func (c *rancher) run(startch chan<- struct{}) error {
continue
}

params := scs[pv.Spec.StorageClassName]
params, exists := scs[pv.Spec.StorageClassName]
// pv can be created with non-existing storage class, so just skip it for now
// todo @troian may need to recount volume if storageclass is added later
if !exists {
continue
}

params.allocated += uint64(capacity.Value()) // nolint: gosec

pvMap[pv.Name] = pv
Expand Down

0 comments on commit 57d3565

Please sign in to comment.