siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.

Home Page:https://www.talos.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove dynamic /etc/os-release creation

smira opened this issue · comments

Code:

// OSRelease renders a valid /etc/os-release file and writes it to disk. The
// node's OS Image field is reported by the node from /etc/os-release.
func OSRelease() (err error) {
if err = createBindMount(filepath.Join(constants.SystemEtcPath, "os-release"), "/etc/os-release"); err != nil {
return err
}
contents, err := version.OSRelease()
if err != nil {
return err
}
return os.WriteFile(filepath.Join(constants.SystemEtcPath, "os-release"), contents, 0o644)
}

Instead of writing it down dynamic way with a bind mount, go generate the file contents, and make it part of rootfs and read-only.

Remove the task.