Skip to content

Commit

Permalink
podvm: revert agent-config path to /etc
Browse files Browse the repository at this point in the history
The ./podvm kata-agent unit has been set to use a config file in /etc. Having the kata-agent
config file in /run will break the CAA libvirt tests, since we have dependencies that rely
on the config being in /etc. ./podvm-mkosi will override this path to a configuration in
/run.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
  • Loading branch information
mkulke committed Dec 20, 2023
1 parent 6b0df8e commit c70971e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/process-user-data/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const (
providerAzure = "azure"
providerAws = "aws"

defaultAgentConfigPath = "/run/peerpod/agent-config.toml"
defaultAgentConfigPath = "/etc/agent-config.toml"
defaultAuthJsonFilePath = "/run/peerpod/auth.json"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# On a read-only fs the kata-agent config is created in /run/peerpod, since it contains
# a parameter that can be set at pod creation time.
[Unit]
ConditionKernelCommandLine=

[Service]
ExecStart=
ExecStart=/usr/local/bin/kata-agent --config /run/peerpod/agent-config.toml
ExecStop=
ExecStopPost=/usr/local/bin/kata-agent-clean --config /run/peerpod/agent-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# On a read-only fs the kata-agent config is created in /run/peerpod, since it contains
# a parameter that can be set at pod creation time.
[Service]
ExecStart=
ExecStart=/usr/local/bin/process-user-data update-agent-config --agent-config-file /run/peerpod/agent-config.toml
4 changes: 2 additions & 2 deletions podvm/files/etc/systemd/system/kata-agent.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ After=netns@podns.service process-user-data.service

[Service]
ExecStartPre=mkdir -p /run/kata-containers
ExecStart=/usr/local/bin/kata-agent --config /run/peerpod/agent-config.toml
ExecStart=/usr/local/bin/kata-agent --config /etc/agent-config.toml
ExecStartPre=-umount /sys/fs/cgroup/misc
ExecStopPost=/usr/local/bin/kata-agent-clean --config /run/peerpod/agent-config.toml
ExecStopPost=/usr/local/bin/kata-agent-clean --config /etc/agent-config.toml
# Now specified in the agent-config.toml Environment="KATA_AGENT_SERVER_ADDR=unix:///run/kata-containers/agent.sock"
SyslogIdentifier=kata-agent

Expand Down

0 comments on commit c70971e

Please sign in to comment.