ci(lint): re-enable prealloc in golangci-lint config

* resolves prealloc lint warnings in base/reconciler.go
This commit is contained in:
xmbhasin 2025-03-29 21:29:04 -04:00
parent dc33f507e7
commit a889852897
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ linters:
- loggercheck
- misspell
- nakedret
# - prealloc
- prealloc
- staticcheck
- typecheck
- unconvert

View File

@ -267,7 +267,7 @@ func compareMap(expected, actual map[string]string) bool {
}
func compareEnv(expected, actual []corev1.EnvVar) bool {
var actualEnv []corev1.EnvVar
actualEnv := make([]corev1.EnvVar, 0, len(actual))
for _, env := range actual {
if env.Name == "KUBERNETES_PORT_443_TCP_ADDR" || env.Name == "KUBERNETES_PORT" ||
env.Name == "KUBERNETES_PORT_443_TCP" || env.Name == "KUBERNETES_SERVICE_HOST" {
@ -292,7 +292,7 @@ func CompareContainerVolumeMounts(expected corev1.Container, actual corev1.Conta
// compareVolumes returns true if Jenkins pod and Jenkins CR volumes are the same
func (r *JenkinsBaseConfigurationReconciler) compareVolumes(actualPod corev1.Pod) bool {
var toCompare []corev1.Volume
toCompare := make([]corev1.Volume, 0, len(actualPod.Spec.Volumes))
for _, volume := range actualPod.Spec.Volumes {
// filter out service account
if strings.HasPrefix(volume.Name, actualPod.Spec.ServiceAccountName) {