Update pgo test
to check connectivity on instances & endpoints ([ch5712])
#1076
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist:
Type of Changes:
What is the current behavior? (link to any open issues here)
Previously,
pgo test
would check if each individual user available to a PostgreSQL cluster could authenticate with its credentials. While this certainly determines that one can make a connection to a PostgreSQL database managed by the Operator, it also presents several issues:What is the new behavior (if this is a feature change)?
Update the
pgo test
to do the following:pg_isready
, which checks to see if a PostgreSQL instance is available to accept connectionsThese two checks provide the equivalent behavior of what is currently happening today with
pgo test
but in a more efficient manner with less potential for information leakage.The API endpoint now also serves content that is in a structured format.
Additionally, the event that was fired when "test event" is called is removed. This does not affect any lifecycle activity of a PostgreSQL cluster and as it is fired ad-hoc by a user, does not need to be propagated downstream.
Other information:
Here is a test case:
Client #1:
watch pgo test -n jkatz jkatz
Client #2: