Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 4152ac3

Browse files
authored
Merge pull request #178 from kenan435/strip-nonessential-info
Stripping of nonessential info prior to checkpointing
2 parents 0eac9df + 215fad7 commit 4152ac3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/checkpoint/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,16 @@ func run() {
9090
}
9191
}
9292
}
93-
time.Sleep(60 * time.Second)
93+
time.Sleep(1 * time.Second)
9494
}
9595
}
9696

97+
func stripNonessentialInfo(p *v1.Pod) {
98+
p.Spec.ServiceAccountName = ""
99+
p.Spec.DeprecatedServiceAccount = ""
100+
p.Status.Reset()
101+
}
102+
97103
func getPodsFromKubeletAPI() []byte {
98104
var pods []byte
99105
res, err := http.Get(kubeletAPIPodsURL)
@@ -183,6 +189,7 @@ func parseAPIPodSpec(podList v1.PodList) v1.PodSpec {
183189
}
184190
}
185191
cleanVolumes(&apiPod)
192+
stripNonessentialInfo(&apiPod)
186193
return apiPod.Spec
187194
}
188195

0 commit comments

Comments
 (0)