-
Notifications
You must be signed in to change notification settings - Fork 333
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
PT-2281 - provide container name for copying files in the dump #717
PT-2281 - provide container name for copying files in the dump #717
Conversation
- Changed getIndividualFiles function and Dumper data structure, so we can specify container name for PXC and other operators which store logs in the separate container.
Your Render PR Server URL is https://percona-toolkit-pr-717.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-clbtill4lnec73ecqjj0. |
@@ -372,7 +374,7 @@ type crSecrets struct { | |||
|
|||
// TODO: check if resource parameter is really needed | |||
func (d *Dumper) getIndividualFiles(resource, namespace string, podName, path, location string, tw *tar.Writer) error { | |||
args := []string{"-n", namespace, "cp", podName + ":" + path, "/dev/stdout"} | |||
args := []string{"-n", namespace, "-c", d.fileContainer, "cp", podName + ":" + path, "/dev/stdout"} |
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.
As discussed, d.fileContainer
is used for pxc only which means if this function is called in future for PSMDB/PG, this is effectively calling kubectl -c cp
which means an empty container name and the command will error out. It would be good to consider this case and fix it, so that getIndividualFiles can work independent of any constraints
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.
@cshiv, how do you suggest to handle it? Return error or use default container?
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.
@svetasmirnova Using the container name is an assured way and I believe we should continue using container name for getting the file. I would prefer returning an 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.
Implemented, please review.
- Implemented error handling when container name is not specified - Added test case for error handling
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.
LGTM
Changed getIndividualFiles function and Dumper data structure, so we can specify container name for PXC and other operators which store logs in the separate container.
The contributed code is licensed under GPL v2.0
Contributor Licence Agreement (CLA) is signed
util/update-modules has been ran
Documentation updated
Test suite update