Skip to content

Conversation

@votdev
Copy link
Member

@votdev votdev commented Jan 12, 2026

Problem:
Make validate reports errors from linter.

 Running validation
Running: golangci-lint run
tests/setup/harvester_mock.go:85:6: Consider preallocating results with capacity 1 (prealloc)
	var results []*extv1.CustomResourceDefinition
	    ^
1 issues:
* prealloc: 1

Solution:
Fix the linter error.

Related Issue:

Test plan:

@votdev votdev self-assigned this Jan 12, 2026
Copilot AI review requested due to automatic review settings January 12, 2026 10:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a prealloc linter error by refactoring the generateK8sCniCncfIoCRD() function to avoid unnecessary slice allocation and append operations.

Changes:

  • Replaced the pattern of declaring an empty slice and then appending to it with a direct return of a slice composite literal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Volker Theile <vtheile@suse.com>
@votdev votdev merged commit 27ede31 into harvester:main Jan 13, 2026
6 checks passed
@votdev votdev deleted the fix_lint_errors branch January 13, 2026 10:32
@starbops
Copy link
Member

@mergify backport v1.7

@mergify
Copy link

mergify bot commented Jan 22, 2026

backport v1.7

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Jan 22, 2026
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit 27ede31)
starbops pushed a commit that referenced this pull request Jan 22, 2026
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit 27ede31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants