Skip to content

Commit

Permalink
Don't PATCH Ready annotation if it's already marked ready
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh authored and tekton-robot committed May 13, 2022
1 parent 16d73c5 commit 6b5783c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/pod/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ func init() {
// UpdateReady updates the Pod's annotations to signal the first step to start
// by projecting the ready annotation via the Downward API.
func UpdateReady(ctx context.Context, kubeclient kubernetes.Interface, pod corev1.Pod) error {
// Don't PATCH if the annotation is already Ready.
if pod.Annotations[readyAnnotation] == readyAnnotationValue {
return nil
}

// PATCH the Pod's annotations to replace the ready annotation with the
// "READY" value, to signal the first step to start.
_, err := kubeclient.CoreV1().Pods(pod.Namespace).Patch(ctx, pod.Name, types.JSONPatchType, replaceReadyPatchBytes, metav1.PatchOptions{})
Expand Down

0 comments on commit 6b5783c

Please sign in to comment.