Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '2'
run:
go: '1.23'
go: '1.24'
timeout: 15m
linters:
default: none
Expand Down
2 changes: 1 addition & 1 deletion api/breaker/breaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func (c *CircuitBreaker) beforeExecution() (uint64, error) {
c.cfg.OnExecute(false, StateTripped)

if c.cfg.TrippedErrorMessage != "" {
return generation, trace.ConnectionProblem(nil, c.cfg.TrippedErrorMessage)
return generation, trace.ConnectionProblem(nil, "%s", c.cfg.TrippedErrorMessage)
}

return generation, trace.Wrap(ErrStateTripped)
Expand Down
20 changes: 10 additions & 10 deletions api/types/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (d *Duration) UnmarshalJSON(data []byte) error {
}
out, err := parseDuration(stringVar)
if err != nil {
return trace.BadParameter(err.Error())
return trace.BadParameter("%s", err)
}
*d = out
return nil
Expand All @@ -83,7 +83,7 @@ func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {
}
out, err := parseDuration(stringVar)
if err != nil {
return trace.BadParameter(err.Error())
return trace.BadParameter("%s", err)
}
*d = out
return nil
Expand Down Expand Up @@ -189,7 +189,7 @@ func parseDuration(s string) (Duration, error) {
return 0, nil
}
if s == "" {
return 0, trace.BadParameter("time: invalid duration " + orig)
return 0, trace.BadParameter("time: invalid duration %q", orig)
}
for s != "" {
var (
Expand All @@ -207,7 +207,7 @@ func parseDuration(s string) (Duration, error) {
pl := len(s)
v, s, err = leadingInt(s)
if err != nil {
return 0, trace.BadParameter("time: invalid duration " + orig)
return 0, trace.BadParameter("time: invalid duration %q", orig)
}
pre := pl != len(s) // whether we consumed anything before a period

Expand All @@ -221,7 +221,7 @@ func parseDuration(s string) (Duration, error) {
}
if !pre && !post {
// no digits (e.g. ".s" or "-.s")
return 0, trace.BadParameter("time: invalid duration " + orig)
return 0, trace.BadParameter("time: invalid duration %q", orig)
}

// Consume unit.
Expand All @@ -233,17 +233,17 @@ func parseDuration(s string) (Duration, error) {
}
}
if i == 0 {
return 0, trace.BadParameter("time: missing unit in duration " + orig)
return 0, trace.BadParameter("time: missing unit in duration %q", orig)
}
u := s[:i]
s = s[i:]
unit, ok := unitMap[u]
if !ok {
return 0, trace.BadParameter("time: unknown unit " + " in duration " + orig)
return 0, trace.BadParameter("time: unknown unit in duration %q", orig)
}
if v > (1<<63-1)/unit {
// overflow
return 0, trace.BadParameter("time: invalid duration " + orig)
return 0, trace.BadParameter("time: invalid duration %q", orig)
}
v *= unit
if f > 0 {
Expand All @@ -252,13 +252,13 @@ func parseDuration(s string) (Duration, error) {
v += int64(float64(f) * (float64(unit) / scale))
if v < 0 {
// overflow
return 0, trace.BadParameter("time: invalid duration " + orig)
return 0, trace.BadParameter("time: invalid duration %q", orig)
}
}
d += v
if d < 0 {
// overflow
return 0, trace.BadParameter("time: invalid duration " + orig)
return 0, trace.BadParameter("time: invalid duration %q", orig)
}
}

Expand Down
3 changes: 1 addition & 2 deletions api/utils/keys/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ limitations under the License.
package keys

import (
"fmt"
"regexp"

"github.com/gravitational/trace"
Expand Down Expand Up @@ -175,7 +174,7 @@ var privateKeyPolicyErrRegex = regexp.MustCompile(`private key policy not (met|s

func NewPrivateKeyPolicyError(p PrivateKeyPolicy) error {
// TODO(Joerger): Replace with "private key policy not satisfied" in 16.0.0
return trace.BadParameter(fmt.Sprintf("private key policy not met: %s", p))
return trace.BadParameter("private key policy not met: %s", p)
}

// ParsePrivateKeyPolicyError checks if the given error is a private key policy
Expand Down
2 changes: 1 addition & 1 deletion api/utils/retryutils/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (r *Linear) For(ctx context.Context, retryFn func() error) error {
case <-r.After():
r.Inc()
case <-ctx.Done():
return trace.LimitExceeded(ctx.Err().Error())
return trace.LimitExceeded("%s", ctx.Err())
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions api/utils/sshutils/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package sshutils
import (
"bytes"
"encoding/json"
"fmt"
"io"

"github.com/gravitational/trace"
Expand Down Expand Up @@ -68,10 +67,11 @@ func ConnectProxyTransport(sconn ssh.Conn, req *DialReq, exclusive bool) (conn *
// passed to us via stderr.
errMessageBytes, _ := io.ReadAll(channel.Stderr())
errMessage := string(bytes.TrimSpace(errMessageBytes))
if len(errMessage) == 0 {
errMessage = fmt.Sprintf("failed connecting to %v [%v]", req.Address, req.ServerID)
if errMessage != "" {
return nil, false, trace.Errorf("%s", errMessage)
}
return nil, false, trace.Errorf(errMessage)

return nil, false, trace.Errorf("failed connecting to %v [%v]", req.Address, req.ServerID)
}

if exclusive {
Expand Down
2 changes: 1 addition & 1 deletion api/utils/tlsutils/tlsutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func ParseCertificatePEM(bytes []byte) (*x509.Certificate, error) {
}
cert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
return nil, trace.BadParameter(err.Error())
return nil, trace.BadParameter("%s", err)
}
return cert, nil
}
Expand Down
2 changes: 1 addition & 1 deletion build.assets/tooling/cmd/query-latest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ func getLatest(ctx context.Context, versionSpec string, gh github.GitHub) (strin
}
}

return "", trace.NotFound("no releases matched " + versionSpec)
return "", trace.NotFound("no releases matched %q", versionSpec)
}
2 changes: 1 addition & 1 deletion build.assets/tooling/cmd/render-tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func readInput(input io.Reader, ch chan<- TestEvent, errCh chan<- error) {
for scanner.Scan() {
line := scanner.Text()
if line != "" {
err = trace.Errorf(line)
err = trace.Errorf("%s", line)
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.assets/tooling/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gravitational/teleport/build.assets/tooling

go 1.23.12
go 1.24.6

require (
buf.build/go/bufplugin v0.9.0
Expand Down
2 changes: 1 addition & 1 deletion build.assets/versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Keep versions in sync with devbox.json, when applicable.

# Sync with devbox.json.
GOLANG_VERSION ?= go1.23.12
GOLANG_VERSION ?= go1.24.6
GOLANGCI_LINT_VERSION ?= v2.1.5

# NOTE: Remember to update engines.node in package.json to match the major version.
Expand Down
2 changes: 1 addition & 1 deletion e
Submodule e updated from a1195d to 78953d
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gravitational/teleport

go 1.23.12
go 1.24.6

require (
cloud.google.com/go/cloudsqlconn v1.9.0
Expand Down
6 changes: 2 additions & 4 deletions integrations/access/datadog/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ func onAfterDatadogResponse(sink common.StatusSink) resty.ResponseMiddleware {
}

if resp.IsError() {
var details string
switch result := resp.Error().(type) {
case *ErrorResult:
details = fmt.Sprintf("http error code=%v, errors=[%v]", resp.StatusCode(), strings.Join(result.Errors, ", "))
return trace.Errorf("http error code=%v, errors=[%v]", resp.StatusCode(), strings.Join(result.Errors, ", "))
default:
details = fmt.Sprintf("unknown error result %#v", result)
return trace.Errorf("unknown error result %#v", result)
}
return trace.Errorf(details)
}
return nil
}
Expand Down
17 changes: 9 additions & 8 deletions integrations/access/pagerduty/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,24 @@ func onAfterPagerDutyResponse(sink common.StatusSink) resty.ResponseMiddleware {
log.WithError(err).Errorf("Error while emitting PagerDuty plugin status: %v", err)
}

var errorFn = trace.Errorf
if status.GetCode() == types.PluginStatusCode_UNAUTHORIZED {
errorFn = func(msg string, args ...any) error {
return trace.AccessDenied(msg, args...)
}
}

if resp.IsError() {
var details string
switch result := resp.Error().(type) {
case *ErrorResult:
// Do we have a formatted PagerDuty API error response? We set
// an empty `ErrorResult` in the pre-request hook, and if the
// HTTP server returns an error, the `resty` middleware will
// attempt to unmarshal the error response into it.
details = fmt.Sprintf("http error code=%v, err_code=%v, message=%v, errors=[%v]", resp.StatusCode(), result.Code, result.Message, strings.Join(result.Errors, ", "))
return errorFn("http error code=%v, err_code=%v, message=%v, errors=[%v]", resp.StatusCode(), result.Code, result.Message, strings.Join(result.Errors, ", "))
default:
details = fmt.Sprintf("unknown error result %#v", result)
}

if status.GetCode() == types.PluginStatusCode_UNAUTHORIZED {
return trace.AccessDenied(details)
return errorFn("unknown error result %#v", result)
}
return trace.Errorf(details)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion integrations/event-handler/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gravitational/teleport/integrations/event-handler

go 1.23.12
go 1.24.6

require (
github.com/alecthomas/kong v0.9.0
Expand Down
2 changes: 1 addition & 1 deletion integrations/terraform/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gravitational/teleport/integrations/terraform

go 1.23.12
go 1.24.6

// Doc generation tooling
require github.com/hashicorp/terraform-plugin-docs v0.0.0 // replaced
Expand Down
Loading
Loading