Move from go-yaml/yaml to ghodss/yaml

This commit is contained in:
Sam Ghods
2014-11-30 20:12:37 -08:00
parent 603ec33821
commit 9a9a1e0939
27 changed files with 61 additions and 122 deletions

View File

@@ -59,10 +59,13 @@ func CreateValidPod(name, namespace, source string) api.BoundPod {
}
func CreatePodUpdate(op kubelet.PodOperation, pods ...api.BoundPod) kubelet.PodUpdate {
if len(pods) == 0 {
return kubelet.PodUpdate{Op: op}
}
// We deliberately return an empty slice instead of a nil pointer here
// because reflect.DeepEqual differentiates between the two and we need to
// pick one for consistency.
newPods := make([]api.BoundPod, len(pods))
if len(pods) == 0 {
return kubelet.PodUpdate{newPods, op}
}
for i := range pods {
newPods[i] = pods[i]
}