Skip to content

Commit 2dd3b36

Browse files
committed
golangci-lint fixes
1 parent bf24060 commit 2dd3b36

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

internal/controller/pgupgrade/jobs.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ func (r *PGUpgradeReconciler) generateUpgradeJob(
227227
settings := upgrade.Spec.PGUpgradeSettings.DeepCopy()
228228

229229
// When jobs is undefined, use one less than the number of CPUs.
230-
//nolint:gosec // The CPU count is clamped to MaxInt32.
231230
if settings.Jobs == 0 && feature.Enabled(ctx, feature.PGUpgradeCPUConcurrency) {
232231
wholeCPUs := int32(min(math.MaxInt32, largestWholeCPU(upgrade.Spec.Resources)))
233232
settings.Jobs = wholeCPUs - 1

internal/controller/postgrescluster/instance.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ func (r *Reconciler) observeInstances(
341341
status.DesiredPGWALVolume = make(map[string]string)
342342

343343
for _, instance := range observed.bySet[name] {
344-
//nolint:gosec // This slice is always small.
345344
status.Replicas += int32(len(instance.Pods))
346345

347346
if ready, known := instance.IsReady(); known && ready {

internal/pgbackrest/config.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ func CreatePGBackRestConfigMapIntent(ctx context.Context, postgresCluster *v1bet
107107
cm.Data[CMInstanceKey] = iniGeneratedWarning +
108108
populatePGInstanceConfigurationMap(
109109
serviceName, serviceNamespace, repoHostName, pgdataDir,
110-
fmt.Sprint(postgresCluster.Spec.PostgresVersion),
111110
pgPort, postgresCluster.Spec.Backups.PGBackRest.Repos,
112111
postgresCluster.Spec.Backups.PGBackRest.Global,
113112
util.GetPGBackRestLogPathForInstance(postgresCluster),
@@ -127,7 +126,7 @@ func CreatePGBackRestConfigMapIntent(ctx context.Context, postgresCluster *v1bet
127126
cm.Data[CMRepoKey] = iniGeneratedWarning +
128127
populateRepoHostConfigurationMap(
129128
serviceName, serviceNamespace,
130-
pgdataDir, fmt.Sprint(postgresCluster.Spec.PostgresVersion),
129+
fmt.Sprint(postgresCluster.Spec.PostgresVersion),
131130
pgPort, instanceNames,
132131
postgresCluster.Spec.Backups.PGBackRest.Repos,
133132
postgresCluster.Spec.Backups.PGBackRest.Global,
@@ -156,7 +155,7 @@ func CreatePGBackRestConfigMapIntent(ctx context.Context, postgresCluster *v1bet
156155
if CloudRepoDefined(postgresCluster) {
157156
cm.Data[CMCloudRepoKey] = iniGeneratedWarning +
158157
populateCloudRepoConfigurationMap(
159-
serviceName, serviceNamespace, pgdataDir,
158+
serviceName, serviceNamespace,
160159
fmt.Sprint(postgresCluster.Spec.PostgresVersion),
161160
cloudLogPath, pgPort, instanceNames,
162161
postgresCluster.Spec.Backups.PGBackRest.Repos,
@@ -361,8 +360,8 @@ exit 1`
361360
// populatePGInstanceConfigurationMap returns options representing the pgBackRest configuration for
362361
// a PostgreSQL instance
363362
func populatePGInstanceConfigurationMap(
364-
serviceName, serviceNamespace, repoHostName, pgdataDir,
365-
postgresVersion string, pgPort int32, repos []v1beta1.PGBackRestRepo,
363+
serviceName, serviceNamespace, repoHostName, pgdataDir string,
364+
pgPort int32, repos []v1beta1.PGBackRestRepo,
366365
globalConfig map[string]string, pgBackRestLogPath string,
367366
) iniSectionSet {
368367

@@ -424,7 +423,7 @@ func populatePGInstanceConfigurationMap(
424423
// populateRepoHostConfigurationMap returns options representing the pgBackRest configuration for
425424
// a pgBackRest dedicated repository host
426425
func populateRepoHostConfigurationMap(
427-
serviceName, serviceNamespace, pgdataDir, postgresVersion string,
426+
serviceName, serviceNamespace, pgdataDir string,
428427
pgPort int32, pgHosts []string, repos []v1beta1.PGBackRestRepo,
429428
globalConfig map[string]string, logPath string,
430429
) iniSectionSet {
@@ -482,7 +481,7 @@ func populateRepoHostConfigurationMap(
482481
}
483482

484483
func populateCloudRepoConfigurationMap(
485-
serviceName, serviceNamespace, pgdataDir, postgresVersion, logPath string,
484+
serviceName, serviceNamespace, pgdataDir, logPath string,
486485
pgPort int32, pgHosts []string, repos []v1beta1.PGBackRestRepo,
487486
globalConfig map[string]string,
488487
) iniSectionSet {

0 commit comments

Comments
 (0)