Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds database overview to the logs of the csi driver on error and startup #618

Merged
merged 5 commits into from
Mar 18, 2022

Conversation

0sewa0
Copy link
Contributor

@0sewa0 0sewa0 commented Mar 8, 2022

Description

We don't have a good way to check whats in the database, so on startup after the correction logic runs we log the content of the database. We also do this when the csi server stops.

How can this be tested?

When you deploy the csi driver, in the logs there should be a line around the top (~3 line or so) that has the contents of the database on that node.

Checklist

  • Unit tests have been updated/added
  • PR is labeled accordingly

@0sewa0 0sewa0 added the core Changes to core functionality of the Operator label Mar 8, 2022
@0sewa0 0sewa0 requested a review from a team March 8, 2022 09:41
@@ -95,6 +95,22 @@ const (
WHERE TenantUUID = ?;
`

// GET ALL
getAllDynakubesStatement = `
SELECT Name, TenantUUID, LatestVersion
Copy link
Contributor

Choose a reason for hiding this comment

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

Would remove one tab to be identical with the previous statements


dynakubes, err := db.GetAllDynakubes()
assert.NoError(t, err)
assert.Equal(t, 2, len(dynakubes))
Copy link
Contributor

Choose a reason for hiding this comment

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

Would even check if the returned objects are dk1 & dk2

Similar for the next tests

Copy link
Contributor

@gkrenn gkrenn left a comment

Choose a reason for hiding this comment

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

Beside of the small changes you could make, seems to be fine

@0sewa0 0sewa0 enabled auto-merge (squash) March 18, 2022 14:46
@0sewa0 0sewa0 merged commit 75d5079 into master Mar 18, 2022
@0sewa0 0sewa0 deleted the feature/csi-db-dump branch March 18, 2022 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core functionality of the Operator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants