Skip to content

Commit

Permalink
fix: get storage class name from vmimage status (#94)
Browse files Browse the repository at this point in the history
Signed-off-by: PoAn Yang <[email protected]>
  • Loading branch information
FrankYang0529 authored Apr 18, 2024
1 parent 980cb7f commit 47d1f28
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,12 @@ func (c *Constructor) Setup() util.Processors {
if err != nil {
return err
}
vmimage, err := c.Client.HarvesterClient.HarvesterhciV1beta1().VirtualMachineImages(imageNamespace).Get(c.Context, imageName, metav1.GetOptions{})
if err != nil {
return err
}
pvcOption.ImageID = helper.BuildNamespacedName(imageNamespace, imageName)
scName := builder.BuildImageStorageClassName("", imageName)
scName := vmimage.Status.StorageClassName
if storageClassName == "" {
storageClassName = scName
} else if storageClassName != scName {
Expand Down

0 comments on commit 47d1f28

Please sign in to comment.