Skip to content

Commit

Permalink
refactor: parameterise reexec command and subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
nixpig committed Dec 23, 2024
1 parent ff8f8e0 commit 63ad257
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ This is a personal project for me to explore and better understand the OCI Runti

> [!CAUTION]
>
> Some features may require `sudo` and make changes to your system. This is an experimental project. Take appropriate precautions.
> Some features may require `sudo` and make changes to your system.
>
> Given this is an experimental project, take appropriate precautions.
I'm developing `brownie` on the following environment. Even with the same set up, YMMV.
You can spin up this VM from the included `Vagrantfile`, just run `vagrant up`.
Expand Down
3 changes: 1 addition & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Vagrant.configure("2") do |config|
Vagrant.configure("1") do |config|
config.vm.box = "bento/ubuntu-24.04"
config.vm.synced_folder '.', '/brownie'

config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "4096"
vb.cpus = "2"
end
Expand Down
2 changes: 2 additions & 0 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func createCmd() *cobra.Command {
Bundle: bundle,
ConsoleSocket: consoleSocket,
PIDFile: pidFile,
ReexecCmd: "/proc/self/exe",
ReexecSubcmd: "reexec",
})
},
}
Expand Down
4 changes: 3 additions & 1 deletion internal/commands/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type CreateOpts struct {
Bundle string
ConsoleSocket string
PIDFile string
ReexecCmd string
ReexecSubcmd string
}

func Create(opts *CreateOpts) error {
Expand Down Expand Up @@ -42,5 +44,5 @@ func Create(opts *CreateOpts) error {
return fmt.Errorf("create container: %w", err)
}

return cntr.Init("/proc/self/exe", "reexec")
return cntr.Init(opts.ReexecCmd, opts.ReexecSubcmd)
}

0 comments on commit 63ad257

Please sign in to comment.