Skip to content

Commit 115586c

Browse files
chore(tests): fix remaining tests
1 parent 713fa22 commit 115586c

File tree

6 files changed

+23
-17
lines changed

6 files changed

+23
-17
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ importfmt: get-fmt-deps ## Checks the import format of the Go source files
133133
fmt: importfmt
134134
@echo "FORMATTING SOURCE"
135135
FORMATTED=`$(GO) fmt ./...`
136-
@([[ ! -z "$(FORMATTED)" ]] && printf "Fixed un-formatted files:\n$(FORMATTED)") || true
136+
@([ ! -z "$(FORMATTED)" ] && printf "Fixed un-formatted files:\n$(FORMATTED)") || true
137137

138138
GOLINT := $(GOPATH)/bin/golint
139139
$(GOLINT):

go.mod

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ require (
2525
github.com/tektoncd/pipeline v0.65.3
2626
golang.org/x/oauth2 v0.23.0
2727
gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5
28-
k8s.io/api v0.32.1
28+
k8s.io/api v0.32.3
29+
k8s.io/apiextensions-apiserver v0.32.3 // indirect
2930
k8s.io/apimachinery v0.32.3
30-
k8s.io/client-go v0.32.1
31+
k8s.io/client-go v0.32.3
3132
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
3233
knative.dev/pkg v0.0.0-20240416145024-0f34a8815650
3334
sigs.k8s.io/controller-runtime v0.20.3
@@ -111,7 +112,6 @@ require (
111112
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
112113
gopkg.in/yaml.v2 v2.4.0 // indirect
113114
gopkg.in/yaml.v3 v3.0.1 // indirect
114-
k8s.io/apiextensions-apiserver v0.32.1 // indirect
115115
k8s.io/klog/v2 v2.130.1 // indirect
116116
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
117117
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
@@ -128,8 +128,6 @@ replace (
128128

129129
// gomodules.xyz breaks in Athens proxying
130130
gomodules.xyz/jsonpatch/v2 => github.com/gomodules/jsonpatch/v2 v2.2.0
131-
k8s.io/api => k8s.io/api v0.32.3
132-
k8s.io/apimachinery => k8s.io/apimachinery v0.32.3
133131
)
134132

135133
go 1.23.0

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,12 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
755755
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
756756
k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls=
757757
k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k=
758-
k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw=
759-
k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto=
758+
k8s.io/apiextensions-apiserver v0.32.3 h1:4D8vy+9GWerlErCwVIbcQjsWunF9SUGNu7O7hiQTyPY=
759+
k8s.io/apiextensions-apiserver v0.32.3/go.mod h1:8YwcvVRMVzw0r1Stc7XfGAzB/SIVLunqApySV5V7Dss=
760760
k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U=
761761
k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
762-
k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU=
763-
k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg=
762+
k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU=
763+
k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY=
764764
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
765765
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
766766
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=

pkg/apis/lighthouse/v1alpha1/breakpoint_test.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ func TestBreakpointResolveDebug(t *testing.T) {
2222
Task: "sometask",
2323
},
2424
Debug: pipelinev1.TaskRunDebug{
25-
Breakpoint: []string{"onFailure"},
25+
Breakpoints: &pipelinev1.TaskBreakpoints{
26+
OnFailure: "onFailure",
27+
},
2628
},
2729
},
2830
},
@@ -32,7 +34,9 @@ func TestBreakpointResolveDebug(t *testing.T) {
3234
Task: "special-task",
3335
},
3436
Debug: pipelinev1.TaskRunDebug{
35-
Breakpoint: []string{"something"},
37+
Breakpoints: &pipelinev1.TaskBreakpoints{
38+
OnFailure: "something",
39+
},
3640
},
3741
},
3842
},
@@ -54,7 +58,9 @@ func TestBreakpointResolveDebug(t *testing.T) {
5458
Task: "sometask",
5559
},
5660
expected: &pipelinev1.TaskRunDebug{
57-
Breakpoint: []string{"onFailure"},
61+
Breakpoints: &pipelinev1.TaskBreakpoints{
62+
OnFailure: "onFailure",
63+
},
5864
},
5965
},
6066
{
@@ -91,7 +97,7 @@ func TestBreakpointResolveDebug(t *testing.T) {
9197
},
9298
expected: &pipelinev1.TaskRunDebug{
9399
Breakpoints: &pipelinev1.TaskBreakpoints{
94-
BeforeSteps: []string{"something"},
100+
OnFailure: "something",
95101
},
96102
},
97103
},

pkg/keeper/pipelinerun_monitor_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ func makeTestPipelineRun(condition *kpgapis.Condition, baseRunName string, pipel
186186
APIVersion: tektonAPIVersion,
187187
Name: pipelineName,
188188
},
189-
ServiceAccountName: sa,
189+
TaskRunTemplate: pipelinev1.PipelineTaskRunTemplate{
190+
ServiceAccountName: sa,
191+
},
190192
},
191193
Status: pipelinev1.PipelineRunStatus{},
192194
}

pkg/plugins/updateconfig/updateconfig.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func Update(fg FileGetter, kc corev1.ConfigMapInterface, name, namespace string,
119119
return fmt.Errorf("failed to fetch current state of configmap: %v", getErr)
120120
}
121121

122-
if cm == nil {
122+
if cm == nil || isNotFound {
123123
cm = &coreapi.ConfigMap{
124124
ObjectMeta: metav1.ObjectMeta{
125125
Name: name,
@@ -149,7 +149,7 @@ func Update(fg FileGetter, kc corev1.ConfigMapInterface, name, namespace string,
149149
logger.WithFields(logrus.Fields{"key": upd.Key, "cmName": upd.Filename}).Debug("Populating key.")
150150
value := content
151151
if upd.GZIP {
152-
buff := bytes.NewBuffer([]byte{})
152+
buff := new(bytes.Buffer)
153153
// TODO: this error is wildly unlikely for anything that
154154
// would actually fit in a configmap, we could just as well return
155155
// the error instead of falling back to the raw content

0 commit comments

Comments
 (0)