Skip to content

Commit 04a9f49

Browse files
committed
golangci-lint fixes
1 parent bf24060 commit 04a9f49

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
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: 5 additions & 8 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,8 +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),
131-
pgPort, instanceNames,
129+
pgdataDir, pgPort, instanceNames,
132130
postgresCluster.Spec.Backups.PGBackRest.Repos,
133131
postgresCluster.Spec.Backups.PGBackRest.Global,
134132
pgBackRestLogPath,
@@ -157,7 +155,6 @@ func CreatePGBackRestConfigMapIntent(ctx context.Context, postgresCluster *v1bet
157155
cm.Data[CMCloudRepoKey] = iniGeneratedWarning +
158156
populateCloudRepoConfigurationMap(
159157
serviceName, serviceNamespace, pgdataDir,
160-
fmt.Sprint(postgresCluster.Spec.PostgresVersion),
161158
cloudLogPath, pgPort, instanceNames,
162159
postgresCluster.Spec.Backups.PGBackRest.Repos,
163160
postgresCluster.Spec.Backups.PGBackRest.Global,
@@ -361,8 +358,8 @@ exit 1`
361358
// populatePGInstanceConfigurationMap returns options representing the pgBackRest configuration for
362359
// a PostgreSQL instance
363360
func populatePGInstanceConfigurationMap(
364-
serviceName, serviceNamespace, repoHostName, pgdataDir,
365-
postgresVersion string, pgPort int32, repos []v1beta1.PGBackRestRepo,
361+
serviceName, serviceNamespace, repoHostName, pgdataDir string,
362+
pgPort int32, repos []v1beta1.PGBackRestRepo,
366363
globalConfig map[string]string, pgBackRestLogPath string,
367364
) iniSectionSet {
368365

@@ -424,7 +421,7 @@ func populatePGInstanceConfigurationMap(
424421
// populateRepoHostConfigurationMap returns options representing the pgBackRest configuration for
425422
// a pgBackRest dedicated repository host
426423
func populateRepoHostConfigurationMap(
427-
serviceName, serviceNamespace, pgdataDir, postgresVersion string,
424+
serviceName, serviceNamespace, pgdataDir string,
428425
pgPort int32, pgHosts []string, repos []v1beta1.PGBackRestRepo,
429426
globalConfig map[string]string, logPath string,
430427
) iniSectionSet {
@@ -482,7 +479,7 @@ func populateRepoHostConfigurationMap(
482479
}
483480

484481
func populateCloudRepoConfigurationMap(
485-
serviceName, serviceNamespace, pgdataDir, postgresVersion, logPath string,
482+
serviceName, serviceNamespace, pgdataDir, logPath string,
486483
pgPort int32, pgHosts []string, repos []v1beta1.PGBackRestRepo,
487484
globalConfig map[string]string,
488485
) iniSectionSet {

0 commit comments

Comments
 (0)