harvester / pcidevices

Manage PCI Devices and PCI Device Claims for PCI Passthrough in Harvester
Apache License 2.0
13 stars 16 forks source link

I find a bug about indexer??? #39

Open Captured77 opened 1 year ago

Captured77 commented 1 year ago

add Indexer: input func should VirtualMachine.Name otherwise!!!! get Indexer:
When we get indexer by VmName-NameSpace, response that is vm list don's exists!!!

ibrokethecloud commented 1 year ago

can you please provide more information about path to file?

Captured77 commented 1 year ago

can you please provide more information about path to file?

pkg/webhook/indexer.go func vmByName(obj *kubevirtv1.VirtualMachine) ([]string, error) { //return []string{fmt.Sprintf("%s-%s", obj.Name, obj.Namespace)}, nil return []string{obj.Name}, nil } /pkg/webhook/pod.go func create //vm, err := m.kubevirtCache.GetByIndex(VMByName, fmt.Sprintf("%s-%s", vmName, pod.Namespace)) vm, err := m.kubevirtCache.GetByIndex(VMByName, vmName)

Captured77 commented 1 year ago

can you please provide more information about path to file?

pkg/webhook/indexer.go func vmByName(obj *kubevirtv1.VirtualMachine) ([]string, error) { //return []string{fmt.Sprintf("%s-%s", obj.Name, obj.Namespace)}, nil return []string{obj.Name}, nil } /pkg/webhook/pod.go func create //vm, err := m.kubevirtCache.GetByIndex(VMByName, fmt.Sprintf("%s-%s", vmName, pod.Namespace)) vm, err := m.kubevirtCache.GetByIndex(VMByName, vmName)

I know why the indexer was designed with vm'name-namespace.