Skip to content

Commit 905ab36

Browse files
bendorytekton-robot
authored andcommitted
Cleanup: fix failures from updated golangci-lint.
Cleanup: fix failures from updated golangci-lint. There are no functional changes expected in this PR. - `go fmt` whitespace - Added several #nosec directives /kind cleanup
1 parent 14ccac5 commit 905ab36

File tree

27 files changed

+71
-62
lines changed

27 files changed

+71
-62
lines changed

cmd/controller/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func main() {
101101
go func() {
102102
// start the web server on port and accept requests
103103
log.Printf("Readiness and health check server listening on port %s", port)
104-
log.Fatal(http.ListenAndServe(":"+port, mux))
104+
log.Fatal(http.ListenAndServe(":"+port, mux)) // #nosec G114 -- see https://github.com/securego/gosec#available-rules
105105
}()
106106

107107
ctx = filteredinformerfactory.WithSelectors(ctx, v1beta1.ManagedByLabelKey)

cmd/entrypoint/runner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
99
You may obtain a copy of the License at
1010
11-
http://www.apache.org/licenses/LICENSE-2.0
11+
http://www.apache.org/licenses/LICENSE-2.0
1212
1313
Unless required by applicable law or agreed to in writing, software
1414
distributed under the License is distributed on an "AS IS" BASIS,

cmd/git-init/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

cmd/imagedigestexporter/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ var (
3333
terminationMessagePath = flag.String("terminationMessagePath", "/tekton/termination", "Location of file containing termination message")
3434
)
3535

36-
/* The input of this go program will be a JSON string with all the output PipelineResources of type
36+
/*
37+
The input of this go program will be a JSON string with all the output PipelineResources of type
38+
3739
Image, which will include the path to where the index.json file will be located. The program will
3840
read the related index.json file(s) and log another JSON string including the name of the image resource
3941
and the digests.

cmd/pullrequest-init/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

cmd/webhook/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func main() {
242242
go func() {
243243
// start the web server on port and accept requests
244244
log.Printf("Readiness and health check server listening on port %s", port)
245-
log.Fatal(http.ListenAndServe(":"+port, mux))
245+
log.Fatal(http.ListenAndServe(":"+port, mux)) // #nosec G114 -- see https://github.com/securego/gosec#available-rules
246246
}()
247247

248248
sharedmain.MainWithContext(ctx, serviceName,

pkg/apis/pipeline/pod/template.go

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func (tpl *Template) ToAffinityAssistantTemplate() *AffinityAssistantTemplate {
155155
}
156156

157157
// PodTemplate holds pod specific configuration
158+
//
158159
//nolint:revive
159160
type PodTemplate = Template
160161

pkg/apis/pipeline/v1/container_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/apis/pipeline/v1/taskrun_defaults_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/apis/pipeline/v1beta1/resource_types_validation.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ func (tr *TaskRunResources) Validate(ctx context.Context) *apis.FieldError {
7373
}
7474

7575
// validateTaskRunResources validates that
76-
// 1. resource is not declared more than once
77-
// 2. if both resource reference and resource spec is defined at the same time
78-
// 3. at least resource ref or resource spec is defined
76+
// 1. resource is not declared more than once
77+
// 2. if both resource reference and resource spec is defined at the same time
78+
// 3. at least resource ref or resource spec is defined
7979
func validateTaskRunResources(ctx context.Context, resources []TaskResourceBinding, path string) *apis.FieldError {
8080
encountered := sets.NewString()
8181
for _, r := range resources {

pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/controller/filter.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ import (
3434
// For example, a controller impl that wants to be notified of updates to Runs
3535
// which reference a Task with apiVersion "example.dev/v0" and kind "Example":
3636
//
37-
// runinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
38-
// FilterFunc: FilterRunRef("example.dev/v0", "Example"),
39-
// Handler: controller.HandleAll(impl.Enqueue),
40-
// })
37+
// runinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
38+
// FilterFunc: FilterRunRef("example.dev/v0", "Example"),
39+
// Handler: controller.HandleAll(impl.Enqueue),
40+
// })
4141
func FilterRunRef(apiVersion, kind string) func(interface{}) bool {
4242
return func(obj interface{}) bool {
4343
r, ok := obj.(*v1alpha1.Run)
@@ -67,10 +67,10 @@ func FilterRunRef(apiVersion, kind string) func(interface{}) bool {
6767
// For example, a controller impl that wants to be notified of updates to TaskRuns that are controlled by
6868
// a Run which references a custom task with apiVersion "example.dev/v0" and kind "Example":
6969
//
70-
// taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
71-
// FilterFunc: FilterOwnerRunRef("example.dev/v0", "Example"),
72-
// Handler: controller.HandleAll(impl.Enqueue),
73-
// })
70+
// taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
71+
// FilterFunc: FilterOwnerRunRef("example.dev/v0", "Example"),
72+
// Handler: controller.HandleAll(impl.Enqueue),
73+
// })
7474
func FilterOwnerRunRef(runLister listersalpha.RunLister, apiVersion, kind string) func(interface{}) bool {
7575
return func(obj interface{}) bool {
7676
object, ok := obj.(metav1.Object)
@@ -114,10 +114,10 @@ func FilterOwnerRunRef(runLister listersalpha.RunLister, apiVersion, kind string
114114
// For example, a controller impl that wants to be notified of updates to CustomRuns
115115
// which reference a Task with apiVersion "example.dev/v0" and kind "Example":
116116
//
117-
// customruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
118-
// FilterFunc: FilterCustomRunRef("example.dev/v0", "Example"),
119-
// Handler: controller.HandleAll(impl.Enqueue),
120-
// })
117+
// customruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
118+
// FilterFunc: FilterCustomRunRef("example.dev/v0", "Example"),
119+
// Handler: controller.HandleAll(impl.Enqueue),
120+
// })
121121
func FilterCustomRunRef(apiVersion, kind string) func(interface{}) bool {
122122
return func(obj interface{}) bool {
123123
r, ok := obj.(*v1beta1.CustomRun)
@@ -147,10 +147,10 @@ func FilterCustomRunRef(apiVersion, kind string) func(interface{}) bool {
147147
// For example, a controller impl that wants to be notified of updates to TaskRuns that are controlled by
148148
// a CustomRun which references a custom task with apiVersion "example.dev/v0" and kind "Example":
149149
//
150-
// taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
151-
// FilterFunc: FilterOwnerCustomRunRef("example.dev/v0", "Example"),
152-
// Handler: controller.HandleAll(impl.Enqueue),
153-
// })
150+
// taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
151+
// FilterFunc: FilterOwnerCustomRunRef("example.dev/v0", "Example"),
152+
// Handler: controller.HandleAll(impl.Enqueue),
153+
// })
154154
func FilterOwnerCustomRunRef(customRunLister listersbeta.CustomRunLister, apiVersion, kind string) func(interface{}) bool {
155155
return func(obj interface{}) bool {
156156
object, ok := obj.(metav1.Object)

pkg/internal/affinityassistant/transformer_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/internal/computeresources/compare/compare.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/internal/computeresources/limitrange/limitrange_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/internal/computeresources/transformer_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/reconciler/doc.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ limitations under the License.
2121
//
2222
// Despite defining a Reconciler, each of the packages here are expected to
2323
// expose a controller constructor like:
24-
// func NewController(...) *controller.Impl { ... }
24+
//
25+
// func NewController(...) *controller.Impl { ... }
26+
//
2527
// These constructors will:
26-
// 1. Construct the Reconciler,
27-
// 2. Construct a controller.Impl with that Reconciler,
28-
// 3. Wire the assorted informers this Reconciler watches to call appropriate
29-
// enqueue methods on the controller.
28+
// 1. Construct the Reconciler,
29+
// 2. Construct a controller.Impl with that Reconciler,
30+
// 3. Wire the assorted informers this Reconciler watches to call appropriate
31+
// enqueue methods on the controller.
3032
package reconciler

pkg/reconciler/pipelinerun/resources/input_output_steps_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/reconciler/resolutionrequest/doc.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ that global settings and constraints are enforced independent of
2121
the "type" of ResolutionRequest being resolved.
2222
2323
Examples of the kinds of global settings that need to be enforced include:
24-
* Ensuring that the object's Status fields are correctly initialized.
25-
* Ensuring that all ResolutionRequests eventually get timed out.
26-
* Ensuring that ResolutionRequests with populated Data field are marked as complete.
24+
- Ensuring that the object's Status fields are correctly initialized.
25+
- Ensuring that all ResolutionRequests eventually get timed out.
26+
- Ensuring that ResolutionRequests with populated Data field are marked as complete.
2727
*/
2828
package resolutionrequest

pkg/reconciler/taskrun/resources/output_resource.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ var (
3737
// target directory.
3838
// Steps executed:
3939
// 1. If taskrun has owner reference as pipelinerun then all outputs are copied to parents PVC
40+
//
4041
// and also runs any custom upload steps (upload to blob store)
41-
// 2. If taskrun does not have pipelinerun as owner reference then all outputs resources execute their custom
42+
// 2. If taskrun does not have pipelinerun as owner reference then all outputs resources execute their custom
43+
//
4244
// upload steps (like upload to blob store )
4345
//
4446
// Resource source path determined

pkg/reconciler/taskrun/resources/volume.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ func GetPVCVolume(name string) corev1.Volume {
3636
// Specifically, they have the following structure as defined by
3737
// (pkg/apis/resource/v1alpha1/storage.ArtifactBucket).GetSecretsVolumes():
3838
//
39-
// corev1.Volume{
40-
// Name: fmt.Sprintf("volume-bucket-%s", sec.SecretName),
41-
// VolumeSource: corev1.VolumeSource{
42-
// Secret: &corev1.SecretVolumeSource{
43-
// SecretName: sec.SecretName,
44-
// },
45-
// },
46-
// }
39+
// corev1.Volume{
40+
// Name: fmt.Sprintf("volume-bucket-%s", sec.SecretName),
41+
// VolumeSource: corev1.VolumeSource{
42+
// Secret: &corev1.SecretVolumeSource{
43+
// SecretName: sec.SecretName,
44+
// },
45+
// },
46+
// }
4747
//
4848
// Any new volumes that don't match this structure are added regardless of whether they are already
4949
// present in the list of volumes.

pkg/remote/errors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/termination/parse_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

pkg/termination/write_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

test/dag_test.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ const sleepDuration = 15 * time.Second
4040

4141
// TestDAGPipelineRun creates a graph of arbitrary Tasks, then looks at the corresponding
4242
// TaskRun start times to ensure they were run in the order intended, which is:
43-
// |
44-
// pipeline-task-1
45-
// / \
46-
// pipeline-task-2-parallel-1 pipeline-task-2-parallel-2
47-
// \ /
48-
// pipeline-task-3
49-
// |
50-
// pipeline-task-4
43+
//
44+
// |
45+
// pipeline-task-1
46+
// / \
47+
// pipeline-task-2-parallel-1 pipeline-task-2-parallel-2
48+
// \ /
49+
// pipeline-task-3
50+
// |
51+
// pipeline-task-4
5152
func TestDAGPipelineRun(t *testing.T) {
5253
ctx := context.Background()
5354
ctx, cancel := context.WithCancel(ctx)

test/gohelloworld/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func main() {
3131
log.Print("Hello world sample started.")
3232

3333
http.HandleFunc("/", handler)
34+
// #nosec G114 -- see https://github.com/securego/gosec#available-rules
3435
if err := http.ListenAndServe(":8080", nil); err != nil {
3536
panic(err)
3637
}

test/registry_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
99
You may obtain a copy of the License at
1010
11-
http://www.apache.org/licenses/LICENSE-2.0
11+
http://www.apache.org/licenses/LICENSE-2.0
1212
1313
Unless required by applicable law or agreed to in writing, software
1414
distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)