Skip to content

Conversation

@benjaminjb
Copy link
Contributor

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?

Type of Changes:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

What is the current behavior? (link to any open issues here)

When a postgis image starts, the user still needs to enable all the postgis extensions.

What is the new behavior (if this is a feature change)?

Automatically enable postgis and related extensions for postgis images only.
Note: I didn't see any place in the documentation where this change would need to be updated.

Other information:
[sc-12487]

on postgis images Issue: [sc-12487]
Comment on lines 27 to 30
// - postgis
// - postgis_topology
// - fuzzystrmatch
// - postgis_tiger_geocoder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ indentation appears to be off in this comment.

Issue [sc-12487]
Comment on lines 212 to 213
r.Recorder.Event(cluster, corev1.EventTypeWarning, "postgisDisabled",
"Unable to install postgis")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 Event reasons should be upper camel case (aka title case) and the message should capitalize PostGIS the way they've chosen (their proper noun).

Suggested change
r.Recorder.Event(cluster, corev1.EventTypeWarning, "postgisDisabled",
"Unable to install postgis")
r.Recorder.Event(cluster, corev1.EventTypeWarning, "PostGISDisabled",
"Unable to install PostGIS")

Separately, I see that the reason for pgAudit a few lines up is not upper camel case. 🤔 I'm not sure what to do in that situation. I really dislike getting pg, Pg, and PG wrong in names, but we have two conflicting rules in that spot. The rules make me think it should be PgAudit 😢 🤢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure I understand: (1) event reasons should be TitleCase, but (2) we respect capitalization for proper names, so what do we do when the rules dictate different things?

Given this situation, it makes sense to me that pgAuditDisabled => PgAuditDisabled (similar to how our package is pgaudit, not pgAudit -- it's a thing referring to pgAudit, it is not pgAudit itself, if that makes any sense). But that's the only place that I think it should change (though that will make case sensitive searching more aggravating).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per slack discussion, the pgAudit issue shouldn't be a blocker for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure I understand: (1) event reasons should be TitleCase, but (2) we respect capitalization for proper names, so what do we do when the rules dictate different things?

Right.

Issue [sc-12487]
Copy link
Collaborator

@jmckulk jmckulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

- uses: nolar/setup-k3d-k3s@v1
with:
version: "${{ matrix.kubernetes }}"
k3d-tag: v4.4.8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see changes like this as separate commits ⛏️

"Unable to install pgAudit; try restarting PostgreSQL")
}

// Enabling PostGIS extensions is a one-way operation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the comment(s) 👍

@benjaminjb benjaminjb merged commit e411718 into CrunchyData:master Oct 8, 2021
benjaminjb added a commit to benjaminjb/postgres-operator that referenced this pull request Feb 4, 2022
* Enable postgis extensions automatically on postgis images Issue: [sc-12487]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants