Skip to content

Commit

Permalink
fix: minor version check for sidecar logic
Browse files Browse the repository at this point in the history
  • Loading branch information
say5 committed Dec 18, 2024
1 parent c2c3085 commit bf59db5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,9 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1.TaskRun, taskSpec v1.Ta
if err != nil {
return nil, err
}
svMinorInt, _ := strconv.Atoi(sv.Minor)
svMinor := strings.TrimSuffix(sv.Minor, "+") // Remove '+' if present
svMajorInt, _ := strconv.Atoi(sv.Major)
svMinorInt, _ := strconv.Atoi(svMinor)
if svMajorInt >= 1 && svMinorInt >= SidecarK8sMinorVersionCheck {
// Add RestartPolicy and Merge into initContainer
useTektonSidecar = false
Expand Down
5 changes: 3 additions & 2 deletions pkg/reconciler/taskrun/taskrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,10 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, tr *v1.TaskRun) pkgrecon
if err != nil {
return err
}
svMinor := strings.TrimSuffix(sv.Minor, "+") // Remove '+' if present
svMajorInt, _ := strconv.Atoi(sv.Major)
svMinorInt, _ := strconv.Atoi(sv.Minor)
if svMajorInt >= 1 && svMinorInt >= 29 {
svMinorInt, _ := strconv.Atoi(svMinor)
if svMajorInt >= 1 && svMinorInt >= podconvert.SidecarK8sMinorVersionCheck {
useTektonSidecar = false
logger.Infof("Using Kubernetes Native Sidecars \n")
}
Expand Down

0 comments on commit bf59db5

Please sign in to comment.