Skip to content

Commit

Permalink
Fixed issue for --template with Harvester v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
belgaied2 committed Jul 14, 2022
1 parent 290c2f2 commit 926218d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ func vmCreateFromImage(ctx *cli.Context, c *harvclient.Clientset, vmTemplate *VM
}
} else {
vmTemplate.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvcName

if vmTemplate.ObjectMeta.Labels == nil {
vmTemplate.ObjectMeta.Labels = make(map[string]string)
}

vmTemplate.ObjectMeta.Labels["harvesterhci.io/vmNamePrefix"] = vmNameBase
vmTemplate.Spec.Affinity = &v1.Affinity{
PodAntiAffinity: &v1.PodAntiAffinity{
Expand Down

0 comments on commit 926218d

Please sign in to comment.