Skip to content

chore(kubernetes): use kubectl-neat v1.0.5 pkg/neat - #196

Merged
moshloop merged 1 commit into
mainfrom
feat/kubectl-neat-pkg
Dec 2, 2026
Merged

moshloop merged 1 commit into
mainfrom
feat/kubectl-neat-pkg

Conversation

@adityathebe

@adityathebe adityathebe commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Switches k8s.neat to kubectl-neat v1.0.5's new pkg/neat, which drops client-go and cobra. A binary importing gomplate/v4/kubernetes goes from 65.4 MB to 50.2 MB. Replaces #194, which vendored the same code into gomplate.

Opus 5.5 Medium

kubectl-neat #10 moved NeatYAMLOrJSON out of the cobra cmd package into pkg/neat, and made pkg/defaults decode with its own core/v1 scheme instead of client-go's scheme.Codecs. Output is byte-identical to v1.0.4 on kubectl-neat's fixtures plus extra manifests (45/45).

  • kubernetes/format.go imports pkg/neat instead of cmd.
  • go.mod: kubectl-neat v1.0.4 → v1.0.5; k8s.io/client-go, cobra, pflag and mousetrap are gone.
  • k8s.io/api linked packages: 53 → 5 (the rest come from is-healthy).

Verification: all test packages pass except web/ and cmd/ceval, which need the playground dist build, same as on main. golangci-lint on ./kubernetes/... is clean.

Summary by CodeRabbit

  • Chores
    • Updated components used for Kubernetes resource formatting. The formatting behavior and results remain unchanged, so there are no user-visible changes in this release.

kubectl-neat/cmd linked cobra through its init(), and v1.0.4's defaults step used client-go's scheme, which registers every Kubernetes API group. v1.0.5 adds pkg/neat without the CLI and decodes with its own core/v1 scheme.

A binary importing gomplate/v4/kubernetes drops from 65.4 MB to 50.2 MB, k8s.io/api from 53 to 5 linked packages, and client-go, cobra, pflag and mousetrap leave go.mod.
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Benchstat

Base: cf91117c6bd0a38a4ab20153762e8c2816f8b285
Head: 5a682f23d5dd7aa2c88f15d95c854068effd0f6c

No significant performance changes detected

Full benchstat output
goos: linux
goarch: amd64
cpu: AMD EPYC 9V74 80-Core Processor                
                                                                         │ bench-base.txt │           bench-head.txt           │
                                                                         │     sec/op     │   sec/op     vs base               │
CELEnvExtendCustomFunction-4                                                  82.79µ ± 3%   82.33µ ± 2%       ~ (p=0.684 n=10)
CELProgramEvaluation/expression=scalar/optimized=false-4                      182.3n ± 1%   182.7n ± 2%       ~ (p=0.897 n=10)
CELProgramEvaluation/expression=scalar/optimized=true-4                       182.8n ± 4%   181.7n ± 2%       ~ (p=0.424 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4         4.919µ ± 3%   4.901µ ± 6%       ~ (p=0.725 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4          1.781µ ± 3%   1.775µ ± 2%       ~ (p=0.853 n=10)
CELProgramEvaluation/expression=comprehension/optimized=false-4               6.227µ ± 3%   6.170µ ± 2%       ~ (p=0.271 n=10)
CELProgramEvaluation/expression=comprehension/optimized=true-4                5.973µ ± 3%   5.966µ ± 6%       ~ (p=0.912 n=10)
RunExpressionNativeInput/input=map-4                                          3.079µ ± 3%   3.082µ ± 7%       ~ (p=0.542 n=10)
RunExpressionNativeInput/input=native_struct-4                                3.184µ ± 2%   3.177µ ± 2%       ~ (p=0.926 n=10)
RunExpressionContext/cache=hit/environment=small-4                            1.796µ ± 3%   1.773µ ± 2%       ~ (p=0.184 n=10)
RunExpressionContext/cache=hit/environment=large-4                            1.939µ ± 3%   1.910µ ± 1%       ~ (p=0.072 n=10)
RunExpressionContextCompile/cache=miss/environment=small-4                    339.1µ ± 5%   341.6µ ± 3%       ~ (p=0.218 n=10)
RunExpressionContextCompile/cache=miss/environment=large-4                    337.5µ ± 4%   338.0µ ± 2%       ~ (p=0.853 n=10)
CELEnvExtend/variables=1/functions=0-4                                        6.488µ ± 4%   6.550µ ± 4%       ~ (p=0.353 n=10)
CELEnvExtend/variables=10/functions=0-4                                       8.354µ ± 5%   8.541µ ± 4%       ~ (p=0.165 n=10)
CELEnvExtend/variables=100/functions=0-4                                      24.62µ ± 6%   24.99µ ± 4%       ~ (p=0.631 n=10)
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4      4.333µ ± 5%   4.272µ ± 3%       ~ (p=0.617 n=10)
RunExpressionContextFunctions/functions/cache=hit/environment=large-4         4.285µ ± 3%   4.316µ ± 2%       ~ (p=0.927 n=10)
Serialize/items=10/native_values=true-4                                       41.61µ ± 5%   41.44µ ± 4%       ~ (p=0.912 n=10)
Serialize/items=100/native_values=true-4                                      348.3µ ± 4%   350.2µ ± 2%       ~ (p=1.000 n=10)
Serialize/items=1000/native_values=true-4                                     3.668m ± 6%   3.678m ± 5%       ~ (p=0.579 n=10)
Serialize/items=10000/native_values=true-4                                    39.09m ± 3%   38.74m ± 4%       ~ (p=0.912 n=10)
Serialize_NoNativeTypes/items=100/native_values=false-4                       148.1µ ± 2%   147.5µ ± 1%       ~ (p=0.218 n=10)
Serialize_NoNativeTypes/items=1000/native_values=false-4                      1.462m ± 3%   1.446m ± 2%       ~ (p=0.052 n=10)
Serialize_NoNativeTypes/items=10000/native_values=false-4                     15.45m ± 3%   15.42m ± 2%       ~ (p=0.684 n=10)
RunTemplate_LargeEnv/items=10-4                                               5.359µ ± 5%   5.392µ ± 4%       ~ (p=0.912 n=10)
RunTemplate_LargeEnv/items=1000-4                                             5.379µ ± 7%   5.381µ ± 3%       ~ (p=0.631 n=10)
RunTemplate_LargeEnv/items=10000-4                                            5.256µ ± 4%   5.266µ ± 2%       ~ (p=0.853 n=10)
geomean                                                                       22.69µ        22.67µ       -0.08%

                                                                         │ bench-base.txt │            bench-head.txt             │
                                                                         │      B/op      │     B/op      vs base                 │
CELEnvExtendCustomFunction-4                                                 46.32Ki ± 0%   46.32Ki ± 0%       ~ (p=0.303 n=10)
CELProgramEvaluation/expression=scalar/optimized=false-4                       96.00 ± 0%     96.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=true-4                        96.00 ± 0%     96.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4        4.251Ki ± 0%   4.251Ki ± 0%       ~ (p=0.581 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4         1.150Ki ± 0%   1.150Ki ± 0%       ~ (p=0.518 n=10)
CELProgramEvaluation/expression=comprehension/optimized=false-4              3.063Ki ± 0%   3.063Ki ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=comprehension/optimized=true-4               2.798Ki ± 0%   2.798Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=map-4                                         1.375Ki ± 0%   1.375Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=native_struct-4                               1.250Ki ± 0%   1.250Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=small-4                             840.0 ± 0%     840.0 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=large-4                             936.0 ± 0%     936.0 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextCompile/cache=miss/environment=small-4                   216.0Ki ± 0%   216.1Ki ± 0%       ~ (p=0.085 n=10)
RunExpressionContextCompile/cache=miss/environment=large-4                   216.2Ki ± 0%   216.3Ki ± 0%       ~ (p=0.092 n=10)
CELEnvExtend/variables=1/functions=0-4                                       4.477Ki ± 0%   4.477Ki ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=10/functions=0-4                                      6.157Ki ± 0%   6.157Ki ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=100/functions=0-4                                     23.63Ki ± 0%   23.63Ki ± 0%       ~ (p=0.303 n=10)
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4     2.297Ki ± 0%   2.297Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextFunctions/functions/cache=hit/environment=large-4        2.359Ki ± 0%   2.359Ki ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=10/native_values=true-4                                      34.39Ki ± 0%   34.39Ki ± 0%       ~ (p=1.000 n=10)
Serialize/items=100/native_values=true-4                                     304.6Ki ± 0%   304.6Ki ± 0%       ~ (p=1.000 n=10)
Serialize/items=1000/native_values=true-4                                    2.946Mi ± 0%   2.946Mi ± 0%       ~ (p=0.336 n=10)
Serialize/items=10000/native_values=true-4                                   29.45Mi ± 0%   29.45Mi ± 0%       ~ (p=0.694 n=10)
Serialize_NoNativeTypes/items=100/native_values=false-4                      104.0Ki ± 0%   104.0Ki ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=1000/native_values=false-4                     1.007Mi ± 0%   1.007Mi ± 0%       ~ (p=1.000 n=10)
Serialize_NoNativeTypes/items=10000/native_values=false-4                    10.07Mi ± 0%   10.07Mi ± 0%       ~ (p=0.676 n=10)
RunTemplate_LargeEnv/items=10-4                                              5.274Ki ± 0%   5.274Ki ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=1000-4                                            5.273Ki ± 0%   5.273Ki ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=10000-4                                           5.273Ki ± 0%   5.273Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                                      14.78Ki        14.78Ki       +0.00%
¹ all samples are equal

                                                                         │ bench-base.txt │            bench-head.txt            │
                                                                         │   allocs/op    │  allocs/op   vs base                 │
CELEnvExtendCustomFunction-4                                                   112.0 ± 0%    112.0 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=false-4                       3.000 ± 0%    3.000 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=true-4                        3.000 ± 0%    3.000 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4          79.00 ± 0%    79.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4           30.00 ± 0%    30.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=comprehension/optimized=false-4                91.00 ± 0%    91.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=comprehension/optimized=true-4                 87.00 ± 0%    87.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=map-4                                           36.00 ± 0%    36.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=native_struct-4                                 29.00 ± 0%    29.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=small-4                             20.00 ± 0%    20.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=large-4                             23.00 ± 0%    23.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextCompile/cache=miss/environment=small-4                    2.293k ± 0%   2.293k ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextCompile/cache=miss/environment=large-4                    2.298k ± 0%   2.298k ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=1/functions=0-4                                         72.00 ± 0%    72.00 ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=10/functions=0-4                                        91.00 ± 0%    91.00 ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=100/functions=0-4                                       193.0 ± 0%    193.0 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4       44.00 ± 0%    44.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextFunctions/functions/cache=hit/environment=large-4          48.00 ± 0%    48.00 ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=10/native_values=true-4                                        424.0 ± 0%    424.0 ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=100/native_values=true-4                                      3.844k ± 0%   3.844k ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=1000/native_values=true-4                                     39.53k ± 0%   39.53k ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=10000/native_values=true-4                                    399.5k ± 0%   399.5k ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=100/native_values=false-4                       1.721k ± 0%   1.721k ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=1000/native_values=false-4                      17.77k ± 0%   17.77k ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=10000/native_values=false-4                     179.8k ± 0%   179.8k ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=10-4                                                39.00 ± 0%    39.00 ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=1000-4                                              39.00 ± 0%    39.00 ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=10000-4                                             39.00 ± 0%    39.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                                        228.2         228.2       +0.00%
¹ all samples are equal

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​flanksource/​kubectl-neat@​v1.0.4 ⏵ v1.0.5100 +1100100100100

View full report

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR updates github.com/flanksource/kubectl-neat from v1.0.4 to v1.0.5, removes four indirect dependencies, and changes kubernetes.Neat to call NeatYAMLOrJSON from the pkg/neat package. Its signature and return behavior remain unchanged.

Changes

Neat package update

Layer / File(s) Summary
Update the Neat dependency and call
go.mod, kubernetes/format.go
go.mod updates kubectl-neat and removes mousetrap, cobra, pflag, and client-go. kubernetes.Neat now calls pkg/neat.NeatYAMLOrJSON.

Possibly related issues

  • Issue 192 asks to reduce Go dependencies. This PR removes several indirect dependencies and changes the kubectl-neat package used by kubernetes.Neat.

Possibly related PRs

  • flanksource/gomplate#194: Both PRs change the implementation used by k8s.neat and address the dependency path; this PR uses kubectl-neat’s pkg/neat package.

Suggested reviewers: hairyhenderson, moshloop

Change: Other

Merge Risk: Minimal · up to 5a682 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the kubernetes package now uses the pkg/neat package from kubectl-neat v1.0.5 instead of the cmd package. The raw summary confirms this in kubernetes/format.go and go.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the kubernetes package now uses the pkg/neat package from kubectl-neat v1.0.5 instead of the cmd package. The raw summary confirms this in kubernetes/format.go and go.mod. The title's 'chore' prefix is a conventional-commit type and does not affect the match.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0dea55db-4b05-46a0-ad32-ec534d2b70cb
Commits

Reviewing files that changed from the base of the PR and between cf91117 and 5a682f2.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum
Files selected for processing: 2

  • go.mod
  • kubernetes/format.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@moshloop
moshloop merged commit 10418a8 into main Dec 2, 2026
13 checks passed
@moshloop
moshloop deleted the feat/kubectl-neat-pkg branch December 2, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants