Background
When golangci-lint v2 was introduced in #542, several pre-existing staticcheck issues were found and suppressed via exclusion rules in `.golangci.yml` rather than fixed, to keep the PR focused. This issue tracks removing those exclusions by fixing the underlying problems.
The exclusion rules to remove are in `.golangci.yml` under `linters.exclusions.rules`.
Issues to Fix
`staticcheck` — QF1008, ST1011, QF1006
| Code |
Location |
Description |
| QF1008 |
`controllers/cloud.go:53,59,65` |
Remove unnecessary embedded field qualifier `AmazonClientSet` from selectors |
| QF1008 |
`controllers/rollingupgrade_controller.go:87` |
Remove unnecessary embedded field qualifier `NamespacedName` |
| QF1008 |
`controllers/rollingupgrade_controller.go:319` |
Remove unnecessary embedded field qualifier `Client` |
| QF1008 |
`controllers/upgrade_test.go:388` |
Remove unnecessary embedded field qualifier `KubernetesClientSet` |
| ST1011 |
`controllers/providers/kubernetes/nodes.go:43` |
`var PostDrainDelaySeconds` is of type `time.Duration` — don't use unit-specific suffix `Seconds`; rename to `PostDrainDelay` |
| QF1006 |
`controllers/upgrade.go:561` |
Lift condition into loop |
QF1008 — these are simple selector simplifications, e.g.:
```go
// Before
r.AmazonClientSet.AutoScaling.DescribeXxx(...)
// After
r.AutoScaling.DescribeXxx(...)
```
ST1011 — rename `PostDrainDelaySeconds` → `PostDrainDelay` (update all references).
Definition of Done
- All items above are fixed
- The `rules:` section is removed from `.golangci.yml`
- `golangci-lint run ./...` passes with no exclusion rules
Background
When golangci-lint v2 was introduced in #542, several pre-existing staticcheck issues were found and suppressed via exclusion rules in `.golangci.yml` rather than fixed, to keep the PR focused. This issue tracks removing those exclusions by fixing the underlying problems.
The exclusion rules to remove are in `.golangci.yml` under `linters.exclusions.rules`.
Issues to Fix
`staticcheck` — QF1008, ST1011, QF1006
QF1008 — these are simple selector simplifications, e.g.:
```go
// Before
r.AmazonClientSet.AutoScaling.DescribeXxx(...)
// After
r.AutoScaling.DescribeXxx(...)
```
ST1011 — rename `PostDrainDelaySeconds` → `PostDrainDelay` (update all references).
Definition of Done