From 478e3f933a275b79809586a4d444c9693899670a Mon Sep 17 00:00:00 2001 From: Walid Baruni Date: Tue, 14 Jan 2025 12:17:31 +0200 Subject: [PATCH] Remove kubectl template dependency with simplified implementation (#4807) This PR removes the dependency on kubectl's template package by providing a simplified implementation for CLI help text formatting. Binary size reduced from `92M` to `81M`. The new implementation: - Removes i18n support to reduce complexity - Drops markdown processing (blackfriday) dependency - Keeps the core formatting functionality for command help text and examples - Maintains heredoc support for clean multiline strings - Includes comprehensive tests The result is a lighter, more focused package that handles just what we need for CLI help formatting while removing a heavy dependency. Original inspiration from kubectl is credited in the package documentation. ## Summary by CodeRabbit - **Refactor** - Removed internationalization (i18n) support from CLI commands - Updated template handling to use a custom local package - Simplified string definitions for command descriptions and examples - Reduced external dependencies related to Kubernetes libraries - **Chores** - Cleaned up module dependencies in `go.mod` - Removed unused Kubernetes-related packages - **New Features** - Introduced a new `templates` utility package for CLI text formatting --- cmd/cli/config/set.go | 7 +- cmd/cli/devstack/devstack.go | 11 +- cmd/cli/docker/docker_run.go | 11 +- cmd/cli/job/describe.go | 11 +- cmd/cli/job/executions.go | 11 +- cmd/cli/job/get.go | 11 +- cmd/cli/job/history.go | 11 +- cmd/cli/job/list.go | 11 +- cmd/cli/job/logs.go | 11 +- cmd/cli/job/run.go | 12 +- cmd/cli/job/stop.go | 24 ++-- cmd/cli/job/validate.go | 11 +- cmd/cli/serve/serve.go | 11 +- cmd/cli/wasm/wasm_run.go | 11 +- cmd/util/templates/normalizers.go | 63 +++++++++ cmd/util/templates/normalizers_test.go | 172 +++++++++++++++++++++++++ go.mod | 19 +-- go.sum | 39 ------ go.work.sum | 5 + 19 files changed, 317 insertions(+), 145 deletions(-) create mode 100644 cmd/util/templates/normalizers.go create mode 100644 cmd/util/templates/normalizers_test.go diff --git a/cmd/cli/config/set.go b/cmd/cli/config/set.go index e2dddaaecd..7796cc83ac 100644 --- a/cmd/cli/config/set.go +++ b/cmd/cli/config/set.go @@ -8,9 +8,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/flags/cliflags" @@ -19,11 +18,11 @@ import ( "github.com/bacalhau-project/bacalhau/pkg/config/types" ) -var setExample = templates.Examples(i18n.T(` +var setExample = templates.Examples(` bacalhau config set api.host=127.0.0.1 bacalhau config set compute.orchestrators=http://127.0.0.1:1234,http://1.1.1.1:1234 bacalhau config set labels=foo=bar,baz=buz -`)) +`) func newSetCmd() *cobra.Command { setCmd := &cobra.Command{ diff --git a/cmd/cli/devstack/devstack.go b/cmd/cli/devstack/devstack.go index 50719a1fb4..21e0200455 100644 --- a/cmd/cli/devstack/devstack.go +++ b/cmd/cli/devstack/devstack.go @@ -9,7 +9,6 @@ import ( "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/viper" - "k8s.io/kubectl/pkg/util/i18n" "github.com/bacalhau-project/bacalhau/cmd/util/flags/configflags" "github.com/bacalhau-project/bacalhau/pkg/config" @@ -17,7 +16,7 @@ import ( "github.com/bacalhau-project/bacalhau/pkg/logger" "github.com/bacalhau-project/bacalhau/webui" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/pkg/devstack" @@ -27,12 +26,12 @@ import ( ) var ( - devStackLong = templates.LongDesc(i18n.T(` + devStackLong = templates.LongDesc(` Start a cluster of nodes and run a job on them. -`)) +`) //nolint:lll // Documentation - devstackExample = templates.Examples(i18n.T(` + devstackExample = templates.Examples(` # Create a devstack cluster with a single requester node and 3 compute nodes (Default values) bacalhau devstack @@ -44,7 +43,7 @@ var ( # Run a devstack and create (or use) the config repo in a specific folder bacalhau devstack --stack-repo ./my-devstack-configuration -`)) +`) ) type options struct { diff --git a/cmd/cli/docker/docker_run.go b/cmd/cli/docker/docker_run.go index 109e9c93e6..0eb52f2126 100644 --- a/cmd/cli/docker/docker_run.go +++ b/cmd/cli/docker/docker_run.go @@ -6,9 +6,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/cli/helpers" "github.com/bacalhau-project/bacalhau/cmd/util" @@ -24,12 +23,12 @@ import ( ) var ( - runLong = templates.LongDesc(i18n.T(` + runLong = templates.LongDesc(` Runs a job using the Docker executor on the node. - `)) + `) //nolint:lll // Documentation - runExample = templates.Examples(i18n.T(` + runExample = templates.Examples(` # Run a Docker job, using the image 'dpokidov/imagemagick', with a CID mounted at /input_images and an output volume mounted at /outputs in the container. All flags after the '--' are passed directly into the container for execution. bacalhau docker run \ -i src=ipfs://QmeZRGhe4PmjctYVSVHuEiA9oSXnqmYa4kQubSHgWbjv72,dst=/input_images \ @@ -47,7 +46,7 @@ var ( # Specify an image digest bacalhau docker run ubuntu@sha256:35b4f89ec2ee42e7e12db3d107fe6a487137650a2af379bbd49165a1494246ea echo hello - `)) + `) ) // DockerRunOptions declares the arguments accepted by the `docker run` command diff --git a/cmd/cli/job/describe.go b/cmd/cli/job/describe.go index 4ecc5c6a1f..3968e2bbe5 100644 --- a/cmd/cli/job/describe.go +++ b/cmd/cli/job/describe.go @@ -8,7 +8,6 @@ import ( "github.com/samber/lo" "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/i18n" "github.com/bacalhau-project/bacalhau/cmd/util/cols" "github.com/bacalhau-project/bacalhau/pkg/lib/collections" @@ -16,7 +15,7 @@ import ( "github.com/bacalhau-project/bacalhau/pkg/publicapi/client/v2" "github.com/bacalhau-project/bacalhau/pkg/util/idgen" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/flags/cliflags" @@ -25,11 +24,11 @@ import ( ) var ( - describeLong = templates.LongDesc(i18n.T(` + describeLong = templates.LongDesc(` Full description of a job, in yaml format. Use 'bacalhau job list' to get a list of jobs. -`)) - describeExample = templates.Examples(i18n.T(` +`) + describeExample = templates.Examples(` # Describe a job with the full ID bacalhau job describe j-e3f8c209-d683-4a41-b840-f09b88d087b9 @@ -38,7 +37,7 @@ var ( # Describe a job with json output bacalhau job describe --output json --pretty j-b6ad164a -`)) +`) ) // DescribeOptions is a struct to support job command diff --git a/cmd/cli/job/executions.go b/cmd/cli/job/executions.go index f3d27eb098..14d4c623fa 100644 --- a/cmd/cli/job/executions.go +++ b/cmd/cli/job/executions.go @@ -9,9 +9,8 @@ import ( "github.com/jedib0t/go-pretty/v6/table" "github.com/jedib0t/go-pretty/v6/text" "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/flags/cliflags" @@ -27,14 +26,14 @@ var executionsOrderByFields = []string{"modified_at", "created_at"} var ( executionShort = `List executions for a job by id.` - executionLong = templates.LongDesc(i18n.T(` + executionLong = templates.LongDesc(` List executions for a job by id. -`)) +`) - executionExample = templates.Examples(i18n.T(` + executionExample = templates.Examples(` # All executions for a given job. bacalhau job executions j-e3f8c209-d683-4a41-b840-f09b88d087b9 -`)) +`) ) // ExecutionOptions is a struct to support node command diff --git a/cmd/cli/job/get.go b/cmd/cli/job/get.go index 35515fbdf3..8f5adf31e1 100644 --- a/cmd/cli/job/get.go +++ b/cmd/cli/job/get.go @@ -6,9 +6,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/flags/cliflags" @@ -19,18 +18,18 @@ import ( ) var ( - getLong = templates.LongDesc(i18n.T(` + getLong = templates.LongDesc(` Get the results of the job, including stdout and stderr. -`)) +`) //nolint:lll // Documentation - getExample = templates.Examples(i18n.T(` + getExample = templates.Examples(` # Get the results of a job. bacalhau job get j-51225160-807e-48b8-88c9-28311c7899e1 # Get the results of a job, with a short ID. bacalhau job get ebd9bf2f -`)) +`) ) type GetOptions struct { diff --git a/cmd/cli/job/history.go b/cmd/cli/job/history.go index 13c55a9942..f14079931c 100644 --- a/cmd/cli/job/history.go +++ b/cmd/cli/job/history.go @@ -5,9 +5,8 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/cols" @@ -21,11 +20,11 @@ import ( var ( historyShort = `List history events for a job by id.` - historyLong = templates.LongDesc(i18n.T(` + historyLong = templates.LongDesc(` List job history events for a job by id. -`)) +`) - historyExample = templates.Examples(i18n.T(` + historyExample = templates.Examples(` # All events for a given job. bacalhau job history e3f8c209-d683-4a41-b840-f09b88d087b9 @@ -34,7 +33,7 @@ var ( # Execution level events bacalhau job history --type execution e3f8c209 -`)) +`) ) // HistoryOptions is a struct to support node command diff --git a/cmd/cli/job/list.go b/cmd/cli/job/list.go index 12613fe13e..1d8b8532de 100644 --- a/cmd/cli/job/list.go +++ b/cmd/cli/job/list.go @@ -9,9 +9,8 @@ import ( "github.com/jedib0t/go-pretty/v6/text" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/labels" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/flags/cliflags" @@ -28,16 +27,16 @@ var orderByFields = []string{"id", "created_at"} var ( listShort = `List submitted jobs.` - listLong = templates.LongDesc(i18n.T(` + listLong = templates.LongDesc(` List submitted jobs. -`)) +`) - listExample = templates.Examples(i18n.T(` + listExample = templates.Examples(` # List submitted jobs. bacalhau job list # List jobs and output as json - bacalhau job list --output json --pretty`)) + bacalhau job list --output json --pretty`) // defaultLabelFilter is the default label filter for the list command when // no other labels are specified. diff --git a/cmd/cli/job/logs.go b/cmd/cli/job/logs.go index 839d474eb5..307a3b3636 100644 --- a/cmd/cli/job/logs.go +++ b/cmd/cli/job/logs.go @@ -4,19 +4,18 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" ) var ( - logsShortDesc = templates.LongDesc(i18n.T(` + logsShortDesc = templates.LongDesc(` Follow logs from a currently executing job -`)) +`) - logsExample = templates.Examples(i18n.T(` + logsExample = templates.Examples(` # Read logs for a previously submitted job bacalhau job logs j-51225160-807e-48b8-88c9-28311c7899e1 @@ -25,7 +24,7 @@ var ( # Tail logs for a previously submitted job bacalhau job logs j-51225160-807e-48b8-88c9-28311c7899e1 --tail -`)) +`) ) type LogCommandOptions struct { diff --git a/cmd/cli/job/run.go b/cmd/cli/job/run.go index dfaf8765dc..721850d165 100644 --- a/cmd/cli/job/run.go +++ b/cmd/cli/job/run.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/i18n" "github.com/bacalhau-project/bacalhau/cmd/util/output" "github.com/bacalhau-project/bacalhau/pkg/lib/marshaller" @@ -12,7 +11,7 @@ import ( "github.com/bacalhau-project/bacalhau/pkg/publicapi/apimodels" "github.com/bacalhau-project/bacalhau/pkg/publicapi/client/v2" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/flags/cliflags" @@ -21,13 +20,14 @@ import ( ) var ( - runLong = templates.LongDesc(i18n.T(` + runLong = templates.LongDesc(` Run a job from a file or from stdin. JSON and YAML formats are accepted. - `)) + `) + //nolint:lll // Documentation - runExample = templates.Examples(i18n.T(` + runExample = templates.Examples(` # Run a job using the data in job.yaml bacalhau job run ./job.yaml @@ -35,7 +35,7 @@ var ( bacalhau job describe 6e51df50 | bacalhau job run # Download the - `)) + `) ) type RunOptions struct { diff --git a/cmd/cli/job/stop.go b/cmd/cli/job/stop.go index 1aad3f4864..3f269445fb 100644 --- a/cmd/cli/job/stop.go +++ b/cmd/cli/job/stop.go @@ -5,12 +5,11 @@ import ( "io" "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/i18n" "github.com/bacalhau-project/bacalhau/pkg/publicapi/apimodels" "github.com/bacalhau-project/bacalhau/pkg/publicapi/client/v2" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/printer" @@ -18,29 +17,30 @@ import ( ) var ( - stopLong = templates.LongDesc(i18n.T(` + stopLong = templates.LongDesc(` Stop a previously submitted job. -`)) +`) //nolint:lll // Documentation - stopExample = templates.Examples(i18n.T(` + stopExample = templates.Examples(` # Stop a previously submitted job bacalhau job stop j-51225160-807e-48b8-88c9-28311c7899e1 # Stop a job, with a short ID. bacalhau job stop j-51225160 -`)) +`) ) var ( - checkingJobStatusMessage = i18n.T("Checking job status") - connectingMessage = i18n.T("Connecting to network") - gettingJobMessage = i18n.T("Verifying job state") - stoppingJobMessage = i18n.T("Stopping job") + checkingJobStatusMessage = "Checking job status" - jobAlreadyCompleteMessage = i18n.T(`Job is already in a terminal state. + connectingMessage = "Connecting to network" + gettingJobMessage = "Verifying job state" + stoppingJobMessage = "Stopping job" + + jobAlreadyCompleteMessage = `Job is already in a terminal state. The current state is: %s -`) +` ) type StopOptions struct { diff --git a/cmd/cli/job/validate.go b/cmd/cli/job/validate.go index ae3d9bea76..fb6d83c983 100644 --- a/cmd/cli/job/validate.go +++ b/cmd/cli/job/validate.go @@ -2,9 +2,8 @@ package job import ( "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/pkg/lib/marshaller" @@ -12,17 +11,17 @@ import ( ) var ( - validateLong = templates.LongDesc(i18n.T(` + validateLong = templates.LongDesc(` Validate a job from a file JSON and YAML formats are accepted. Job Specification: https://docs.bacalhau.org/setting-up/jobs/job -`)) +`) //nolint:lll // Documentation - validateExample = templates.Examples(i18n.T(` + validateExample = templates.Examples(` # Validate a job using the data in job.yaml bacalhau job validate ./job.yaml -`)) +`) ) const JobSpecLink = "https://docs.bacalhau.org/setting-up/jobs/job" diff --git a/cmd/cli/serve/serve.go b/cmd/cli/serve/serve.go index e62c145bd4..4cec831264 100644 --- a/cmd/cli/serve/serve.go +++ b/cmd/cli/serve/serve.go @@ -9,9 +9,8 @@ import ( "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/util" "github.com/bacalhau-project/bacalhau/cmd/util/flags/configflags" @@ -30,11 +29,11 @@ import ( ) var ( - serveLong = templates.LongDesc(i18n.T(` + serveLong = templates.LongDesc(` Start a bacalhau node. - `)) + `) - serveExample = templates.Examples(i18n.T(` + serveExample = templates.Examples(` # Start a private bacalhau requester node bacalhau serve # or @@ -46,7 +45,7 @@ var ( # Start a public bacalhau node with the WebUI on port 3000 (default:0.0.0.0:8483) bacalhau serve --config WebUI.Enabled --config WebUI.Listen=0.0.0.0:3000 -`)) +`) ) const ( diff --git a/cmd/cli/wasm/wasm_run.go b/cmd/cli/wasm/wasm_run.go index 087353c63b..5b37aef223 100644 --- a/cmd/cli/wasm/wasm_run.go +++ b/cmd/cli/wasm/wasm_run.go @@ -13,9 +13,8 @@ import ( "github.com/spf13/viper" "github.com/tetratelabs/wazero" "github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1" - "k8s.io/kubectl/pkg/util/i18n" - "k8s.io/kubectl/pkg/util/templates" + "github.com/bacalhau-project/bacalhau/cmd/util/templates" "github.com/bacalhau-project/bacalhau/cmd/cli/helpers" "github.com/bacalhau-project/bacalhau/cmd/util" @@ -36,17 +35,17 @@ import ( ) var ( - wasmRunLong = templates.LongDesc(i18n.T(` + wasmRunLong = templates.LongDesc(` Runs a job that was compiled to WASM - `)) + `) - wasmRunExample = templates.Examples(i18n.T(` + wasmRunExample = templates.Examples(` # Runs the module in bacalhau bacalhau wasm run # Fetches the wasm module from and executes it. bacalhau wasm run - `)) + `) ) type WasmRunOptions struct { diff --git a/cmd/util/templates/normalizers.go b/cmd/util/templates/normalizers.go new file mode 100644 index 0000000000..aa34f1468a --- /dev/null +++ b/cmd/util/templates/normalizers.go @@ -0,0 +1,63 @@ +// Package templates provides utilities for formatting CLI help text. +// This implementation is inspired by and simplified from kubectl's templates package +// (k8s.io/kubectl/pkg/util/templates) which is licensed under Apache License 2.0. +package templates + +import ( + "strings" + + "github.com/MakeNowJust/heredoc" +) + +const Indentation = " " + +// LongDesc formats a command's long description +func LongDesc(s string) string { + if len(s) == 0 { + return s + } + return normalizer{s}. + heredoc(). // Handle multiline strings nicely + trim(). // Remove extra whitespace + string +} + +// Examples formats command examples with proper indentation +func Examples(s string) string { + if len(s) == 0 { + return s + } + return normalizer{s}. + trim(). + indent(). + string +} + +type normalizer struct { + string +} + +func (s normalizer) heredoc() normalizer { + s.string = heredoc.Doc(s.string) + return s +} + +func (s normalizer) trim() normalizer { + s.string = strings.TrimSpace(s.string) + return s +} + +func (s normalizer) indent() normalizer { + var indentedLines []string + for _, line := range strings.Split(s.string, "\n") { + trimmed := strings.TrimSpace(line) + if trimmed != "" { + indented := Indentation + trimmed + indentedLines = append(indentedLines, indented) + } else { + indentedLines = append(indentedLines, "") + } + } + s.string = strings.Join(indentedLines, "\n") + return s +} diff --git a/cmd/util/templates/normalizers_test.go b/cmd/util/templates/normalizers_test.go new file mode 100644 index 0000000000..92ebe6b34d --- /dev/null +++ b/cmd/util/templates/normalizers_test.go @@ -0,0 +1,172 @@ +//go:build unit || !integration + +package templates + +import ( + "strings" + "testing" +) + +func TestLongDesc(t *testing.T) { + tests := []struct { + name string + input string + expected string + }{ + { + name: "empty string", + input: "", + expected: "", + }, + { + name: "single line", + input: "A simple description", + expected: "A simple description", + }, + { + name: "multi line with indentation", + input: ` + This is a long description + that spans multiple lines + with indentation. + `, + expected: "This is a long description\nthat spans multiple lines\nwith indentation.", + }, + { + name: "multi line with empty lines", + input: ` + First paragraph. + + Second paragraph. + Still second paragraph. + `, + expected: "First paragraph.\n\nSecond paragraph.\nStill second paragraph.", + }, + { + name: "trim whitespace", + input: " \n Description with spaces \n ", + expected: "Description with spaces", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := LongDesc(tt.input) + if got != tt.expected { + t.Errorf("LongDesc() = %q, want %q", got, tt.expected) + } + }) + } +} + +func TestExamples(t *testing.T) { + tests := []struct { + name string + input string + expected string + }{ + { + name: "empty string", + input: "", + expected: "", + }, + { + name: "single example", + input: "# Simple example\ncommand arg1 arg2", + expected: " # Simple example\n command arg1 arg2", + }, + { + name: "multiple examples", + input: `# First example +command1 arg1 +# Second example +command2 arg1 arg2`, + expected: " # First example\n command1 arg1\n # Second example\n command2 arg1 arg2", + }, + { + name: "examples with empty lines", + input: `# First example +command1 arg1 + +# Second example +command2 arg1`, + expected: " # First example\n command1 arg1\n\n # Second example\n command2 arg1", + }, + { + name: "preserve existing indentation", + input: " # Indented example\n command arg1", + expected: " # Indented example\n command arg1", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := Examples(tt.input) + if got != tt.expected { + t.Errorf("Examples() =\n%q\nwant:\n%q", got, tt.expected) + } + }) + } +} + +func TestNormalizerMethods(t *testing.T) { + t.Run("heredoc", func(t *testing.T) { + input := ` + First line + Second line + ` + n := normalizer{input} + result := n.heredoc().string + if strings.Contains(result, " ") { + t.Error("heredoc() did not remove leading whitespace") + } + }) + + t.Run("trim", func(t *testing.T) { + input := " text with spaces " + n := normalizer{input} + result := n.trim().string + if result != "text with spaces" { + t.Errorf("trim() = %q, want %q", result, "text with spaces") + } + }) + + t.Run("indent", func(t *testing.T) { + tests := []struct { + name string + input string + expected string + }{ + { + name: "single line", + input: "text", + expected: Indentation + "text", + }, + { + name: "multiple lines", + input: "line1\nline2", + expected: Indentation + "line1\n" + Indentation + "line2", + }, + { + name: "empty lines preserved", + input: "line1\n\nline2", + expected: Indentation + "line1\n\n" + Indentation + "line2", + }, + { + name: "trim and indent", + input: " line1 \n line2 ", + expected: Indentation + "line1\n" + Indentation + "line2", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + n := normalizer{tt.input} + got := n.trim().indent().string + if got != tt.expected { + t.Errorf("indent() =\n%q\nwant:\n%q", got, tt.expected) + } + }) + } + }) +} diff --git a/go.mod b/go.mod index 2c73a5087d..017ee1b9b4 100644 --- a/go.mod +++ b/go.mod @@ -83,7 +83,6 @@ require ( golang.org/x/crypto v0.28.0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 k8s.io/apimachinery v0.29.0 - k8s.io/kubectl v0.29.0 sigs.k8s.io/yaml v1.4.0 ) @@ -130,13 +129,11 @@ require ( github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/option v1.0.1 // indirect - github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/minio/highwayhash v1.0.3 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/multiformats/go-multicodec v0.9.0 // indirect github.com/multiformats/go-multihash v0.2.3 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/nats-io/jwt/v2 v2.7.0 // indirect github.com/nats-io/nkeys v0.4.7 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect @@ -155,7 +152,6 @@ require ( gonum.org/v1/gonum v0.15.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect - k8s.io/cli-runtime v0.29.0 // indirect ) replace ( @@ -166,7 +162,7 @@ replace ( require ( bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/MakeNowJust/heredoc v1.0.0 // indirect + github.com/MakeNowJust/heredoc v1.0.0 github.com/Microsoft/go-winio v0.6.1 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/benbjohnson/clock v1.3.5 @@ -174,7 +170,6 @@ require ( github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/chai2010/gettext-go v1.0.2 // indirect github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/docker/go-units v0.5.0 // indirect @@ -186,7 +181,6 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/gofuzz v1.2.0 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -208,7 +202,6 @@ require ( github.com/ipfs/go-log v1.0.5 // indirect github.com/ipfs/go-metrics-interface v0.0.1 // indirect github.com/jbenet/goprocess v0.1.4 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect @@ -228,10 +221,7 @@ require ( github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/moby/spdystream v0.2.0 // indirect github.com/moby/term v0.5.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect @@ -251,7 +241,6 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/cors v1.7.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/samber/lo v1.47.0 github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.11.0 // indirect @@ -268,7 +257,6 @@ require ( go.uber.org/atomic v1.11.0 go4.org v0.0.0-20230225012048-214862532bf5 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.9.0 golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.25.0 @@ -278,15 +266,10 @@ require ( golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 - gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.29.0 // indirect - k8s.io/client-go v0.29.0 // indirect k8s.io/klog/v2 v2.110.1 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect lukechampine.com/blake3 v1.3.0 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/go.sum b/go.sum index 20db33a9cc..aab0a286b1 100644 --- a/go.sum +++ b/go.sum @@ -300,8 +300,6 @@ github.com/apache/arrow/go/v15 v15.0.2/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+ye github.com/apache/thrift v0.17.0/go.mod h1:OLxhMRJxomX+1I/KUw03qoV3mMz16BwaKI+d4fPBx7Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 h1:pT3hpW0cOHRJx8Y0DfJUEQuqPild8jRGmSFmBgvydr0= @@ -365,8 +363,6 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= -github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -428,8 +424,6 @@ github.com/dylibso/observe-sdk/go v0.0.0-20231201014635-141351c24659 h1:RGgHymaE github.com/dylibso/observe-sdk/go v0.0.0-20231201014635-141351c24659/go.mod h1:7h4vx/+0cUjKN2f+ynM4tcC8kIjJqP6W2cLcn7buXl4= github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo= github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= @@ -574,8 +568,6 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg= github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -595,8 +587,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -670,7 +660,6 @@ github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f h1:KMlcu9X58lhTA github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= @@ -819,7 +808,6 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -911,8 +899,6 @@ github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCy github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= github.com/libp2p/zeroconf/v2 v2.2.0 h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv53Q= github.com/libp2p/zeroconf/v2 v2.2.0/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -961,14 +947,10 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= @@ -1003,8 +985,6 @@ github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/n github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nats-io/jwt/v2 v2.7.0 h1:J+ZnaaMGQi3xSB8iOhVM5ipiWCDrQvgEoitTwWFyOYw= github.com/nats-io/jwt/v2 v2.7.0/go.mod h1:ZdWS1nZa6WMZfFwwgpEaqBV8EPGVgOTDHN/wTbz0Y5A= github.com/nats-io/nats-server/v2 v2.10.22 h1:Yt63BGu2c3DdMoBZNcR6pjGQwk/asrKU7VX846ibxDA= @@ -1120,7 +1100,6 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= @@ -1531,8 +1510,6 @@ golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1990,8 +1967,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= @@ -2015,20 +1990,10 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A= -k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA= k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= -k8s.io/cli-runtime v0.29.0 h1:q2kC3cex4rOBLfPOnMSzV2BIrrQlx97gxHJs21KxKS4= -k8s.io/cli-runtime v0.29.0/go.mod h1:VKudXp3X7wR45L+nER85YUzOQIru28HQpXr0mTdeCrk= -k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8= -k8s.io/client-go v0.29.0/go.mod h1:yLkXH4HKMAywcrD82KMSmfYg2DlE8mepPR4JGSo5n38= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= -k8s.io/kubectl v0.29.0 h1:Oqi48gXjikDhrBF67AYuZRTcJV4lg2l42GmvsP7FmYI= -k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= @@ -2068,9 +2033,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/go.work.sum b/go.work.sum index be0257db76..fd34de1b91 100644 --- a/go.work.sum +++ b/go.work.sum @@ -536,6 +536,7 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245 h1:K1Xf3bKttbF+koVGaX5xngRIZ5bVjbmPnaxE/dR08uY= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc= github.com/sagikazarmark/crypt v0.19.0 h1:WMyLTjHBo64UvNcWqpzY3pbZTYgnemZU8FBZigKc42E= @@ -677,6 +678,8 @@ golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -726,6 +729,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= k8s.io/apiserver v0.26.2 h1:Pk8lmX4G14hYqJd1poHGC08G03nIHVqdJMR0SD3IH3o= k8s.io/apiserver v0.26.2/go.mod h1:GHcozwXgXsPuOJ28EnQ/jXEM9QeG6HT22YxSNmpYNh8= +k8s.io/component-base v0.26.2 h1:IfWgCGUDzrD6wLLgXEstJKYZKAFS2kO+rBRi0p3LqcI= +k8s.io/component-base v0.26.2/go.mod h1:DxbuIe9M3IZPRxPIzhch2m1eT7uFrSBJUBuVCQEBivs= k8s.io/component-base v0.29.0 h1:T7rjd5wvLnPBV1vC4zWd/iWRbV8Mdxs+nGaoaFzGw3s= k8s.io/component-base v0.29.0/go.mod h1:sADonFTQ9Zc9yFLghpDpmNXEdHyQmFIGbiuZbqAXQ1M= k8s.io/component-helpers v0.29.0 h1:Y8W70NGeitKxWwhsPo/vEQbQx5VqJV+3xfLpP3V1VxU=