kubernetes/plugin/pkg/scheduler/schedulercache
Kubernetes Submit Queue 342ef1115c Merge pull request #42778 from k82cn/sched_cache_sync
Automatic merge from submit-queue (batch tested with PRs 42762, 42739, 42425, 42778)

Fixed potential OutOfSync of nodeInfo.

The cloned NodeInfo still share the same resource objects in cache; it may make `requestedResource` and Pods OutOfSync, for example, if the pod was deleted, the `requestedResource` is updated by Pods are not in cloned info. Found this when investigating #32531 , but seems not the root cause, as nodeInfo are readonly in predicts & priorities.

Sample codes for `&(*)`:

```
package main

import (
	"fmt"
)

type Resource struct {
	A int
}

type Node struct {
	Res *Resource
}

func main() {
	r1 := &Resource { A:10 }
	n1 := &Node{Res: r1}
	r2 := &(*n1.Res)
	r2.A = 11

	fmt.Printf("%t, %d %d\n", r1==r2, r1, r2)
}
```

Output:

```
true, &{11} &{11}
```
2017-03-09 02:51:42 -08:00
..
BUILD Cleanup work to enable feature gating annotations 2017-02-18 09:25:57 -06:00
cache_test.go pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
cache.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
interface.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
node_info.go Merge pull request #42778 from k82cn/sched_cache_sync 2017-03-09 02:51:42 -08:00
reconcile_affinity_test.go Cleanup work to enable feature gating annotations 2017-02-18 09:25:57 -06:00
reconcile_affinity.go Cleanup work to enable feature gating annotations 2017-02-18 09:25:57 -06:00
util.go plugin/scheduler 2016-11-23 15:53:09 -08:00