summaryrefslogtreecommitdiff
path: root/pkg/machine/ignition.go
diff options
context:
space:
mode:
authorAshley Cui <acui@redhat.com>2021-04-23 16:09:22 -0400
committerAshley Cui <acui@redhat.com>2021-04-23 16:30:54 -0400
commitbd76701e893e8e1797c11eac2531f300048e0cca (patch)
tree9d0ef41a3c3e3d49efc55a32791cfb66bba7e9e8 /pkg/machine/ignition.go
parentba60821f0aadef99f200fa708b26fb9921ed7b70 (diff)
downloadpodman-bd76701e893e8e1797c11eac2531f300048e0cca.tar.gz
podman-bd76701e893e8e1797c11eac2531f300048e0cca.tar.bz2
podman-bd76701e893e8e1797c11eac2531f300048e0cca.zip
Add machine-enabled to containers.conf for machine
Add machine-enabled=true into /etc/containers/containers.conf when initing a VM. This field should tell Podman it's being run in a podman-machine and it will be used in future to tell podman to set up other necessary machine stuff such as networking [NO TESTS NEEDED] Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'pkg/machine/ignition.go')
-rw-r--r--pkg/machine/ignition.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/machine/ignition.go b/pkg/machine/ignition.go
index cc5c01de6..00068a136 100644
--- a/pkg/machine/ignition.go
+++ b/pkg/machine/ignition.go
@@ -168,6 +168,22 @@ func getFiles(usrName string) []File {
},
FileEmbedded1: FileEmbedded1{Mode: intToPtr(420)},
})
+
+ // Set machine_enabled to true to indicate we're in a VM
+ files = append(files, File{
+ Node: Node{
+ Group: getNodeGrp("root"),
+ Path: "/etc/containers/containers.conf",
+ User: getNodeUsr("root"),
+ },
+ FileEmbedded1: FileEmbedded1{
+ Append: nil,
+ Contents: Resource{
+ Source: strToPtr("data:,%5Bengine%5D%0Amachine_enabled%3Dtrue%0A"),
+ },
+ Mode: intToPtr(420),
+ },
+ })
return files
}