Skip to content

Kubernetes/KubernetesNodes: model the new logSerialConsole field (upstream cozystack#3637) #26

Open

Description

Context

cozystack/cozystack PR #3637 adds a new optional field to the worker node group of both Kubernetes apps:

App Field Type Default
Kubernetes nodeGroups[name].logSerialConsole bool false
KubernetesNodes logSerialConsole bool false

When true it asks KubeVirt to stream the worker VM's guest serial console into a guest-console-log container beside virt-launcher, readable with kubectl logs. It exists because a worker that stalls during boot before Talos apid answers registers no Node and requests no certificate, so the console is the only surface that shows what it was doing.

Why this repository is affected

Per the upstream trigger map (docs/agents/contributing.md, "Downstream Repositories"), this provider is hand-written: every Kind carries a hand-maintained Terraform schema with its own expand/flatten pair, with no codegen from values.schema.json. The entry that applies is "Add, remove or rename a field in an app's values.schema.json → the schema, the model, and the expand/flatten pair."

The Kubernetes side is the actionable half: internal/provider/kubernetes_schema.go and kubernetes_model.go already model nodeGroups attribute by attribute, so a node group written through Terraform silently loses the field until it is added there. The KubernetesNodes side is covered by #24, which still has to add the resource at all.

What is needed

  • A log_serial_console bool attribute on the node group object in kubernetes_schema.go, Optional + Computed with booldefault.StaticBool(false) to match the upstream default.
  • The matching model field and both directions of the expand/flatten pair in kubernetes_model.go.
  • Coverage in kubernetes_model_test.go alongside the existing node-group fields.

One caveat worth carrying over

Enabling the field rolls the node group: it is part of the worker VM template, whose name is a content hash, so every VM in the group is replaced. That is worth surfacing in the attribute description rather than leaving users to discover it from a plan diff.

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