-
Notifications
You must be signed in to change notification settings - Fork 34
K8SPS-623: fix GCS backups #1194
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR fixes GCS backups by correcting the secret key names used to retrieve GCS credentials. Previously, GCS backups were using AWS-specific key names (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) when they should have been using GCS-specific key names (ACCESS_KEY_ID and SECRET_ACCESS_KEY).
Changes:
- Fixed GCS backup secret key references to use correct GCS-specific constants
- Updated S3 backup secret key references to use constants from the secret package instead of hardcoded strings
- Renamed local variable from
secrettosto avoid shadowing the imported secret package
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
commit: 956872e |
| } | ||
| accessKeyID := string(secret.Data["AWS_ACCESS_KEY_ID"]) | ||
| secretAccessKey := string(secret.Data["AWS_SECRET_ACCESS_KEY"]) | ||
| accessKeyID := string(s.Data[secret.CredentialsGCSAccessKey]) |
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.
Why don't we ensure that the data actually contain the expected key?
e.g.
accessKeyBytes, ok := s.Data[secret.CredentialsGCSAccessKey]
Due to the high volume of requests, we're unable to provide free service for this account. To continue using the service, please upgarde to a paid plan.
https://perconadev.atlassian.net/browse/K8SPS-623
DESCRIPTION
Problem:
It is currently possible to create a GCS backup only when
ACCESS_KEY_ID,SECRET_ACCESS_KEY,AWS_ACCESS_KEY_ID, andAWS_SECRET_ACCESS_KEYare provided, even though only GCS credentials should be required.Cause:
The validation function incorrectly checks for AWS-prefixed keys in the secret when validating GCS storage, while the backup job uses non-AWS-prefixed keys.
Solution:
Update the storage validation logic to use GCS-specific secret keys instead of AWS-prefixed keys.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability