Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .golangci.json

This file was deleted.

19 changes: 19 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "2"
linters:
default: none
enable:
- asasalint
- asciicheck
- bidichk
- gosec
- govet
- ineffassign
- misspell
exclusions:
rules:
- path: 'main.go'
text: 'G114: Use of net/http serve function that has no support for setting timeouts'
formatters:
enable:
- gofmt
- goimports
2 changes: 1 addition & 1 deletion hack/make/deps.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# renovate: datasource=github-release-attachments depName=golangci/golangci-lint
GOLANGCI_VERSION = v1.64.8
GOLANGCI_VERSION = v2.0.2
# renovate: datasource=github-release-attachments depName=k3d-io/k3d
K3D_VERSION = v5.8.3

Expand Down
3 changes: 3 additions & 0 deletions pkg/condition/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ func getValue(obj interface{}, name ...string) reflect.Value {
}

func getFieldValue(v reflect.Value, name ...string) reflect.Value {
if len(name) == 0 {
return reflect.Value{}
}
field := v.FieldByName(name[0])
if len(name) == 1 {
return field
Expand Down
2 changes: 1 addition & 1 deletion pkg/crds/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func WriteCRD() error {
}

filename := fmt.Sprintf("./crds/%s.yaml", strings.ToLower(crd.Spec.Names.Kind))
err = os.WriteFile(filename, yamlBytes, 0o644)
err = os.WriteFile(filename, yamlBytes, 0o600)
Comment thread
andypitcher marked this conversation as resolved.
if err != nil {
return err
}
Expand Down
10 changes: 8 additions & 2 deletions pkg/securityscan/jobHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,14 @@ func (c *Controller) handleJobs(ctx context.Context) error {
c.setClusterScanStatusDisplay(scan)

if scan.Spec.ScheduledScanConfig != nil && scan.Spec.ScheduledScanConfig.CronSchedule != "" {
c.rescheduleScan(scan)
c.purgeOldClusterScanReports(scan)
err := c.rescheduleScan(scan)
if err != nil {
return obj, fmt.Errorf("error rescheduling scan: %w", err)
}
err = c.purgeOldClusterScanReports(scan)
if err != nil {
return obj, fmt.Errorf("error purging old ClusterScanReports: %w", err)
}
Comment thread
pjbgf marked this conversation as resolved.
}
err := c.deleteJob(jobs, obj, metav1.DeletePropagationBackground)
if err != nil {
Expand Down