func writeCheckpointManifest(pod *corev1.Pod) (bool, error) {
	buff := &bytes.Buffer{}
	if err := podSerializer.Encode(pod, buff); err != nil {
		return false, err
	}
	path := filepath.Join(inactiveCheckpointPath, pod.Namespace+"-"+pod.Name+".json")
	return writeManifestIfDifferent(path, podFullName(pod), buff.Bytes())
}
writeCheckpointManifest will save the pod to the inactive checkpoint location if it doesn't already exist.
package checkpoint
import (
	"bytes"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"github.com/golang/glog"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/client-go/kubernetes/scheme"
)
func getFileCheckpoints(path string) map[string]*corev1.Pod {
	checkpoints := make(map[string]*corev1.Pod)
	fi, err := ioutil.ReadDir(path)
	if err != nil {
		glog.Fatalf("Failed to read checkpoint manifest path: %v", err)
	}
	for _, f := range fi {
		manifest := filepath.Join(path, f.Name())
		if strings.HasPrefix(filepath.Base(manifest), ".") {
			glog.V(4).Infof("Found temporary checkpoint %s, removing.", manifest)
			if err := os.Remove(manifest); err != nil {
				glog.V(4).Infof("Error removing temporary checkpoint %s: %v.", manifest, err)
			}
			continue
		}
		b, err := ioutil.ReadFile(manifest)
		if err != nil {
			glog.Errorf("Error reading manifest: %v", err)
			continue
		}
		cp := &corev1.Pod{}
		if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), b, cp); err != nil {
			glog.Errorf("Error unmarshalling manifest from %s: %v", filepath.Join(path, f.Name()), err)
			continue
		}
		if isCheckpoint(cp) {
			if _, ok := checkpoints[podFullName(cp)]; ok {  
				glog.Warningf("Found multiple checkpoint pods in %s with same id: %s", path, podFullName(cp))
			}
			checkpoints[podFullName(cp)] = cp
		}
	}
	return checkpoints
}