Skip to content

Commit

Permalink
Use Constants in ChildReferences
Browse files Browse the repository at this point in the history
Prior to this commit, the APIVersion and Kind fields used different
variables depending on where they were used. In this cleanup, they
use the same constants everywhere.
  • Loading branch information
jerop committed Jun 23, 2022
1 parent b05985c commit 0b8d50a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ func updatePipelineRunStatusFromChildRefs(logger *zap.SugaredLogger, pr *v1beta1
childRefByName[tr.Name] = &v1beta1.ChildStatusReference{
TypeMeta: runtime.TypeMeta{
APIVersion: v1beta1.SchemeGroupVersion.String(),
Kind: "TaskRun",
Kind: pipeline.TaskRunControllerName,
},
Name: tr.Name,
PipelineTaskName: pipelineTaskName,
Expand All @@ -1420,7 +1420,7 @@ func updatePipelineRunStatusFromChildRefs(logger *zap.SugaredLogger, pr *v1beta1
childRefByName[r.Name] = &v1beta1.ChildStatusReference{
TypeMeta: runtime.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
Kind: "Run",
Kind: pipeline.RunControllerName,
},
Name: r.Name,
PipelineTaskName: pipelineTaskName,
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/pipelinerun/resources/pipelinerunstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (state PipelineRunState) GetChildReferences() []v1beta1.ChildStatusReferenc
func (t *ResolvedPipelineTask) getChildRefForRun() v1beta1.ChildStatusReference {
return v1beta1.ChildStatusReference{
TypeMeta: runtime.TypeMeta{
APIVersion: t.Run.APIVersion,
APIVersion: v1alpha1.SchemeGroupVersion.String(),
Kind: pipeline.RunControllerName,
},
Name: t.RunName,
Expand All @@ -274,7 +274,7 @@ func (t *ResolvedPipelineTask) getChildRefForRun() v1beta1.ChildStatusReference
func (t *ResolvedPipelineTask) getChildRefForTaskRun(taskRun *v1beta1.TaskRun) v1beta1.ChildStatusReference {
return v1beta1.ChildStatusReference{
TypeMeta: runtime.TypeMeta{
APIVersion: taskRun.APIVersion,
APIVersion: v1beta1.SchemeGroupVersion.String(),
Kind: pipeline.TaskRunControllerName,
},
Name: taskRun.Name,
Expand Down

0 comments on commit 0b8d50a

Please sign in to comment.