Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
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