Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I find a bug about indexer??? #39

Open
Captured77 opened this issue Feb 14, 2023 · 3 comments
Open

I find a bug about indexer??? #39

Captured77 opened this issue Feb 14, 2023 · 3 comments

Comments

@Captured77
Copy link

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
Copy link
Collaborator

can you please provide more information about path to file?

@Captured77
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants