Skip to content

Commit 95930db

Browse files
balinorLiangtjmoore4
authored andcommitted
Fix missing error handling in WriteUsersInPostgreSQL
1 parent 16e02d3 commit 95930db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/postgres/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ SELECT pg_catalog.format('GRANT ALL PRIVILEGES ON DATABASE %I TO %I',
166166
// The operator will attempt to write schemas for the users in the spec if
167167
// * the feature gate is enabled and
168168
// * the cluster is annotated.
169-
if feature.Enabled(ctx, feature.AutoCreateUserSchema) {
169+
if feature.Enabled(ctx, feature.AutoCreateUserSchema) && err == nil {
170170
autoCreateUserSchemaAnnotationValue, annotationExists := cluster.Annotations[naming.AutoCreateUserSchemaAnnotation]
171171
if annotationExists && strings.EqualFold(autoCreateUserSchemaAnnotationValue, "true") {
172172
log.V(1).Info("Writing schemas for users.")

0 commit comments

Comments
 (0)