Skip to content

Commit

Permalink
chore: pkg import only once
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <[email protected]>
  • Loading branch information
testwill authored and tekton-robot committed Nov 10, 2023
1 parent 63e1a26 commit 6bacbdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pkg/apis/pipeline/v1/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"encoding/json"

corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/strategicpatch"
)

Expand Down Expand Up @@ -81,7 +80,7 @@ func MergeStepsWithSpecs(steps []Step, overrides []TaskRunStepSpec) ([]Step, err
if !found {
continue
}
merged := v1.ResourceRequirements{}
merged := corev1.ResourceRequirements{}
err := mergeObjWithTemplate(&s.ComputeResources, &o.ComputeResources, &merged)
if err != nil {
return nil, err
Expand All @@ -107,7 +106,7 @@ func MergeSidecarsWithSpecs(sidecars []Sidecar, overrides []TaskRunSidecarSpec)
if !found {
continue
}
merged := v1.ResourceRequirements{}
merged := corev1.ResourceRequirements{}
err := mergeObjWithTemplate(&s.ComputeResources, &o.ComputeResources, &merged)
if err != nil {
return nil, err
Expand Down
5 changes: 2 additions & 3 deletions pkg/apis/pipeline/v1/pipelinerun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"time"

"github.com/tektoncd/pipeline/pkg/apis/config"
apisconfig "github.com/tektoncd/pipeline/pkg/apis/config"
"github.com/tektoncd/pipeline/pkg/apis/pipeline"
pod "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod"
runv1beta1 "github.com/tektoncd/pipeline/pkg/apis/run/v1beta1"
Expand Down Expand Up @@ -117,7 +116,7 @@ func (pr *PipelineRun) TasksTimeout() *metav1.Duration {
return t.Tasks
}
if t.Pipeline != nil && t.Finally != nil {
if t.Pipeline.Duration == apisconfig.NoTimeoutDuration || t.Finally.Duration == apisconfig.NoTimeoutDuration {
if t.Pipeline.Duration == config.NoTimeoutDuration || t.Finally.Duration == config.NoTimeoutDuration {
return nil
}
return &metav1.Duration{Duration: (t.Pipeline.Duration - t.Finally.Duration)}
Expand All @@ -136,7 +135,7 @@ func (pr *PipelineRun) FinallyTimeout() *metav1.Duration {
return t.Finally
}
if t.Pipeline != nil && t.Tasks != nil {
if t.Pipeline.Duration == apisconfig.NoTimeoutDuration || t.Tasks.Duration == apisconfig.NoTimeoutDuration {
if t.Pipeline.Duration == config.NoTimeoutDuration || t.Tasks.Duration == config.NoTimeoutDuration {
return nil
}
return &metav1.Duration{Duration: (t.Pipeline.Duration - t.Tasks.Duration)}
Expand Down

0 comments on commit 6bacbdc

Please sign in to comment.