Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kubecolor for openSUSE:Factory checked in at 2026-04-13 23:18:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kubecolor (Old) and /work/SRC/openSUSE:Factory/.kubecolor.new.21863 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kubecolor" Mon Apr 13 23:18:55 2026 rev:5 rq:1346348 version:0.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kubecolor/kubecolor.changes 2025-11-04 18:42:26.769652152 +0100 +++ /work/SRC/openSUSE:Factory/.kubecolor.new.21863/kubecolor.changes 2026-04-13 23:19:49.802459933 +0200 @@ -1,0 +2,98 @@ +Mon Apr 13 05:00:28 UTC 2026 - Johannes Kastl <[email protected]> + +- Update to version 0.6.0: + * Features + - Colorize kubectl label & kubectl annotate by @applejag in + #300 + - Colorize True/False bool status in kubectl get table output + by @tenitski in #307 + - Improve 'executable not found' error by @applejag in #299 + Makes the error easier to understand. + + Before: + + $ kubecolor get pods + [kubecolor] [ERROR] exec: "kubectl": executable file not found in $PATH + + After: + + $ kubecolor get pods + [kubecolor] [ERROR] exec: "kubectl": executable file not found in $PATH; kubectl must be installed to use kubecolor + + * Fixes + - Increase max line length from 65 kB to 1.5 MB by @applejag in + #297 + Before this fix, kubecolor would freeze when it tried to + parse a line that was too long. But with this buffer size + increase you should now be able to use kubecolor without it + freezing. + In short, this fixes: + - Running kubecolor get secret -o yaml on a secret with a + really big value, such as Helm release secrets + - Running kubecolor logs on a pod that had a really big log + line + In addition, if kubecolor tries to read a line that's still + too long (more than 1.5 MB now), it will now error out + instead of freezing. + The size limit was chosen based on the maximum Secret and + ConfigMap value size, rounded up a bit to account for the + size increase of base64 encoding and any other formatting + like indentation and key names. + - Always use the custom version printer by @applejag in #298 + This did not work before becase kubecolor runs kubectl behind + the scenes, reads its output, parses it, and adds in the + coloring. And with the kubectl version subcommand it also + injects kubecolor's own version into the output. + But when kubecolor's output is not a terminal, such as when + piping it through cat, then as an optimization kubecolor just + handed its stdout over to kubectl, so kubecolor has no way of + seeing or modifying the output. + The fix was to still wrap kubectl's output when being piped, + if (and only if) the subcommand used is kubectl version. + You could always also get the kubecolor version using + kubecolor --kubecolor-version. But now it behaves more + predictable when piping. + * Other + - Add cooldown to Dependabot updates by @applejag in #296 + * Dependencies + - Update to Go 1.26.1 by @applejag in #308 + - Bump actions/checkout from 6.0.0 to 6.0.1 in the all group by + @dependabot[bot] in #287 + - Bump actions/checkout from 6.0.1 to 6.0.2 in the all group by + @dependabot[bot] in #293 + - Bump actions/download-artifact from 7.0.0 to 8.0.0 in the all + group by @dependabot[bot] in #306 + - Bump actions/download-artifact from 8.0.0 to 8.0.1 in the all + group by @dependabot[bot] in #314 + - Bump codecov/codecov-action from 5.5.2 to 6.0.0 in the all + group by @dependabot[bot] in #316 + - Bump docker/build-push-action from 6.18.0 to 6.19.2 in the + all group by @dependabot[bot] in #302 + - Bump docker/setup-qemu-action from 3.6.0 to 3.7.0 in the all + group by @dependabot[bot] in #284 + - Bump goreleaser/goreleaser-action from 6.4.0 to 7.0.0 in the + all group by @dependabot[bot] in #303 + - Bump k8s.io/apimachinery from 0.34.1 to 0.34.2 in the all + group by @dependabot[bot] in #285 + - Bump k8s.io/apimachinery from 0.34.2 to 0.34.3 in the all + group by @dependabot[bot] in #288 + - Bump k8s.io/apimachinery from 0.34.3 to 0.35.0 in the all + group by @dependabot[bot] in #290 + - Bump k8s.io/apimachinery from 0.35.0 to 0.35.1 in the all + group by @dependabot[bot] in #301 + - Bump k8s.io/apimachinery from 0.35.1 to 0.35.2 in the all + group by @dependabot[bot] in #305 + - Bump k8s.io/apimachinery from 0.35.2 to 0.35.3 in the all + group by @dependabot[bot] in #313 + - Bump the all group with 2 updates by @dependabot[bot] in #291 + - Bump the all group with 2 updates by @dependabot[bot] in #292 + - Bump the all group with 2 updates by @dependabot[bot] in #294 + - Bump the all group with 2 updates by @dependabot[bot] in #315 + - Bump the all group with 3 updates by @dependabot[bot] in #286 + - Bump the all group with 3 updates by @dependabot[bot] in #289 + - Bump the all group with 3 updates by @dependabot[bot] in #311 + - Bump the all group with 5 updates by @dependabot[bot] in #312 + - Bump zizmorcore/zizmor-action from 0.4.1 to 0.5.0 in the all + group by @dependabot[bot] in #295 + +------------------------------------------------------------------- Old: ---- kubecolor-0.5.3.obscpio New: ---- kubecolor-0.6.0.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kubecolor.spec ++++++ --- /var/tmp/diff_new_pack.fl0RJH/_old 2026-04-13 23:19:50.418485360 +0200 +++ /var/tmp/diff_new_pack.fl0RJH/_new 2026-04-13 23:19:50.422485526 +0200 @@ -1,7 +1,7 @@ # # spec file for package kubecolor # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,14 @@ Name: kubecolor -Version: 0.5.3 +Version: 0.6.0 Release: 0 Summary: Colorize your kubectl output License: MIT URL: https://kubecolor.github.io/ Source0: %{name}-%{version}.tar.zst Source1: vendor.tar.gz -BuildRequires: go1.25 >= 1.25.3 +BuildRequires: go1.26 >= 1.26.1 Requires: kubernetes-client-provider %description ++++++ _service ++++++ --- /var/tmp/diff_new_pack.fl0RJH/_old 2026-04-13 23:19:50.462487177 +0200 +++ /var/tmp/diff_new_pack.fl0RJH/_new 2026-04-13 23:19:50.466487342 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/kubecolor/kubecolor</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v0.5.3</param> + <param name="revision">v0.6.0</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.fl0RJH/_old 2026-04-13 23:19:50.498488663 +0200 +++ /var/tmp/diff_new_pack.fl0RJH/_new 2026-04-13 23:19:50.502488828 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/kubecolor/kubecolor</param> - <param name="changesrevision">8630603c5879a3d290c63cc9847914c861264a47</param></service></servicedata> + <param name="changesrevision">dc6950dc6d032569edbfdfb26df74fb115abe4e2</param></service></servicedata> (No newline at EOF) ++++++ kubecolor-0.5.3.obscpio -> kubecolor-0.6.0.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/Dockerfile new/kubecolor-0.6.0/Dockerfile --- old/kubecolor-0.5.3/Dockerfile 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/Dockerfile 2026-04-12 14:28:48.000000000 +0200 @@ -1,4 +1,4 @@ -FROM docker.io/library/golang:1.25.3 AS build +FROM docker.io/library/golang:1.26.1 AS build WORKDIR /go/src/kubecolor COPY go.mod go.sum ./ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/Makefile new/kubecolor-0.6.0/Makefile --- old/kubecolor-0.5.3/Makefile 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/Makefile 2026-04-12 14:28:48.000000000 +0200 @@ -47,7 +47,9 @@ .PHONY: docs # View available themes in charmbracelet/freeze: https://xyproto.github.io/splash/docs/index.html -docs/%.svg: ./docs/%.txt Makefile ./docs/freeze-config.json ${GO_FILES} - go run ./internal/cmd/imagegen $< +# NOTE: The light rule must come before the generic rule, as both patterns +# match *-light.svg files and Make uses the first matching rule. docs/%-light.svg: ./docs/%-light.txt Makefile ./docs/freeze-config-light.json ${GO_FILES} go run ./internal/cmd/imagegen -freeze-config=./docs/freeze-config-light.json -flag-color=blue $< +docs/%.svg: ./docs/%.txt Makefile ./docs/freeze-config.json ${GO_FILES} + go run ./internal/cmd/imagegen $< diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/command/runner.go new/kubecolor-0.6.0/command/runner.go --- old/kubecolor-0.5.3/command/runner.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/command/runner.go 2026-04-12 14:28:48.000000000 +0200 @@ -2,6 +2,7 @@ import ( "bytes" + "errors" "fmt" "io" "log/slog" @@ -92,11 +93,16 @@ cfg.ForceColor == ColorLevelNone, // Conventional environment variable for disabling colors os.Getenv("NO_COLOR") != "", - // Skip if stdout is not a tty UNLESS --force-colors is set - !isOutputTerminal() && cfg.ForceColor == ColorLevelUnset: + // Skip if stdout is not a tty UNLESS --force-colors or $FORCE_COLOR are set + !isOutputTerminal() && cfg.ForceColor == ColorLevelUnset && os.Getenv("FORCE_COLOR") == "": - // when we shan't colorize, just run command and return - return execWithoutColors(cfg, args) + if subcommandInfo.Subcommand == kubectl.Version { + // continue with custom printer, but without colors + color.ForceSetColorLevel(terminfo.ColorLevelNone) + } else { + // when we shan't colorize, just run command and return + return execWithoutColors(cfg, args) + } case cfg.ForceColor == ColorLevelAuto || cfg.ForceColor == ColorLevelUnset: // gookit/color defaults to 8-bit colors when FORCE_COLOR is set. @@ -122,9 +128,6 @@ if err != nil { return err } - // in case of panic, at least let kubectl finish executing - defer stdoutReader.Close() - defer stderrReader.Close() // make buffer to be used in defer recover() errBuf := new(bytes.Buffer) @@ -134,9 +137,9 @@ wg := &sync.WaitGroup{} - wg.Add(1) - go func() { - defer wg.Done() + var closeErr error + wg.Go(func() { + defer func() { closeErr = stdoutReader.Close() }() defer func() { if r := recover(); r != nil { slog.Error("Recovered from panic", "error", r) @@ -146,18 +149,17 @@ // This can panic when kubecolor has bug, so recover in defer printers.FullColoredPrinter.Print(stdoutReader, Stdout) - }() + }) - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { + defer stderrReader.Close() // This will unlikely panic printers.ErrorPrinter.Print(errBufReader, Stderr) - }() + }) wg.Wait() - return stdoutReader.Close() + return closeErr } func execWithoutColors(config *Config, args []string) error { @@ -205,6 +207,12 @@ } if err := cmd.Start(); err != nil { + var execErr *exec.Error + if errors.As(err, &execErr) { + if strings.Contains(execErr.Err.Error(), "executable file not found") { + return nil, nil, fmt.Errorf("%w; kubectl must be installed to use kubecolor", err) + } + } return nil, nil, err } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/command/runner_test.go new/kubecolor-0.6.0/command/runner_test.go --- old/kubecolor-0.5.3/command/runner_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/command/runner_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,25 @@ +package command + +import ( + "strings" + "testing" + + "github.com/kubecolor/kubecolor/config" +) + +func TestExecWithReaders_notFound(t *testing.T) { + r, w, err := execWithReaders(&Config{Config: &config.Config{ + Kubectl: "foo-bar-some-executable-that-does-not-exist", + }}, []string{}) + if err == nil { + defer r.Close() + defer w.Close() + t.Error("Expected error, but got nil") + return + } + + suffix := "; kubectl must be installed to use kubecolor" + if !strings.HasSuffix(err.Error(), suffix) { + t.Errorf("Wrong error\nwant suffix: %q\ngot: %q", suffix, err) + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/config/theme.go new/kubecolor-0.6.0/config/theme.go --- old/kubecolor-0.5.3/config/theme.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/config/theme.go 2026-04-12 14:28:48.000000000 +0200 @@ -301,22 +301,27 @@ Table ThemeTable // used in table output, e.g "kubectl get" and parts of "kubectl describe" Stderr ThemeStderr // used in kubectl's stderr output - Apply ThemeApply // used in "kubectl apply" + // Order here matters. The other groups below commonly refer to "theme.apply.dryrun" + + Apply ThemeApply // used in "kubectl apply" + + Annotate ThemeAnnotate // used in "kubectl annotate" Create ThemeCreate // used in "kubectl create" Delete ThemeDelete // used in "kubectl delete" Describe ThemeDescribe // used in "kubectl describe" + Diff ThemeDiff // used in "kubectl diff" Drain ThemeDrain // used in "kubectl drain" Explain ThemeExplain // used in "kubectl explain" Expose ThemeExpose // used in "kubectl expose" + Help ThemeHelp // used in "kubectl --help" + Label ThemeLabel // used in "kubectl label" + Logs ThemeLogs // used in "kubectl logs" Options ThemeOptions // used in "kubectl options" Patch ThemePatch // used in "kubectl patch" Rollout ThemeRollout // used in "kubectl rollout" Scale ThemeScale // used in "kubectl scale" Uncordon ThemeUncordon // used in "kubectl uncordon" Version ThemeVersion // used in "kubectl version" - Help ThemeHelp // used in "kubectl --help" - Logs ThemeLogs // used in "kubectl logs" - Diff ThemeDiff // used in "kubectl diff" } func (t *Theme) ComputeCache() { @@ -499,6 +504,24 @@ Unchanged color.Color `defaultFrom:"theme.base.muted"` // used on unchanged lines } +// ThemeAnnotate holds colors for the "kubectl annotate" output. +type ThemeAnnotate struct { + Annotated color.Color `defaultFrom:"theme.base.success"` // used for all messages, as "kubectl annotate" always prints "annotated" + + DryRun color.Color `defaultFrom:"theme.apply.dryrun"` // used on "(dry run)" and "(server dry run)" + Fallback color.Color `defaultFrom:"theme.base.warning"` // used when outputs unknown format +} + +// ThemeLabel holds colors for the "kubectl label" output. +type ThemeLabel struct { + Labeled color.Color `defaultFrom:"theme.base.success"` // used when label was added + Unlabeled color.Color `defaultFrom:"theme.base.warning"` // used when label was removed + NotLabeled color.Color `defaultFrom:"theme.base.muted"` // used when label was already set + + DryRun color.Color `defaultFrom:"theme.apply.dryrun"` // used on "(dry run)" and "(server dry run)" + Fallback color.Color `defaultFrom:"theme.base.warning"` // used when outputs unknown format +} + // ThemeOptions holds colors for the "kubectl options" output. type ThemeOptions struct { Flag color.Color `defaultFrom:"theme.base.secondary"` // e.g "--kubeconfig" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/config-schema.json new/kubecolor-0.6.0/config-schema.json --- old/kubecolor-0.5.3/config-schema.json 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/config-schema.json 2026-04-12 14:28:48.000000000 +0200 @@ -114,6 +114,10 @@ "$ref": "#/$defs/themeApply", "description": "used in \"kubectl apply\"" }, + "annotate": { + "$ref": "#/$defs/themeAnnotate", + "description": "used in \"kubectl annotate\"" + }, "create": { "$ref": "#/$defs/themeCreate", "description": "used in \"kubectl create\"" @@ -126,6 +130,10 @@ "$ref": "#/$defs/themeDescribe", "description": "used in \"kubectl describe\"" }, + "diff": { + "$ref": "#/$defs/themeDiff", + "description": "used in \"kubectl diff\"" + }, "drain": { "$ref": "#/$defs/themeDrain", "description": "used in \"kubectl drain\"" @@ -138,6 +146,18 @@ "$ref": "#/$defs/themeExpose", "description": "used in \"kubectl expose\"" }, + "help": { + "$ref": "#/$defs/themeHelp", + "description": "used in \"kubectl --help\"" + }, + "label": { + "$ref": "#/$defs/themeLabel", + "description": "used in \"kubectl label\"" + }, + "logs": { + "$ref": "#/$defs/themeLogs", + "description": "used in \"kubectl logs\"" + }, "options": { "$ref": "#/$defs/themeOptions", "description": "used in \"kubectl options\"" @@ -161,23 +181,30 @@ "version": { "$ref": "#/$defs/themeVersion", "description": "used in \"kubectl version\"" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Theme is the root theme config." + }, + "themeAnnotate": { + "properties": { + "annotated": { + "$ref": "#/$defs/color", + "description": "used for all messages, as \"kubectl annotate\" always prints \"annotated\"" }, - "help": { - "$ref": "#/$defs/themeHelp", - "description": "used in \"kubectl --help\"" - }, - "logs": { - "$ref": "#/$defs/themeLogs", - "description": "used in \"kubectl logs\"" + "dryRun": { + "$ref": "#/$defs/color", + "description": "used on \"(dry run)\" and \"(server dry run)\"" }, - "diff": { - "$ref": "#/$defs/themeDiff", - "description": "used in \"kubectl diff\"" + "fallback": { + "$ref": "#/$defs/color", + "description": "used when outputs unknown format" } }, "additionalProperties": false, "type": "object", - "description": "Theme is the root theme config." + "description": "ThemeAnnotate holds colors for the \"kubectl annotate\" output." }, "themeApply": { "properties": { @@ -473,6 +500,33 @@ "type": "object", "description": "ThemeHelp holds colors for the \"kubectl --help\" output." }, + "themeLabel": { + "properties": { + "labeled": { + "$ref": "#/$defs/color", + "description": "used when label was added" + }, + "unlabeled": { + "$ref": "#/$defs/color", + "description": "used when label was removed" + }, + "notLabeled": { + "$ref": "#/$defs/color", + "description": "used when label was already set" + }, + "dryRun": { + "$ref": "#/$defs/color", + "description": "used on \"(dry run)\" and \"(server dry run)\"" + }, + "fallback": { + "$ref": "#/$defs/color", + "description": "used when outputs unknown format" + } + }, + "additionalProperties": false, + "type": "object", + "description": "ThemeLabel holds colors for the \"kubectl label\" output." + }, "themeLogs": { "properties": { "key": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/go.mod new/kubecolor-0.6.0/go.mod --- old/kubecolor-0.5.3/go.mod 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/go.mod 2026-04-12 14:28:48.000000000 +0200 @@ -1,6 +1,6 @@ module github.com/kubecolor/kubecolor -go 1.25.3 +go 1.26.1 require ( github.com/MakeNowJust/heredoc v1.0.0 @@ -14,7 +14,7 @@ github.com/spf13/viper v1.21.0 github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e gopkg.in/yaml.v3 v3.0.1 - k8s.io/apimachinery v0.34.1 + k8s.io/apimachinery v0.35.3 ) require ( @@ -34,5 +34,5 @@ go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect golang.org/x/sys v0.30.0 // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/text v0.31.0 // indirect ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/go.sum new/kubecolor-0.6.0/go.sum --- old/kubecolor-0.5.3/go.sum 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/go.sum 2026-04-12 14:28:48.000000000 +0200 @@ -39,8 +39,8 @@ github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= @@ -68,12 +68,12 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.34.1 h1:dTlxFls/eikpJxmAC7MVE8oOeP1zryV7iRyIjB0gky4= -k8s.io/apimachinery v0.34.1/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= +k8s.io/apimachinery v0.35.3 h1:MeaUwQCV3tjKP4bcwWGgZ/cp/vpsRnQzqO6J6tJyoF8= +k8s.io/apimachinery v0.35.3/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/internal/bytesutil/bytesutil.go new/kubecolor-0.6.0/internal/bytesutil/bytesutil.go --- old/kubecolor-0.5.3/internal/bytesutil/bytesutil.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/internal/bytesutil/bytesutil.go 2026-04-12 14:28:48.000000000 +0200 @@ -7,6 +7,13 @@ "unicode/utf8" ) +// MaxLineLength is the maximum size the line buffer will grow to. +// +// Value is based on the maximum file size in Secrets and ConfigMaps (1 MiB), +// but base64-encoded which increases the size by ~33% (rounded up to 1.5MB) +// [https://kubernetes.io/docs/concepts/configuration/secret/#restriction-data-size] +const MaxLineLength = 1500000 + func IndexOfNonSpace(b []byte, spaceCharset string) int { for i := 0; i < len(b); i++ { if !strings.ContainsRune(spaceCharset, rune(b[i])) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/internal/ctxscanner/ctxscanner.go new/kubecolor-0.6.0/internal/ctxscanner/ctxscanner.go --- old/kubecolor-0.5.3/internal/ctxscanner/ctxscanner.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/internal/ctxscanner/ctxscanner.go 2026-04-12 14:28:48.000000000 +0200 @@ -8,6 +8,8 @@ "errors" "fmt" "io" + + "github.com/kubecolor/kubecolor/internal/bytesutil" ) // Scanner is a wrapper around [bufio.Scanner] that takes in a context. @@ -20,8 +22,10 @@ } func New(r io.Reader) *Scanner { + scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bytesutil.MaxLineLength) return &Scanner{ - buf: bufio.NewScanner(r), + buf: scanner, ch: make(chan string, 100), } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/help.go new/kubecolor-0.6.0/printer/help.go --- old/kubecolor-0.5.3/printer/help.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/help.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,6 +4,7 @@ "bytes" "fmt" "io" + "log/slog" "regexp" "slices" "strings" @@ -79,6 +80,9 @@ line.Trailing) } } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print help output.", "error", err) + } } func (p *HelpPrinter) printCommandLine(w io.Writer, line string) bool { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/help_test.go new/kubecolor-0.6.0/printer/help_test.go --- old/kubecolor-0.5.3/printer/help_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/help_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,22 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/config/testconfig" + "github.com/kubecolor/kubecolor/testutil" +) + +func TestHelpPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := HelpPrinter{Theme: testconfig.NullTheme} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print help output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/json.go new/kubecolor-0.6.0/printer/json.go --- old/kubecolor-0.5.3/printer/json.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/json.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,9 +4,11 @@ "bufio" "fmt" "io" + "log/slog" "strings" "github.com/kubecolor/kubecolor/config" + "github.com/kubecolor/kubecolor/internal/bytesutil" "github.com/kubecolor/kubecolor/internal/stringutil" ) @@ -16,10 +18,14 @@ func (p *JSONPrinter) Print(r io.Reader, w io.Writer) { scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bytesutil.MaxLineLength) for scanner.Scan() { line := scanner.Text() p.printLineAsJsonFormat(line, w) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print JSON output.", "error", err) + } } func (p *JSONPrinter) printLineAsJsonFormat(line string, w io.Writer) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/json_test.go new/kubecolor-0.6.0/printer/json_test.go --- old/kubecolor-0.5.3/printer/json_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/json_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,22 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/config/testconfig" + "github.com/kubecolor/kubecolor/testutil" +) + +func TestJSONPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := JSONPrinter{Theme: testconfig.NullTheme} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print JSON output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_describe.go new/kubecolor-0.6.0/printer/kubectl_describe.go --- old/kubecolor-0.5.3/printer/kubectl_describe.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_describe.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,6 +4,7 @@ "bytes" "fmt" "io" + "log/slog" "regexp" "strings" @@ -68,6 +69,9 @@ } fmt.Fprintf(w, "%s\n", line.Trailing) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print describe output.", "error", err) + } if p.tableBytes != nil { p.TablePrinter.Print(p.tableBytes, w) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_describe_test.go new/kubecolor-0.6.0/printer/kubectl_describe_test.go --- old/kubecolor-0.5.3/printer/kubectl_describe_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_describe_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,21 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/testutil" +) + +func TestDescribePrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := DescribePrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print describe output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_diff.go new/kubecolor-0.6.0/printer/kubectl_diff.go --- old/kubecolor-0.5.3/printer/kubectl_diff.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_diff.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,6 +4,7 @@ "bufio" "fmt" "io" + "log/slog" "strings" "github.com/kubecolor/kubecolor/config" @@ -15,6 +16,7 @@ func (p *DiffPrinter) Print(r io.Reader, w io.Writer) { scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bufio.MaxScanTokenSize) for scanner.Scan() { line := scanner.Text() if line == "" { @@ -25,6 +27,9 @@ fmt.Fprintln(w, parsedLine) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print diff output.", "error", err) + } } func (p *DiffPrinter) parseLine(line string) string { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_diff_test.go new/kubecolor-0.6.0/printer/kubectl_diff_test.go --- old/kubecolor-0.5.3/printer/kubectl_diff_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_diff_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,21 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/testutil" +) + +func TestDiffPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := DiffPrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print diff output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_explain.go new/kubecolor-0.6.0/printer/kubectl_explain.go --- old/kubecolor-0.5.3/printer/kubectl_explain.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_explain.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,6 +4,7 @@ "bytes" "fmt" "io" + "log/slog" "strings" "github.com/kubecolor/kubecolor/config" @@ -43,6 +44,9 @@ p.printVal(w, string(line.Value)) fmt.Fprintf(w, "%s\n", line.Trailing) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print explain output.", "error", err) + } } func (p *ExplainPrinter) keyColor(line describe.Line, isFields bool) color.Color { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_explain_test.go new/kubecolor-0.6.0/printer/kubectl_explain_test.go --- old/kubecolor-0.5.3/printer/kubectl_explain_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_explain_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,21 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/testutil" +) + +func TestExplainPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := ExplainPrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print explain output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_logs.go new/kubecolor-0.6.0/printer/kubectl_logs.go --- old/kubecolor-0.5.3/printer/kubectl_logs.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_logs.go 2026-04-12 14:28:48.000000000 +0200 @@ -3,6 +3,7 @@ import ( "bytes" "io" + "log/slog" "github.com/kubecolor/kubecolor/config" "github.com/kubecolor/kubecolor/config/color" @@ -77,4 +78,7 @@ } } } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print log output.", "error", err) + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_logs_test.go new/kubecolor-0.6.0/printer/kubectl_logs_test.go --- old/kubecolor-0.5.3/printer/kubectl_logs_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_logs_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,21 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/testutil" +) + +func TestLogsPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := LogsPrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print log output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_options.go new/kubecolor-0.6.0/printer/kubectl_options.go --- old/kubecolor-0.5.3/printer/kubectl_options.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_options.go 2026-04-12 14:28:48.000000000 +0200 @@ -3,6 +3,7 @@ import ( "fmt" "io" + "log/slog" "slices" "github.com/kubecolor/kubecolor/config" @@ -44,4 +45,7 @@ p.Theme.Data.String.Render(string(slices.Concat(line.Key, line.Spacing, line.Value))), line.Trailing) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print options output.", "error", err) + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_options_test.go new/kubecolor-0.6.0/printer/kubectl_options_test.go --- old/kubecolor-0.5.3/printer/kubectl_options_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_options_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,21 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/testutil" +) + +func TestOptionsPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := OptionsPrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print options output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_output_colored_printer.go new/kubecolor-0.6.0/printer/kubectl_output_colored_printer.go --- old/kubecolor-0.5.3/printer/kubectl_output_colored_printer.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_output_colored_printer.go 2026-04-12 14:28:48.000000000 +0200 @@ -117,10 +117,10 @@ } case kubectl.Version: - switch { - case p.SubcommandInfo.Output == kubectl.OutputJSON: + switch p.SubcommandInfo.Output { + case kubectl.OutputJSON: return &VersionJSONInjectorPrinter{KubecolorVersion: p.KubecolorVersion, JsonPrinter: &JSONPrinter{Theme: p.Theme}} - case p.SubcommandInfo.Output == kubectl.OutputYAML: + case kubectl.OutputYAML: return &VersionYAMLInjectorPrinter{KubecolorVersion: p.KubecolorVersion, YamlPrinter: &YAMLPrinter{Theme: p.Theme}} default: return &VersionPrinter{ @@ -146,7 +146,9 @@ kubectl.Patch, kubectl.Rollout, kubectl.Scale, - kubectl.Uncordon: + kubectl.Uncordon, + kubectl.Annotate, + kubectl.Label: switch p.SubcommandInfo.Output { case kubectl.OutputJSON: return &JSONPrinter{Theme: p.Theme} @@ -245,6 +247,26 @@ "uncordoned": p.Theme.Uncordon.Uncordoned, }, } + + case kubectl.Annotate: + return &VerbPrinter{ + DryRunColor: p.Theme.Annotate.DryRun, + FallbackColor: p.Theme.Annotate.Fallback, + VerbColor: map[string]color.Color{ + "annotated": p.Theme.Annotate.Annotated, + }, + } + + case kubectl.Label: + return &VerbPrinter{ + DryRunColor: p.Theme.Label.DryRun, + FallbackColor: p.Theme.Label.Fallback, + VerbColor: map[string]color.Color{ + "unlabeled": p.Theme.Label.Unlabeled, + "labeled": p.Theme.Label.Labeled, + "not labeled": p.Theme.Label.NotLabeled, + }, + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_verb.go new/kubecolor-0.6.0/printer/kubectl_verb.go --- old/kubecolor-0.5.3/printer/kubectl_verb.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_verb.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,9 +4,11 @@ "bufio" "fmt" "io" + "log/slog" "strings" "github.com/kubecolor/kubecolor/config/color" + "github.com/kubecolor/kubecolor/internal/bytesutil" ) // VerbPrinter is used in change commands like "kubectl apply" output: @@ -52,6 +54,7 @@ // Print implements [Printer.Print] func (p *VerbPrinter) Print(r io.Reader, w io.Writer) { scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bytesutil.MaxLineLength) for scanner.Scan() { line := scanner.Text() if line == "" { @@ -68,9 +71,19 @@ fmt.Fprintln(w, colored) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print verbs output.", "error", err) + } } func (p *VerbPrinter) colorizeVerb(line string) (string, bool) { + type Match struct { + Before, Verb, After string + Color color.Color + } + var anyMatch bool + var match Match + for verb, color := range p.VerbColor { idx := strings.LastIndex(line, verb) if idx == -1 || idx == 0 { @@ -85,7 +98,14 @@ continue } - return fmt.Sprintf("%s%s%s", before, color.Render(verb), after), true + if !anyMatch || len(verb) > len(match.Verb) { + match = Match{Before: before, Verb: verb, After: after, Color: color} + anyMatch = true + } + } + + if anyMatch { + return fmt.Sprintf("%s%s%s", match.Before, match.Color.Render(match.Verb), match.After), true } for verbPrefix, color := range p.PrefixVerbColor { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_verb_test.go new/kubecolor-0.6.0/printer/kubectl_verb_test.go --- old/kubecolor-0.5.3/printer/kubectl_verb_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_verb_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,21 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/testutil" +) + +func TestVerbPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := VerbPrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print verbs output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_version.go new/kubecolor-0.6.0/printer/kubectl_version.go --- old/kubecolor-0.5.3/printer/kubectl_version.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_version.go 2026-04-12 14:28:48.000000000 +0200 @@ -6,9 +6,11 @@ "encoding/json" "fmt" "io" + "log/slog" "strings" "github.com/kubecolor/kubecolor/config" + "github.com/kubecolor/kubecolor/internal/bytesutil" "gopkg.in/yaml.v3" ) @@ -23,6 +25,7 @@ // Server Version: v1.27.5-gke.200 func (p *VersionPrinter) Print(r io.Reader, w io.Writer) { scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bytesutil.MaxLineLength) any := false for scanner.Scan() { line := scanner.Text() @@ -37,6 +40,9 @@ ) any = true } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print version output.", "error", err) + } // Check if any got printed, so we don't print version after an error like // error: invalid argument "foo" for "--client" flag: strconv.ParseBool: parsing "foo": invalid syntax diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/kubectl_version_test.go new/kubecolor-0.6.0/printer/kubectl_version_test.go --- old/kubecolor-0.5.3/printer/kubectl_version_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/kubectl_version_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,21 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/testutil" +) + +func TestVersionPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := VersionPrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print version output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/single_colored_printer.go new/kubecolor-0.6.0/printer/single_colored_printer.go --- old/kubecolor-0.5.3/printer/single_colored_printer.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/single_colored_printer.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,8 +4,10 @@ "bufio" "fmt" "io" + "log/slog" "github.com/kubecolor/kubecolor/config/color" + "github.com/kubecolor/kubecolor/internal/bytesutil" ) // SingleColoredPrinter is a printer to print something @@ -20,7 +22,11 @@ // Print implements [Printer.Print] func (p *SingleColoredPrinter) Print(r io.Reader, w io.Writer) { scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bytesutil.MaxLineLength) for scanner.Scan() { fmt.Fprintf(w, "%s\n", p.Color.Render(scanner.Text())) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print single-colored output.", "error", err) + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/single_colored_printer_test.go new/kubecolor-0.6.0/printer/single_colored_printer_test.go --- old/kubecolor-0.5.3/printer/single_colored_printer_test.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/single_colored_printer_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -2,10 +2,12 @@ import ( "bytes" + "errors" "strings" "testing" "github.com/kubecolor/kubecolor/config/color" + "github.com/kubecolor/kubecolor/testutil" ) func Test_SingleColoredPrinter_Print(t *testing.T) { @@ -18,3 +20,15 @@ t.Fatalf("input equals output, but colors should have been applied") } } + +func TestSingleColoredPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := SingleColoredPrinter{} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print single-colored output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/stderr.go new/kubecolor-0.6.0/printer/stderr.go --- old/kubecolor-0.5.3/printer/stderr.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/stderr.go 2026-04-12 14:28:48.000000000 +0200 @@ -7,6 +7,7 @@ "strings" "github.com/kubecolor/kubecolor/config" + "github.com/kubecolor/kubecolor/internal/bytesutil" ) // StderrPrinter is a used on stderr input. @@ -20,6 +21,7 @@ // Print implements [Printer.Print] func (p *StderrPrinter) Print(r io.Reader, w io.Writer) { scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bytesutil.MaxLineLength) logsPrinter := LogsPrinter{ Theme: p.Theme, @@ -36,6 +38,7 @@ logsPrinterReader.Reset(line) logsPrinter.Print(logsPrinterReader, w) } + _ = scanner.Err() // special case: ignore any "pipe closed" and similar errors } func (p *StderrPrinter) formatLine(line string) (string, bool) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/table.go new/kubecolor-0.6.0/printer/table.go --- old/kubecolor-0.5.3/printer/table.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/table.go 2026-04-12 14:28:48.000000000 +0200 @@ -3,6 +3,7 @@ import ( "fmt" "io" + "log/slog" "strings" "github.com/kubecolor/kubecolor/config" @@ -62,6 +63,9 @@ fmt.Fprintf(w, "%s", scanner.LeadingSpaces()) p.printLineAsTableFormat(w, cells, p.Theme.Table.Columns) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print table output.", "error", err) + } } // printTableFormat prints a line to w in kubectl "table" Format. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/table_test.go new/kubecolor-0.6.0/printer/table_test.go --- old/kubecolor-0.5.3/printer/table_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/table_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,22 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/config/testconfig" + "github.com/kubecolor/kubecolor/testutil" +) + +func TestTablePrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := TablePrinter{Theme: testconfig.NullTheme} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print table output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/util.go new/kubecolor-0.6.0/printer/util.go --- old/kubecolor-0.5.3/printer/util.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/util.go 2026-04-12 14:28:48.000000000 +0200 @@ -225,6 +225,14 @@ // PVC status "Bound": return theme.Status.Success.Render(status), true + + // Also allow some data-related values, common in CRD statuses (e.g. READY column with True/False) + case "null", "<none>", "<unknown>", "<unset>", "<nil>", "<invalid>": + return theme.Data.Null.Render(status), true + case "true", "True", "TRUE": + return theme.Data.True.Render(status), true + case "false", "False", "FALSE": + return theme.Data.False.Render(status), true } return status, false } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/yaml.go new/kubecolor-0.6.0/printer/yaml.go --- old/kubecolor-0.5.3/printer/yaml.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/printer/yaml.go 2026-04-12 14:28:48.000000000 +0200 @@ -4,10 +4,12 @@ "bufio" "fmt" "io" + "log/slog" "strconv" "strings" "github.com/kubecolor/kubecolor/config" + "github.com/kubecolor/kubecolor/internal/bytesutil" "github.com/kubecolor/kubecolor/internal/stringutil" ) @@ -25,10 +27,14 @@ // Print implements [Printer.Print] func (p *YAMLPrinter) Print(r io.Reader, w io.Writer) { scanner := bufio.NewScanner(r) + scanner.Buffer(nil, bytesutil.MaxLineLength) for scanner.Scan() { line := scanner.Text() p.printLineAsYAMLFormat(line, w) } + if err := scanner.Err(); err != nil { + slog.Error("Failed to print YAML output.", "error", err) + } } func (p *YAMLPrinter) printLineAsYAMLFormat(line string, w io.Writer) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/printer/yaml_test.go new/kubecolor-0.6.0/printer/yaml_test.go --- old/kubecolor-0.5.3/printer/yaml_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/printer/yaml_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,22 @@ +package printer + +import ( + "bytes" + "errors" + "testing" + + "github.com/kubecolor/kubecolor/config/testconfig" + "github.com/kubecolor/kubecolor/testutil" +) + +func TestYAMLPrinter_fail(t *testing.T) { + var logBuf bytes.Buffer + testutil.SetTestLogger(t, &logBuf) + + var outBuf bytes.Buffer + printer := YAMLPrinter{Theme: testconfig.NullTheme} + printer.Print(testutil.DummyReader{ReadFunc: func(b []byte) (int, error) { return 0, errors.New("test") }}, &outBuf) + + testutil.Equal(t, "", outBuf.String(), "output") + testutil.Equal(t, "level=ERROR msg=\"Failed to print YAML output.\" error=test\n", logBuf.String(), "logs") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/scanner/describe/describe.go new/kubecolor-0.6.0/scanner/describe/describe.go --- old/kubecolor-0.5.3/scanner/describe/describe.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/scanner/describe/describe.go 2026-04-12 14:28:48.000000000 +0200 @@ -11,7 +11,6 @@ var ( spaceCharset = " \t" - doubleSpace = []byte{' ', ' '} tabBytes = []byte{'\t'} ) @@ -110,8 +109,10 @@ } func NewScanner(reader io.Reader) *Scanner { + scanner := bufio.NewScanner(reader) + scanner.Buffer(nil, bytesutil.MaxLineLength) return &Scanner{ - lineScanner: bufio.NewScanner(reader), + lineScanner: scanner, } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/scanner/logscan/logscan.go new/kubecolor-0.6.0/scanner/logscan/logscan.go --- old/kubecolor-0.5.3/scanner/logscan/logscan.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/scanner/logscan/logscan.go 2026-04-12 14:28:48.000000000 +0200 @@ -76,8 +76,10 @@ } func NewScanner(reader io.Reader) *Scanner { + scanner := bufio.NewScanner(reader) + scanner.Buffer(nil, bytesutil.MaxLineLength) return &Scanner{ - lineScanner: bufio.NewScanner(reader), + lineScanner: scanner, tokenBuffer: make([]Token, 0, 10), } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/test/corpus/corpus_test.go new/kubecolor-0.6.0/test/corpus/corpus_test.go --- old/kubecolor-0.5.3/test/corpus/corpus_test.go 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/test/corpus/corpus_test.go 2026-04-12 14:28:48.000000000 +0200 @@ -21,6 +21,7 @@ t.Fatalf("Glob did not match any files: %s", glob) } + var anyError bool for _, file := range files { t.Run(file.Name, func(t *testing.T) { if len(file.Tests) == 0 { @@ -30,9 +31,18 @@ t.Run(test.Name, func(t *testing.T) { if err := testcorpus.ExecuteTest(test); err != nil { t.Error(testcorpus.FormatTestError(test, err)) + anyError = true } }) } }) } + + if anyError { + t.Logf("Corpuses are out of sync!\n" + + "You can automatically update the corpus texts by running:\n\n" + + "$ go run ./internal/cmd/testcorpus -update\n" + + "or\n" + + "$ make corpus-update\n\n") + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/test/corpus/kubectl_annotate.txt new/kubecolor-0.6.0/test/corpus/kubectl_annotate.txt --- old/kubecolor-0.5.3/test/corpus/kubectl_annotate.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/test/corpus/kubectl_annotate.txt 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,14 @@ +================================================================================ +# pod annotated +$ kubectl annotate pod my-pod my-annotation=my-value +================================================================================ + +pod/my-pod annotated +pod/my-pod annotated (dry run) +pod/my-pod annotated (server dry run) + +-------------------------------------------------------------------------------- + +pod/my-pod [32mannotated[0m +pod/my-pod [32mannotated[0m [36m(dry run)[0m +pod/my-pod [32mannotated[0m [36m(server dry run)[0m diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/test/corpus/kubectl_describe.txt new/kubecolor-0.6.0/test/corpus/kubectl_describe.txt --- old/kubecolor-0.5.3/test/corpus/kubectl_describe.txt 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/test/corpus/kubectl_describe.txt 2026-04-12 14:28:48.000000000 +0200 @@ -119,8 +119,8 @@ [96mConditions[0m: [1mType Status LastHeartbeatTime LastTransitionTime Reason Message[0m [1m---- ------ ----------------- ------------------ ------ -------[0m - [37mMemoryPressure[0m [36mFalse[0m [37mSun, 18 Oct 2020 12:00:54 +0900[0m [36mWed, 14 Oct 2020 09:28:18 +0900[0m [37mKubeletHasSufficientMemory[0m [36mkubelet has sufficient memory available[0m - [37mDiskPressure[0m [36mFalse[0m [37mSun, 18 Oct 2020 12:00:54 +0900[0m [36mWed, 14 Oct 2020 09:28:18 +0900[0m [37mKubeletHasNoDiskPressure[0m [36mkubelet has no disk pressure[0m + [37mMemoryPressure[0m [31mFalse[0m [37mSun, 18 Oct 2020 12:00:54 +0900[0m [36mWed, 14 Oct 2020 09:28:18 +0900[0m [37mKubeletHasSufficientMemory[0m [36mkubelet has sufficient memory available[0m + [37mDiskPressure[0m [31mFalse[0m [37mSun, 18 Oct 2020 12:00:54 +0900[0m [36mWed, 14 Oct 2020 09:28:18 +0900[0m [37mKubeletHasNoDiskPressure[0m [36mkubelet has no disk pressure[0m [96mAddresses[0m: [36mInternalIP[0m: [93m172.17.0.3[0m [36mHostname[0m: [93mminikube[0m diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/test/corpus/kubectl_get.txt new/kubecolor-0.6.0/test/corpus/kubectl_get.txt --- old/kubecolor-0.5.3/test/corpus/kubectl_get.txt 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/test/corpus/kubectl_get.txt 2026-04-12 14:28:48.000000000 +0200 @@ -99,21 +99,21 @@ -------------------------------------------------------------------------------- [1mNAME SHORTNAMES APIGROUP NAMESPACED KIND[0m -[37mbindings[0m [36mtrue[0m [37mBinding[0m -[37mcomponentstatuses[0m [36mcs[0m [36mfalse[0m [37mComponentStatus[0m -[37mpods[0m [36mpo[0m [36mtrue[0m [37mPod[0m -[37mpodtemplates[0m [36mtrue[0m [37mPodTemplate[0m -[37mreplicationcontrollers[0m [36mrc[0m [36mtrue[0m [37mReplicationController[0m -[37mresourcequotas[0m [36mquota[0m [36mtrue[0m [37mResourceQuota[0m -[37msecrets[0m [36mtrue[0m [37mSecret[0m -[37mserviceaccounts[0m [36msa[0m [36mtrue[0m [37mServiceAccount[0m -[37mservices[0m [36msvc[0m [36mtrue[0m [37mService[0m -[37mmutatingwebhookconfigurations[0m [37madmissionregistration.k8s.io[0m [36mfalse[0m [37mMutatingWebhookConfiguration[0m -[37mcustomresourcedefinitions[0m [36mcrd,crds[0m [37mapiextensions.k8s.io[0m [36mfalse[0m [37mCustomResourceDefinition[0m -[37mcontrollerrevisions[0m [37mapps[0m [36mtrue[0m [37mControllerRevision[0m -[37mdaemonsets[0m [36mds[0m [37mapps[0m [36mtrue[0m [37mDaemonSet[0m -[37mstatefulsets[0m [36msts[0m [37mapps[0m [36mtrue[0m [37mStatefulSet[0m -[37mtokenreviews[0m [37mauthentication.k8s.io[0m [36mfalse[0m [37mTokenReview[0m +[37mbindings[0m [32mtrue[0m [37mBinding[0m +[37mcomponentstatuses[0m [36mcs[0m [31mfalse[0m [37mComponentStatus[0m +[37mpods[0m [36mpo[0m [32mtrue[0m [37mPod[0m +[37mpodtemplates[0m [32mtrue[0m [37mPodTemplate[0m +[37mreplicationcontrollers[0m [36mrc[0m [32mtrue[0m [37mReplicationController[0m +[37mresourcequotas[0m [36mquota[0m [32mtrue[0m [37mResourceQuota[0m +[37msecrets[0m [32mtrue[0m [37mSecret[0m +[37mserviceaccounts[0m [36msa[0m [32mtrue[0m [37mServiceAccount[0m +[37mservices[0m [36msvc[0m [32mtrue[0m [37mService[0m +[37mmutatingwebhookconfigurations[0m [37madmissionregistration.k8s.io[0m [31mfalse[0m [37mMutatingWebhookConfiguration[0m +[37mcustomresourcedefinitions[0m [36mcrd,crds[0m [37mapiextensions.k8s.io[0m [31mfalse[0m [37mCustomResourceDefinition[0m +[37mcontrollerrevisions[0m [37mapps[0m [32mtrue[0m [37mControllerRevision[0m +[37mdaemonsets[0m [36mds[0m [37mapps[0m [32mtrue[0m [37mDaemonSet[0m +[37mstatefulsets[0m [36msts[0m [37mapps[0m [32mtrue[0m [37mStatefulSet[0m +[37mtokenreviews[0m [37mauthentication.k8s.io[0m [31mfalse[0m [37mTokenReview[0m ================================================================================ # a table whose some parts are missing can be handled @@ -168,3 +168,18 @@ [1mNAME[0m [37mworker003[0m + +================================================================================ +# CRD bool status +$ kubectl get certificates +================================================================================ + +NAME READY SECRET AGE +my-cert True my-secret 30d +bad-cert False bad-secret 5d + +-------------------------------------------------------------------------------- + +[1mNAME READY SECRET AGE[0m +[37mmy-cert[0m [32mTrue[0m [37mmy-secret[0m [36m30d[0m +[37mbad-cert[0m [31mFalse[0m [37mbad-secret[0m [36m5d[0m diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/test/corpus/kubectl_label.txt new/kubecolor-0.6.0/test/corpus/kubectl_label.txt --- old/kubecolor-0.5.3/test/corpus/kubectl_label.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/test/corpus/kubectl_label.txt 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,44 @@ +================================================================================ +# pod labeled +$ kubectl label pod my-pod my-label=my-value +================================================================================ + +pod/my-pod labeled +pod/my-pod labeled (dry run) +pod/my-pod labeled (server dry run) + +-------------------------------------------------------------------------------- + +pod/my-pod [32mlabeled[0m +pod/my-pod [32mlabeled[0m [36m(dry run)[0m +pod/my-pod [32mlabeled[0m [36m(server dry run)[0m + +================================================================================ +# pod already labeled +$ kubectl label pod my-pod my-label=my-value +================================================================================ + +pod/my-pod not labeled +pod/my-pod not labeled (dry run) +pod/my-pod not labeled (server dry run) + +-------------------------------------------------------------------------------- + +pod/my-pod [90;3mnot labeled[0m +pod/my-pod [90;3mnot labeled[0m [36m(dry run)[0m +pod/my-pod [90;3mnot labeled[0m [36m(server dry run)[0m + +================================================================================ +# pod unlabeled +$ kubectl label pod my-pod my-label=my-value +================================================================================ + +pod/my-pod unlabeled +pod/my-pod unlabeled (dry run) +pod/my-pod unlabeled (server dry run) + +-------------------------------------------------------------------------------- + +pod/my-pod [33munlabeled[0m +pod/my-pod [33munlabeled[0m [36m(dry run)[0m +pod/my-pod [33munlabeled[0m [36m(server dry run)[0m diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/test/corpus/kubectl_output_colored_printer.txt new/kubecolor-0.6.0/test/corpus/kubectl_output_colored_printer.txt --- old/kubecolor-0.5.3/test/corpus/kubectl_output_colored_printer.txt 2025-11-03 15:32:46.000000000 +0100 +++ new/kubecolor-0.6.0/test/corpus/kubectl_output_colored_printer.txt 2026-04-12 14:28:48.000000000 +0200 @@ -183,9 +183,9 @@ -------------------------------------------------------------------------------- [1mNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES[0m -[37mnginx-6799fc88d8-dnmv7[0m [36m1/1[0m [32mRunning[0m [36m0[0m [37m7d10h[0m [36m172.18.0.5[0m [37mminikube[0m [36m<none>[0m [37m<none>[0m -[37mnginx-6799fc88d8-m8pbc[0m [36m1/1[0m [32mRunning[0m [36m0[0m [37m7d10h[0m [36m172.18.0.4[0m [37mminikube[0m [36m<none>[0m [37m<none>[0m -[37mnginx-6799fc88d8-qdf9b[0m [36m1/1[0m [32mRunning[0m [36m0[0m [37m7d10h[0m [36m172.18.0.3[0m [37mminikube[0m [36m<none>[0m [37m<none>[0m +[37mnginx-6799fc88d8-dnmv7[0m [36m1/1[0m [32mRunning[0m [36m0[0m [37m7d10h[0m [36m172.18.0.5[0m [37mminikube[0m [90;3m<none>[0m [90;3m<none>[0m +[37mnginx-6799fc88d8-m8pbc[0m [36m1/1[0m [32mRunning[0m [36m0[0m [37m7d10h[0m [36m172.18.0.4[0m [37mminikube[0m [90;3m<none>[0m [90;3m<none>[0m +[37mnginx-6799fc88d8-qdf9b[0m [36m1/1[0m [32mRunning[0m [36m0[0m [37m7d10h[0m [36m172.18.0.3[0m [37mminikube[0m [90;3m<none>[0m [90;3m<none>[0m ================================================================================ $ kubectl get pod -o json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/testutil/log.go new/kubecolor-0.6.0/testutil/log.go --- old/kubecolor-0.5.3/testutil/log.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/testutil/log.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,22 @@ +package testutil + +import ( + "io" + "log/slog" + "testing" +) + +func SetTestLogger(t testing.TB, w io.Writer) { + previous := slog.Default() + slog.SetDefault(slog.New(slog.NewTextHandler(w, &slog.HandlerOptions{ + ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr { + if a.Key == "time" { + return slog.Attr{} + } + return a + }, + }))) + t.Cleanup(func() { + slog.SetDefault(previous) + }) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubecolor-0.5.3/testutil/reader.go new/kubecolor-0.6.0/testutil/reader.go --- old/kubecolor-0.5.3/testutil/reader.go 1970-01-01 01:00:00.000000000 +0100 +++ new/kubecolor-0.6.0/testutil/reader.go 2026-04-12 14:28:48.000000000 +0200 @@ -0,0 +1,14 @@ +package testutil + +import "io" + +type DummyReader struct { + ReadFunc func([]byte) (int, error) +} + +var _ io.Reader = DummyReader{} + +// Read implements [io.Reader]. +func (d DummyReader) Read(p []byte) (n int, err error) { + return d.ReadFunc(p) +} ++++++ kubecolor.obsinfo ++++++ --- /var/tmp/diff_new_pack.fl0RJH/_old 2026-04-13 23:19:50.970508146 +0200 +++ /var/tmp/diff_new_pack.fl0RJH/_new 2026-04-13 23:19:50.974508312 +0200 @@ -1,5 +1,5 @@ name: kubecolor -version: 0.5.3 -mtime: 1762180366 -commit: 8630603c5879a3d290c63cc9847914c861264a47 +version: 0.6.0 +mtime: 1775996928 +commit: dc6950dc6d032569edbfdfb26df74fb115abe4e2 ++++++ vendor.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/modules.txt new/vendor/modules.txt --- old/vendor/modules.txt 2025-11-03 15:32:46.000000000 +0100 +++ new/vendor/modules.txt 2026-04-12 14:28:48.000000000 +0200 @@ -99,8 +99,8 @@ ## explicit; go 1.18 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/text v0.28.0 -## explicit; go 1.23.0 +# golang.org/x/text v0.31.0 +## explicit; go 1.24.0 golang.org/x/text/encoding golang.org/x/text/encoding/internal golang.org/x/text/encoding/internal/identifier @@ -112,6 +112,6 @@ # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/apimachinery v0.34.1 -## explicit; go 1.24.0 +# k8s.io/apimachinery v0.35.3 +## explicit; go 1.25.0 k8s.io/apimachinery/pkg/util/duration
