Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor kubelet config generation #5246

Merged
merged 2 commits into from
Nov 14, 2024

Commits on Nov 13, 2024

  1. Refactor kubelet config file writing

    Rename prepareLocalKubeletConfig to writeKubeletConfig and have this
    method not only generate the configuration data, but also write it to
    the designated file. Makes the Start method a bit shorter, and keeps
    related code snippets closer together. In this particular case, this
    eliminates an unnecessary string conversion back and forth.
    
    Signed-off-by: Tom Wieczorek <[email protected]>
    twz123 committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    ed7a962 View commit details
    Browse the repository at this point in the history
  2. Move all kubelet config logic into the write method

    This allows for dissolving the config struct and make the assignments
    directly to the generated kubelet configuration struct. Removes
    unnecessary indirection and concentrates more of the decision making
    into the appropriate method.
    
    Defer OS-specific decisions about the path to resolv.conf to the
    specific function, so that its return values are meaningful even if it's
    not called on Linux.
    
    Set the cgroups settings and do systemd detection only on Linux, as
    these are Linux-specific and don't exist on other operating systems.
    
    Signed-off-by: Tom Wieczorek <[email protected]>
    twz123 committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    3ffd266 View commit details
    Browse the repository at this point in the history