Skip to content

Commit

Permalink
Reflect tektoncd/pipeline release version as an annotation on pod
Browse files Browse the repository at this point in the history
As a followup to #1650 ,
the `tekton.dev/release` annotation is set on the pod to reflect
the value of version.PipelineVersion

Signed-off-by: Vibhav Bobade <[email protected]>
  • Loading branch information
waveywaves committed Dec 17, 2019
1 parent 0f20c35 commit 0d10efc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/pod/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package pod
import (
"errors"
"fmt"
"github.com/tektoncd/pipeline/pkg/version"
"path/filepath"
"strings"

Expand All @@ -43,6 +44,8 @@ const (
)

var (
releaseAnnotation = "tekon.dev/release"
releaseAnnotationValue = version.PipelineVersion
// TODO(#1605): Generate volumeMount names, to avoid collisions.
toolsMount = corev1.VolumeMount{
Name: toolsVolumeName,
Expand Down Expand Up @@ -148,6 +151,7 @@ func UpdateReady(kubeclient kubernetes.Interface, pod corev1.Pod) error {
// start.
if newPod.ObjectMeta.Annotations == nil {
newPod.ObjectMeta.Annotations = map[string]string{}
newPod.ObjectMeta.Annotations[releaseAnnotation] = releaseAnnotationValue
}
if newPod.ObjectMeta.Annotations[readyAnnotation] != readyAnnotationValue {
newPod.ObjectMeta.Annotations[readyAnnotation] = readyAnnotationValue
Expand Down

0 comments on commit 0d10efc

Please sign in to comment.