Skip to content

Commit

Permalink
correcting golangci-lint and gosec issues
Browse files Browse the repository at this point in the history
Fixing gosec issue

G601 (CWE-118): Implicit memory aliasing in for loop. (Confidence: MEDIUM, Severity: MEDIUM)
  • Loading branch information
coreydaley committed Aug 21, 2023
1 parent 81b44af commit 457c607
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion controllers/pipelinerun_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (r *PipelineRunReconciler) Reconcile(
var triggeredBuilds = []filter.TriggeredBuild{}
if filter.PipelineRunAnnotatedNameMatchesObject(&pipelineRun) {
// extracting existing triggered-builds from the annotation, information needed to detect if
// the BuildRuns have already beeing issued for the PipelineRun
// the BuildRuns have already been issued for the PipelineRun
triggeredBuilds, err = filter.PipelineRunExtractTriggeredBuildsSlice(&pipelineRun)
if err != nil {
logger.V(0).Error(err, "parsing triggered-builds annotation")
Expand Down
4 changes: 2 additions & 2 deletions pkg/filter/customrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// ParamValues slice.
func TektonCustomRunParamsToShipwrightParamValues(customRun *tknv1beta1.CustomRun) []v1alpha1.ParamValue {
paramValues := []v1alpha1.ParamValue{}
for _, p := range customRun.Spec.Params {
for i, p := range customRun.Spec.Params {
paramValue := v1alpha1.ParamValue{Name: p.Name}
if p.Value.Type == tknv1beta1.ParamTypeArray {
paramValue.Values = []v1alpha1.SingleValue{}
Expand All @@ -28,7 +28,7 @@ func TektonCustomRunParamsToShipwrightParamValues(customRun *tknv1beta1.CustomRu
}
} else {
paramValue.SingleValue = &v1alpha1.SingleValue{
Value: &p.Value.StringVal,
Value: &customRun.Spec.Params[i].Value.StringVal,
}
}
paramValues = append(paramValues, paramValue)
Expand Down
2 changes: 1 addition & 1 deletion pkg/filter/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
TektonPipelineRunTriggeredBuilds = fmt.Sprintf("%s/pipelinerun-triggered-builds", Prefix)
)

// pipelineRunReferencesShipwright checks if the informed PipelineRun is reffering to a Shipwright
// pipelineRunReferencesShipwright checks if the informed PipelineRun is referring to a Shipwright
// resource via TaskRef.
func pipelineRunReferencesShipwright(pipelineRun *tknv1beta1.PipelineRun) bool {
if pipelineRun.Status.PipelineSpec == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/inventory/search_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// SearchResult contains a Inventory result item.
type SearchResult struct {
BuildName types.NamespacedName // build name maching criteria
BuildName types.NamespacedName // build name matching criteria
SecretName types.NamespacedName // respective secret coordinates (for webhook)
}

Expand Down

0 comments on commit 457c607

Please sign in to comment.