-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Make Reflector helpers reusable. #3285
Conversation
Scheduler uses Reflector from pkg/client/cache. It defines some helper classes. I'd like to use those helpers with pkg/client/cache in kube-proxy and kubelet too.
a5bde83
to
7d5ac85
Compare
@@ -44,9 +44,9 @@ kube::test::find_pkgs() { | |||
} | |||
|
|||
# -covermode=atomic becomes default with -race in Go >=1.3 | |||
KUBE_COVER=${KUBE_COVER:--cover -covermode=atomic} | |||
KUBE_COVER="" #${KUBE_COVER:--cover -covermode=atomic} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated? Debug changes?
LGTM |
Make Reflector helpers reusable.
// ListWatch knows how to list and watch a set of apiserver resources. | ||
func (lw *ListWatch) List() (runtime.Object, error) { | ||
return lw.Client. | ||
Get(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @erictune
I'm trying to run a kubelet from head in standalone mode (containervm with a --manifest_url
flag) and it's crashing on this line, I assume lw.Client
is undefined in that specific case... Can you please have a look?
@dchen1107 who is probably also interested in containervm.
Cheers,
Filipe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking a look now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you post the complete list of flags (okay to obscure values if needed) you used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind I see the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
kubelet --manifest_url=http://metadata.google.internal/computeMetadata/v1beta1/instance/attributes/google-container-manifest --config=/etc/kubernetes/manifests
You can reproduce this easily by starting a new containervm instance:
gcloud compute instances create --image container-vm ... --metadata-from-file google-container-manifest=<yamlfile>.yaml
This is roughly the YAML snippet I'm using, I'm fairly certain you'll reproduce it with this:
https://cloud.google.com/compute/docs/containers/container_vms#create_the_manifest
Then SSH to your image, replace the kubelet binary with the one from head, edit /etc/default/kubelet to replace the flags with a single dash with two dashes (required since the switch to pflag which uses POSIX-like flags) and reboot it, you'll see this error.
But then, you might be able to reproduce it outside of GCE as well...
Thanks for taking a look at this! Ping me if you have questions for me.
Cheers,
Filipe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scheduler uses Reflector from pkg/client/cache.
It defines some helper classes.
I'd like to use those helpers with pkg/client/cache
in kube-proxy and kubelet too.