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

checkpointer: ignore Affinity within podspec (w/ tests) #1008

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/checkpoint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is accomplished by managing checkpoints as static pod manifests:
## Use

Any pod which contains the `checkpointer.alpha.coreos.com/checkpoint=true` annotation will be considered a viable "parent pod" which should be checkpointed.
The parent pod cannot itself be a static pod, and is not a checkpoint itself.
The parent pod cannot itself be a static pod, and is not a checkpoint itself. Affinity is not supported for a pod, and any pod labelled with the checkpoint annotation will be checkpointed.

Checkpoints are denoted by the `checkpointer.alpha.coreos.com/checkpoint-of` annotation. This annotation will point to the parent of this checkpoint by pod name.

Expand Down
3 changes: 3 additions & 0 deletions pkg/checkpoint/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func sanitizeCheckpointPod(cp *v1.Pod) *v1.Pod {
cp.Spec.ServiceAccountName = ""
cp.Spec.DeprecatedServiceAccount = ""

// Remove affinity
cp.Spec.Affinity = nil

// Sanitize the volumes
for i := range cp.Spec.Volumes {
v := &cp.Spec.Volumes[i]
Expand Down