-
Notifications
You must be signed in to change notification settings - Fork 23
[SECURESIGN-3170] Support PostgreSQL as an optional backend database for Trillian #1483
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
Open
fghanmi
wants to merge
9
commits into
main
Choose a base branch
from
SECURESIGN-3170
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5a541ac
Support PostgreSQL as an optional backend database for Trillian
fghanmi a03496c
update var names
fghanmi b80c022
updates
fghanmi 1a10ce0
update DbPvcName
fghanmi 2a844ca
updates
fghanmi 3094cfe
review updates: ensure backward compatibility
fghanmi 826435f
fix manifests
fghanmi 1bde570
fix go lint
fghanmi 0307a95
update trillian/utils/server-deployment.go
fghanmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about the new set of variables. Could we consider using the data source URL, similar to how we handle the search index? https://github.com/securesign/secure-sign-operator/blob/main/api/v1alpha1/rekor_types.go#L154
Envs are mounted by https://github.com/securesign/secure-sign-operator/blob/main/api/v1alpha1/rekor_types.go#L55
Any changes must be implemented carefully to maintain backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean for both providers (mysql and postgresql) ?
If it's only for postgresql, I have added env variables for postgresql to have a similar config as mysql to be able to re-use the existing code in server-deployment.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, for both. I would like to have unified API for all components. The searchIndex uses the following format (see the data source spec https://jdbc.postgresql.org/documentation/use/#connecting-to-the-database):
"$(MYSQL_USER):$(MYSQL_PASSWORD)@tcp(my-mysql.$(NAMESPACE).svc:3300)/$(MYSQL_DB)"https://github.com/securesign/secure-sign-operator/blob/main/test/e2e/byodb_test.go#L43
I know, that this could mean an API change that we can't afford in a minor version release. I just want to bring this to the table and explore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about changing
searchIndexconfig to be as trillian DB's ? I find it easier to be handled by the customers.I think providing the full database URL puts too much responsibility on the customer and increases the chance of mistakes. Supplying only the essential variables allows the operator to assemble the URL correctly and consistently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Utilizing a URL to pass the datasource is a widely accepted convention. This method provides the flexibility to embed numerous configuration parameters, such as those relating to TLS (Transport Layer Security). Conversely, the discovery of proprietary parameter names may present challenges and is susceptible to error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if we apply it on the trillian mysql db, won't this break upgrade scenario and backward compatibility ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about providing a default URL that will read content from the secret. The secret needs to be mounted as Auth (https://github.com/securesign/secure-sign-operator/blob/main/internal/controller/rekor/actions/server/deployment.go#L82). Do you think it is doable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this would break the upgrade scenario anyway, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.