Skip to content

Commit

Permalink
Simplify Flatcar containerd exec command
Browse files Browse the repository at this point in the history
The containerd command used in
kubernetes#12177 is a modification from
the torcx containerd unit. However, how torcx starts containerd is a
implementation detail and it's better to not hardcode torcx in case it
isn't used anymore.
Change the ExecStard command to use /usr/bin/containerd directly,
making it simpler and more future-proof.
  • Loading branch information
pothos authored and ederst committed Apr 5, 2022
1 parent 597883b commit d750245
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions nodeup/pkg/model/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,8 @@ func (b *ContainerdBuilder) buildSystemdServiceOverrideFlatcar(c *fi.ModelBuilde
lines := []string{
"[Service]",
"EnvironmentFile=/etc/environment",
"Environment=CONTAINERD_CONFIG=" + b.containerdConfigFilePath(),
"ExecStart=",
"ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/containerd --config ${CONTAINERD_CONFIG}",
"ExecStart=/usr/bin/containerd --config " + b.containerdConfigFilePath(),
}
contents := strings.Join(lines, "\n")

Expand Down
3 changes: 1 addition & 2 deletions nodeup/pkg/model/tests/containerdbuilder/flatcar/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ afterFiles:
contents: |-
[Service]
EnvironmentFile=/etc/environment
Environment=CONTAINERD_CONFIG=/etc/containerd/config-kops.toml
ExecStart=
ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/containerd --config ${CONTAINERD_CONFIG}
ExecStart=/usr/bin/containerd --config /etc/containerd/config-kops.toml
onChangeExecute:
- - systemctl
- daemon-reload
Expand Down

0 comments on commit d750245

Please sign in to comment.