Skip to content

cni-install: cniconfig.go logs via an unbound ctrl.Log — 'Wrote CNI config' and #689's durable-entry write/error lines never reach stdout #696

Closed

Description

@bpalermo

Summary

cni/internal/install/cniconfig.go logs through installLog = ctrl.Log.WithName("installer") — controller-runtime's global logger — but nothing in cni/ ever calls ctrl.SetLogger(...). controller-runtime discards writes to an unbound global logger (after a one-time "log.SetLogger(...) was never called" notice). So every installLog.Info/Error in that file is dropped in production.

Observed on talos-main (rev194, 2026-09-05): the cni-install init container log on all five agent pods, plus a freshly created sixth, contains exactly three lines ending at CNI binaries installed. Neither #689's new Wrote the durable aether CNI entry nor the pre-existing Wrote CNI config line ever appears. Only in.logger (the slog-bridged logger in install.go) reaches stdout.

Why it matters

Fix

Either bind ctrl.SetLogger to the slog bridge at cni-install startup (the agent does this in common/telemetry/common/log — reuse), or drop ctrl.Log in cniconfig.go and pass in.logger (the *slog.Logger the rest of the installer uses) down. The second is simpler and removes a controller-runtime dependency from a package that has no other reason to import it. Add a test that captures the installer's logger output and asserts the Wrote CNI config / Wrote the durable aether CNI entry lines are emitted.

Found during the rev194 validation of #689. Related: #680, #689, #645, #650.

Activity

  1. bpalermo commented on Sep 5, 2026

    @bpalermo
    OwnerAuthor

    Validated on talos-main after the #710 merge (helm rev199, chart 0.92.5, appVersion 3093d6b, 21:01–21:06Z 2026-09-05): every one of the five cni-install init-container logs now carries Wrote CNI config and Wrote the durable aether CNI entry (1 each, 0 ERROR) — the lines that had been silently dropped since #689. Roll was hitless: prober liveness 0 errors / 6,590, restarts 0 fleet-wide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions