Skip to content

Commit c167a22

Browse files
committed
Address Go linter issues
1 parent 2649811 commit c167a22

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

internal/collector/postgres_metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func EnablePostgresMetrics(ctx context.Context, inCluster *v1beta1.PostgresClust
256256
// appendToJSONArray appends elements of a json.RawMessage containing an array
257257
// to another json.RawMessage containing an array.
258258
func appendToJSONArray(a1, a2 json.RawMessage) (json.RawMessage, error) {
259-
var slc1 []json.RawMessage
259+
var slc1 []json.RawMessage //nolint:prealloc // Populated by json.Unmarshal, not manual appends.
260260
if err := json.Unmarshal(a1, &slc1); err != nil {
261261
return nil, err
262262
}

internal/controller/standalone_pgadmin/users.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ type pgAdminUserForJson struct {
3535
IsAdmin bool `json:"isAdmin"`
3636

3737
// The user's password
38-
//nolint:gosec // G117: This is a JSON serialization struct, not a hardcoded credential.
3938
Password string `json:"password"`
4039

4140
// The username for User in pgAdmin.
@@ -332,6 +331,8 @@ cd $PGADMIN_DIR
332331
// to add a user, that user will not be in intentUsers. If errors occurred when attempting to
333332
// update a user, the user will be in intentUsers as it existed before. We now want to marshal the
334333
// intentUsers to json and write the users.json file to the secret.
334+
335+
//nolint:gosec // G117: Password is intentionally stored in a Kubernetes Secret.
335336
intentUserSecret.Data["users.json"], _ = json.Marshal(intentUsers)
336337

337338
err = errors.WithStack(r.setControllerReference(pgadmin, intentUserSecret))

0 commit comments

Comments
 (0)