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

Set BigFilesTemporaryDir to GetEnv(TMPDIR) if set or /var/tmp #628

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jun 16, 2021

Currently if the caller does not specify the BigFilesTemporaryDir,
Podman and Buildah users expect this to default TMPDIR environment
variable or /var/tmp if not set.

Moving to libimage caused a regression in this functionality.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1972282

Signed-off-by: Daniel J Walsh [email protected]

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member Author

rhatdan commented Jun 16, 2021

@mheon @vrothberg This is a fairly big regression in podman 3.2 and will need to be backported.

@rhatdan rhatdan changed the title Handle BigFilesTemproaryDir correctly Handle BigFilesTemporaryDir correctly Jun 16, 2021
@rhatdan rhatdan requested a review from vrothberg June 16, 2021 12:55
@mheon
Copy link
Member

mheon commented Jun 16, 2021

LGTM. Another candidate for 3.2.2, then.

@rhatdan
Copy link
Member Author

rhatdan commented Jun 16, 2021

Yes, I want to wait until @vrothberg approves.

Comment on lines 81 to 89
var systemContext types.SystemContext
if options.SystemContext != nil {
systemContext = *options.SystemContext
if systemContext.BigFilesTemporaryDir == "" {
systemContext.BigFilesTemporaryDir = tmpdir()
}
} else {
systemContext = types.SystemContext{}
systemContext = types.SystemContext{
BigFilesTemporaryDir: tmpdir(),
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

	systemContext := types.SystemContext{}
	if options.SystemContext != nil {
		systemContext = *options.SystemContext
	}
	if systemContext.BigFilesTemporaryDir == "" {
		systemContext.BigFilesTemporaryDir = tmpdir()
	}

might be a bit easier to follow and less repetitive.

(Personally I’d prefer a more explicit than “handle correctly” — to make it clear what was broken before and how it is fixed now. Are the two changes fixing two different bugs? But that’s depending on standards of this repo.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. and Updated commit message.

Currently if the caller does not specify the BigFilesTemporaryDir,
Podman and Buildah users expect this to default TMPDIR environment
variable or /var/tmp if not set.

Moving to libimage caused a regression in this functionality.

Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan rhatdan changed the title Handle BigFilesTemporaryDir correctly Handle BigFilesTemporaryDir correctlyHandle BigFilesTemporaryDir correctly Jun 16, 2021
@rhatdan rhatdan changed the title Handle BigFilesTemporaryDir correctlyHandle BigFilesTemporaryDir correctly Set BigFilesTemporaryDir to GetEnv(TMPDIR) if set or /var/tmp Jun 16, 2021
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

@vrothberg
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 17, 2021
@openshift-merge-robot openshift-merge-robot merged commit 5fe0c5d into containers:main Jun 17, 2021
@vrothberg
Copy link
Member

@rhatdan, can you backport to 0.38? I am under time pressure today to create a presentation for Moday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants