Skip to content

Commit

Permalink
make sure revisions are not a part of virtctl expose service label
Browse files Browse the repository at this point in the history
matching

Signed-off-by: David Vossel <[email protected]>
  • Loading branch information
davidvossel committed Feb 21, 2022
1 parent fa35495 commit 7b1aeb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/virtctl/expose/expose.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

v12 "kubevirt.io/api/core/v1"

virtv1 "kubevirt.io/api/core/v1"
"kubevirt.io/client-go/kubecli"
"kubevirt.io/kubevirt/pkg/virtctl/templates"
)
Expand Down Expand Up @@ -172,6 +173,7 @@ func (o *Command) RunE(args []string) error {
ports = podNetworkPorts(&vmi.Spec)
// remove unwanted labels
delete(serviceSelector, "kubevirt.io/nodeName")
delete(serviceSelector, virtv1.VirtualMachinePoolRevisionName)
case "vm", "vms", "virtualmachine", "virtualmachines":
// get the VM
vm, err := virtClient.VirtualMachine(namespace).Get(vmName, &options)
Expand All @@ -182,6 +184,7 @@ func (o *Command) RunE(args []string) error {
ports = podNetworkPorts(&vm.Spec.Template.Spec)
}
serviceSelector = vm.Spec.Template.ObjectMeta.Labels
delete(serviceSelector, virtv1.VirtualMachinePoolRevisionName)
case "vmirs", "vmirss", "virtualmachineinstancereplicaset", "virtualmachineinstancereplicasets":
// get the VM replica set
vmirs, err := virtClient.ReplicaSet(namespace).Get(vmName, options)
Expand Down

0 comments on commit 7b1aeb7

Please sign in to comment.