I find a bug about indexer???
Captured77 opened this issue · comments
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!!!
can you please provide more information about path to file?
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)
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.