-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add an option to copy FoundationDB cluster files to a writable temporary file #19684
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: master
Are you sure you want to change the base?
Add an option to copy FoundationDB cluster files to a writable temporary file #19684
Conversation
cluster_file = self.instance.get('cluster_file') | ||
|
||
if self.instance.get('copy_cluster_file'): | ||
_, cluster_file = tempfile.mkstemp(suffix=".cluster") |
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.
Is there a "right place" to clean up this temporary file (or other long-lived resources)? I notice that this check doesn't have a mechanism for closing the FoundationDB client, so perhaps just leaving the temporary file is the right thing to do.
@pytest.fixture | ||
def copy_cluster_file_instance(): | ||
return COPY_CLUSTER_FILE_INSTANCE |
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 am very new to Python unit tests and recognize that this may not be the right way to do things. I'm very open to feedback!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
5509e1f
to
91a010b
Compare
Hello from the docs team 👋 |
91a010b
to
de59b5b
Compare
What does this PR do?
This pull request adds an option to FoundationDB integration instances to allow the check to make a writable copy of the cluster file before passing it to the FoundationDB client. This closes #19677.
Motivation
Please see #19677 for a detailed description of the problem, but in short, FoundationDB clients want a writable copy of the cluster file. It can be hard to provide a writable copy when running in a Kubernetes environment (the most common way to get the cluster file in that case is by mounting a
ConfigMap
as a file, but that will always be read-only), and so this option provides a mechanism to satisfy the FoundationDB client without jumping through Terrible Ops Hoops™.Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged