简体   繁体   中英

Kubernetes undefined noderesources.preFilterState

I am rewriting the logic of Kube.netes' NodeResourcesFit plugin, I want to use preFilterState like https://github.com/kube.netes/kube.netes/blob/419e0ec3d2512afd8c1f35a44862f856bc4ac10f/pkg/scheduler/framework/plugins/noderesources/fit.go#L91 , so I import it in the code:

import "k8s.io/kube.netes/pkg/scheduler/framework/plugins/noderesources"

and use it just like:

s, ok:= c.(*noderesources.preFilterState)

However I get an error: undefined: noderesources.preFilterState

I am not familiar with Kube.netes, so I don't know what is wrong with it. Thanks for your patience.

I try to print noderesources.Name but it failed too.

According to the link you're providing, preFilterState is not exported and therefore not accessible from the outside of the package. It has nothing to do with Kube.netes but with go:

I have a feeling you are starting with go, I recommend you play a bit with the fundamentals of the language and maybe use an IDE/Text editor with intellisense to be able to know what you can and cannot call.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM