Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

fix: ensure we wait for the right CRI service name #4115

Merged
merged 4 commits into from
Dec 15, 2020

Conversation

jackfrancis
Copy link
Member

Reason for Change:

This PR ensures we are waiting for the correctly named CRI service name in various systemd definitions.

Issue Fixed:

Credit Where Due:

Does this change contain code from or inspired by another project?

  • No
  • Yes

If "Yes," did you notify that project's maintainers and provide attribution?

  • No
  • Yes

Requirements:

Notes:

@jackfrancis
Copy link
Member Author

cc @Michael-Sinz

@codecov
Copy link

codecov bot commented Dec 11, 2020

Codecov Report

Merging #4115 (a2afae1) into master (4ebb4a3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4115   +/-   ##
=======================================
  Coverage   73.23%   73.23%           
=======================================
  Files         135      135           
  Lines       20625    20625           
=======================================
  Hits        15104    15104           
  Misses       4547     4547           
  Partials      974      974           
Impacted Files Coverage Δ
pkg/engine/templates_generated.go 43.70% <ø> (ø)
pkg/api/common/versions.go 96.37% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ebb4a3...a2afae1. Read the comment docs.

@@ -1,6 +1,10 @@
[Unit]
Description=a script that checks docker health and restarts if needed
{{- if NeedsContainerd}}
After=containerd.service
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be the same as writing:

After={{GetContainerRuntime}}.service

Or is there some additional disconnect between the two? Right now I see those as the same.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. The likelihood of the containerRuntime allowed values changing (from "docker" and "containerd" to something else to indicate the same configuration) is 0%. The likelihood that the apt package would rename the current service names to something else is perhaps a mite larger, but also unlikely, so your more elegant suggestion will work.

In the event the coupling between the CRI name and the service name goes away in the future, we can refactor to the more verbose if/else expression.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worst case we could have GetContainerRuntimeService in addition to GetContainerRuntime

/lgtm

@@ -90,24 +90,13 @@ write_files:
Slice={{- GetKubeReservedCgroup -}}.slice
#EOF

{{if NeedsContainerd}}
- path: /etc/systemd/system/containerd.service.d/kubereserved-slice.conf
- path: /etc/systemd/system/{{GetContainerRuntime}}.service.d/kubereserved-slice.conf
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplifying this CRI filepath declaration while I'm here...

@Michael-Sinz
Copy link
Collaborator

/lgtm

@acs-bot
Copy link

acs-bot commented Dec 11, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, Michael-Sinz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jackfrancis jackfrancis merged commit f5e4f97 into Azure:master Dec 15, 2020
@jackfrancis jackfrancis deleted the containerd.service branch December 15, 2020 00:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants