Skip to content

config: report extension pins everywhere - #203

Merged
Zariel merged 1 commit into
mainfrom
agent/system-extension-warning-paths
Aug 5, 2026
Merged

config: report extension pins everywhere#203
Zariel merged 1 commit into
mainfrom
agent/system-extension-warning-paths

Conversation

@Zariel

@Zariel Zariel commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • emit mutable system-extension warnings from the shared source-config loader
  • thread diagnostics through wipe, render, apply, bootstrap, context, and etcd commands
  • report warnings from direct config resolve and diff builds

Why

Follow-up to #202: its review found that several source-compilation paths discarded the new digest-pinning guidance. This makes the warning contract consistent across supported commands.

Emit source compilation warnings inside the shared ClusterConfig loader
and thread command diagnostics through wipe, render, apply, bootstrap,
context, and etcd paths. Report direct resolve and diff builds as well
so every supported source-compilation path exposes the resolved
immutable replacement.
@Zariel
Zariel enabled auto-merge (squash) August 5, 2026 21:48
@Zariel
Zariel merged commit a6480e3 into main Aug 5, 2026
6 checks passed
@Zariel
Zariel deleted the agent/system-extension-warning-paths branch August 5, 2026 21:50
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR centralizes source-config compilation warning emission and threads diagnostic writers through config inspection, install, context, etcd, wipe, render, apply, and bootstrap paths.

  • Moves warning emission into loadKatlConfig instead of returning warnings for each caller to print.
  • Adds warning output to direct config resolution and both sides of config diff.
  • Propagates diagnostic writers through inventory-loading command paths.
  • Leaves the cluster-apply activation load connected to a nil writer, suppressing its warning output.

Confidence Score: 4/5

The cluster-apply warning regression should be fixed before merging so mutable system-extension references continue to produce digest-pinning guidance.

The shared loader emits warnings correctly when given a writer, but activateClusterConfig passes nil even though runClusterApply provides stderr through opts.progress, causing an established production command to silently discard warnings that were previously displayed.

Files Needing Attention: cmd/katlctl/kubeadm_control_plane_config.go

Important Files Changed

Filename Overview
cmd/katlctl/config_input.go Centralizes compilation-warning emission in loadKatlConfig and safely skips output when no diagnostics writer is supplied.
cmd/katlctl/config_inspect.go Threads stderr into resolve and diff source builds so mutable-extension warnings are reported.
cmd/katlctl/kubeadm_control_plane_config.go Propagates diagnostics through inventory loading but suppresses warnings during the production cluster-apply activation load.
cmd/katlctl/main.go Threads stderr through wipe, render, bootstrap, and inventory-loading paths without introducing a distinct failure.
cmd/katlctl/etcd.go Adds warning propagation to etcd member inspection and removal config loading.
cmd/katlctl/install.go Relies on centralized warning emission while preserving install-apply diagnostics.
cmd/katlctl/enroll.go Relies on centralized warning emission while preserving context-save diagnostics.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[katlctl cluster apply] --> B[runClusterApply]
  B -->|opts.progress = stderr| C[activateClusterConfig]
  C -->|nil writer| D[loadKatlConfig]
  D --> E[BuildArchive warnings]
  E --> F[writeCompilationWarnings]
  F -->|nil is a no-op| G[Warning suppressed]
Loading

Fix All in Codex

Prompt To Fix All With AI
### Issue 1
cmd/katlctl/kubeadm_control_plane_config.go:407
**Cluster apply suppresses pin warnings**

When `katlctl cluster apply` compiles a source config containing a mutable system-extension reference, passing `nil` here makes `writeCompilationWarnings` discard the warning instead of writing it to `opts.progress`, causing the command to omit the digest-pinning guidance that it previously displayed.

```suggestion
	loaded, err := loadKatlConfig(opts.configPath, configBundleCreator, configbundle.PlanningInputs{}, opts.progress)
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "config: report extension pins everywhere" | Re-trigger Greptile


func activateClusterConfig(ctx context.Context, opts kubeadmControlPlaneConfigOptions, nodes []inventory.Node) (activatedClusterConfig, error) {
loaded, err := loadKatlConfig(opts.configPath, configBundleCreator, configbundle.PlanningInputs{})
loaded, err := loadKatlConfig(opts.configPath, configBundleCreator, configbundle.PlanningInputs{}, nil)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Cluster apply suppresses pin warnings

When katlctl cluster apply compiles a source config containing a mutable system-extension reference, passing nil here makes writeCompilationWarnings discard the warning instead of writing it to opts.progress, causing the command to omit the digest-pinning guidance that it previously displayed.

Suggested change
loaded, err := loadKatlConfig(opts.configPath, configBundleCreator, configbundle.PlanningInputs{}, nil)
loaded, err := loadKatlConfig(opts.configPath, configBundleCreator, configbundle.PlanningInputs{}, opts.progress)

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: cmd/katlctl/kubeadm_control_plane_config.go
Line: 407

Comment:
**Cluster apply suppresses pin warnings**

When `katlctl cluster apply` compiles a source config containing a mutable system-extension reference, passing `nil` here makes `writeCompilationWarnings` discard the warning instead of writing it to `opts.progress`, causing the command to omit the digest-pinning guidance that it previously displayed.

```suggestion
	loaded, err := loadKatlConfig(opts.configPath, configBundleCreator, configbundle.PlanningInputs{}, opts.progress)
```

**Context Used:** AGENTS.md ([source](https://github.com/katl-dev/katl/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant