config: report extension pins everywhere - #203
Conversation
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.
Greptile SummaryThis PR centralizes source-config compilation warning emission and threads diagnostic writers through config inspection, install, context, etcd, wipe, render, apply, and bootstrap paths.
Confidence Score: 4/5The 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 Files Needing Attention: cmd/katlctl/kubeadm_control_plane_config.go
|
| 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]
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) |
There was a problem hiding this 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.
| 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.
Summary
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.