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

Providing an option to mention tempDirectory instead of relying on tmp directory provided by os.TempDir #287

Open
pckvcode opened this issue Aug 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@pckvcode
Copy link

What would you like to be added:
Providing an option to mention tempDirectory instead of relying on tmp directory provided by os.TempDir when GetImage

func GetImage(ctx context.Context, imgStr string, options ...Option) (*image.Image, error) {

Why is this needed:
We had a requirement where a customer wants to mention tempDirectory to be used by stereoscope while getting a docker image.

Additional context:

I examined the Stereoscope code to see if we could set a custom tempDir, but currently, that option isn’t available.

Here we are using global variable rootTempDirGenerator and not exposed to change.

var rootTempDirGenerator = file.NewTempDirGenerator("stereoscope")

Can we provide an option to update rootLocation in TempDirGenerator

rootLocation string

@pckvcode pckvcode added the enhancement New feature or request label Aug 29, 2024
@willmurphyscode
Copy link
Contributor

Hi @pckvcode thanks for the request! This is an enhancement we'd be happy to see.

In the meantime os.TempDir respects the usual environment variables for choosing the temp directory, e.g. TMPDIR on mac and Linux, so this might help your use case.

@willmurphyscode willmurphyscode moved this to Ready in OSS Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

2 participants