Skip to content

Commit

Permalink
openstack: consider volume type names as well
Browse files Browse the repository at this point in the history
Signed-off-by: Benny Zlotnik <[email protected]>
  • Loading branch information
bennyz committed Sep 26, 2023
1 parent b8dfca6 commit d8341bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controller/plan/adapter/openstack/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1035,15 +1035,19 @@ func (r *Builder) getStorageClassName(workload *model.Workload, volumeTypeName s
}
if volumeTypeID == "" {
err = liberr.New("volume type not found", "volumeType", volumeTypeName)
r.Log.Trace(err)
return
}
for _, storageMap := range r.Context.Map.Storage.Spec.Map {
if storageMap.Source.ID == volumeTypeID {
storageClassName = storageMap.Destination.StorageClass
} else if storageMap.Source.Name == volumeTypeName {
storageClassName = storageMap.Destination.StorageClass
}
}
if storageClassName == "" {
err = liberr.New("no storage class map found for volume type", "volumeTypeID", volumeTypeID)
r.Log.Trace(err)
return
}
return
Expand Down

0 comments on commit d8341bf

Please sign in to comment.