Make each pod synchronization in the kubelet an independent thread.

Addresses #301
Reading around on go, there's mixed feelings.  Some seem to advocate never
ranging structs by value, others call it premature.  To me it is
instinctive to not copy structs, especially when we know how large some of
the internal container specs become (with lots of flags and stuff)


On Tue, Jul 1, 2014 at 10:08 AM, Daniel Smith <notifications@github.com>
wrote:

> In pkg/kubelet/kubelet.go:
>
> >
> > +// Sync the configured list of containers (desired state) with the host current state
> > +func (kl *Kubelet) SyncManifests(config []api.ContainerManifest) error {
> > +	glog.Infof("Desired: %+v", config)
> > +	var err error
> > +	dockerIdsToKeep := map[DockerId]bool{}
> > +	mapLock := sync.Mutex{}
> > +	waitGroup := sync.WaitGroup{}
> > +
> > +	// Check for any containers that need starting
> > +	for _, manifest := range config {
>
> Although, having said that, I see we're taking the address before giving
> this to syncManifest, which means it's probably going to be a heap
> allocation. I could go either way.
>
> --
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/320/files#r14416373>
> .
>