Skip to content

Conversation

smoser
Copy link
Contributor

@smoser smoser commented Aug 22, 2023

  • refactor: Bind stacker binary into container in SetupBuildContainerConfig

    Previously there were 3 individual calls to bind stacker into
    tools/static-stacker. This just changes that to 1 place, so
    after calling SetupBuildContainerConfig you can use stacker inside.

  • test: Change bom test to contain spaces

    The bom test case previously had Author of 'bom-test',
    which was not realiastic and was intentional to avoid
    exposing the bug with spaces.

  • fix: Use arrays for execution rather than scalar string.

    This changes the interface for container.Execute to be an
    array of strings rather than a string, and then changes
    the internal lxc-wrapper pass arguments provided to it
    through to the lxc 'start' api call.

    It ultimately allows us to safely call programs with spaces,
    quotes or other "odd" characters without first serializing
    them in go and relying on lxc start api call to unserialize
    them properly. lxc.start would ultimately end up just
    split the lxc.execute.cmd on spaces.

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@smoser smoser requested review from rchincha and hallyn as code owners August 22, 2023 17:57
@smoser smoser force-pushed the fix/execute-as-array branch from f1be243 to 8d34073 Compare August 22, 2023 18:04
@smoser smoser force-pushed the fix/execute-as-array branch from 8d34073 to ff4944c Compare August 22, 2023 19:23
This changes the interface for container.Execute to be an
array of strings rather than a string, and then changes
the internal lxc-wrapper pass arguments provided to it
through to the lxc 'start' api call.

It ultimately allows us to safely call programs with spaces,
quotes or other "odd" characters without first serializing
them in go and relying on lxc start api call to unserialize
them properly.  lxc.start would ultimately end up just
split the lxc.execute.cmd on spaces.

Signed-off-by: Scott Moser <smoser@brickies.net>
smoser added 2 commits August 22, 2023 15:54
The bom test case previously had Author of 'bom-test',
which was not realiastic and was intentional to avoid
exposing the bug with spaces.

Signed-off-by: Scott Moser <smoser@brickies.net>
…nfig

Previously there were 3 individual calls to bind stacker into
tools/static-stacker.  This just changes that to 1 place, so
after calling SetupBuildContainerConfig you can use stacker inside.

Signed-off-by: Scott Moser <smoser@brickies.net>
@smoser smoser force-pushed the fix/execute-as-array branch from ff4944c to d349254 Compare August 22, 2023 19:55
@smoser smoser merged commit fae3417 into project-stacker:main Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants