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

consider better API for container filesystem setup #59

Closed
PietroPasotti opened this issue Sep 11, 2023 · 1 comment
Closed

consider better API for container filesystem setup #59

PietroPasotti opened this issue Sep 11, 2023 · 1 comment
Labels
big brain issue that requires some (complex) spec/design work enhancement New feature or request good first issue Good for newcomers

Comments

@PietroPasotti
Copy link
Collaborator

Right now, if you want to 'prepare' a container filesystem to e.g. simulate a config file being present before scenario runs, you have to mess with Mounts and create a temporary directory yourself:

    td = tempfile.TemporaryDirectory()
    conf_file = Path(td.name).joinpath(f"filename.yaml")
    conf_file.write_text("foobar")

    traefik_container = traefik_container.replace(mounts={
        "conf": Mount("/opt/traefik/", td.name)
    })

Wouldn't it be nice if you could simply grab the filesystem from the context and manipulate it directly like:

    file = traefik_container.get_filesystem(traefik_ctx).joinpath('filename.yaml')
    file.parent.mkdir(exist_ok=True)
    file.write_text('foobar')
    
    # continue with test

Issue with this is that when ops (scenario) sets up the container it expects a clean slate and will raise if any of the paths exist already or can't be deleted because they contain files.

@PietroPasotti PietroPasotti added enhancement New feature or request good first issue Good for newcomers big brain issue that requires some (complex) spec/design work labels Nov 9, 2023
@tonyandrewmeyer
Copy link
Collaborator

Moved to canonical/operator#1430

@tonyandrewmeyer tonyandrewmeyer closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
big brain issue that requires some (complex) spec/design work enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants