From 9bee4b1515435e22236202f0976c004996632eb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 02:06:21 +0000 Subject: [PATCH 1/4] chore(deps): bump golang.org/x/sync from 0.8.0 to 0.9.0 (#3218) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7b381553e4..4157b6a639 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/crypto v0.28.0 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.9.0 golang.org/x/term v0.25.0 helm.sh/helm/v3 v3.16.2 k8s.io/api v0.31.2 diff --git a/go.sum b/go.sum index d8ee221b21..d53ad8d49c 100644 --- a/go.sum +++ b/go.sum @@ -1976,8 +1976,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 4a88d52ea70a7e77012197bc061d3274fbdb8094 Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Fri, 8 Nov 2024 05:05:15 -0800 Subject: [PATCH 2/4] chore: true up logger comments and minor refactors (#3215) Signed-off-by: Kit Patella --- src/pkg/logger/logger.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pkg/logger/logger.go b/src/pkg/logger/logger.go index c812f7b3ca..0086fd65a9 100644 --- a/src/pkg/logger/logger.go +++ b/src/pkg/logger/logger.go @@ -155,9 +155,6 @@ func ConfigDefault() Config { // New takes a Config and returns a validated logger. func New(cfg Config) (*slog.Logger, error) { - var handler slog.Handler - opts := slog.HandlerOptions{} - // Use default destination if none if cfg.Destination == nil { cfg.Destination = DestinationDefault @@ -167,8 +164,12 @@ func New(cfg Config) (*slog.Logger, error) { if !validLevels[cfg.Level] { return nil, fmt.Errorf("unsupported log level: %d", cfg.Level) } - opts.Level = slog.Level(cfg.Level) + opts := slog.HandlerOptions{ + Level: slog.Level(cfg.Level), + } + + var handler slog.Handler switch cfg.Format.ToLower() { case FormatText: handler = console.NewHandler(cfg.Destination, &console.HandlerOptions{ @@ -195,14 +196,13 @@ func New(cfg Config) (*slog.Logger, error) { return nil, fmt.Errorf("unsupported log format: %s", cfg.Format) } - log := slog.New(handler) - return log, nil + return slog.New(handler), nil } // ctxKey provides a location to store a logger in a context. type ctxKey struct{} -// defaultCtxKey provides a default key if one is not passed into From. +// defaultCtxKey provides a key instance to get a logger from context var defaultCtxKey = ctxKey{} // WithContext takes a context.Context and a *slog.Logger, storing it on the key @@ -239,12 +239,12 @@ func Enabled(ctx context.Context) bool { func From(ctx context.Context) *slog.Logger { // Check that we have a ctx if ctx == nil { - return newEmpty() + return newDiscard() } // Grab value from key log := ctx.Value(defaultCtxKey) if log == nil { - return newEmpty() + return newDiscard() } // Ensure our value is a *slog.Logger before we cast. @@ -258,7 +258,7 @@ func From(ctx context.Context) *slog.Logger { } // newDiscard returns a logger without any settings that goes to io.Discard -func newEmpty() *slog.Logger { +func newDiscard() *slog.Logger { h := slog.NewTextHandler(DestinationNone, &slog.HandlerOptions{}) return slog.New(h) } From efabba1ab5eee0d5eb586f21e306aae9aa81767f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:10:34 -0500 Subject: [PATCH 3/4] chore(deps): bump goreleaser/goreleaser-action from 6.0.0 to 6.1.0 (#3216) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71cf344d29..8f3e11679d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -194,7 +194,7 @@ jobs: # Create the GitHub release notes, upload artifact backups to S3, publish homebrew recipe - name: Run GoReleaser - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 + uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0 with: distribution: goreleaser version: "~> v2" From 36b779f13b4b2f46bc028f093ff1f2ca47b14c77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:13:26 -0500 Subject: [PATCH 4/4] chore(deps): bump golang.org/x/term from 0.25.0 to 0.26.0 (#3220) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 4157b6a639..d2f180a235 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/crypto v0.28.0 golang.org/x/sync v0.9.0 - golang.org/x/term v0.25.0 + golang.org/x/term v0.26.0 helm.sh/helm/v3 v3.16.2 k8s.io/api v0.31.2 k8s.io/apimachinery v0.31.2 @@ -526,7 +526,7 @@ require ( golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sys v0.27.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.7.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect diff --git a/go.sum b/go.sum index d53ad8d49c..1915f9a0f5 100644 --- a/go.sum +++ b/go.sum @@ -2082,8 +2082,8 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2096,8 +2096,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= +golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=