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
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/aws/aws-sdk-go-v2/config v1.33.4
github.com/aws/aws-sdk-go-v2/service/sts v1.50.0
github.com/cedar-policy/cedar-go v1.8.0
github.com/cenkalti/backoff/v5 v5.0.3
github.com/cenkalti/backoff/v7 v7.0.0
github.com/charmbracelet/x/ansi v0.11.8
github.com/containerd/errdefs v1.0.0
github.com/coreos/go-oidc/v3 v3.21.0
Expand Down Expand Up @@ -129,6 +129,7 @@ require (
github.com/aws/smithy-go v1.28.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cenkalti/backoff/v7 v7.0.0 h1:ZP+QAaaOnVUHo+ufFpZ835hbT3x2fy+h2lecVEosZ6A=
github.com/cenkalti/backoff/v7 v7.0.0/go.mod h1:qcKBGwsu4hpxHtQ8tWYsQ+ifzx2+sS+Xx/3jfe30lI8=
github.com/certifi/gocertifi v0.0.0-20180118203423-deb3ae2ef261/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/monitored_token_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"syscall"
"time"

"github.com/cenkalti/backoff/v5"
"github.com/cenkalti/backoff/v7"
"golang.org/x/oauth2"
"golang.org/x/sync/singleflight"

Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/monitored_token_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"
"time"

"github.com/cenkalti/backoff/v5"
"github.com/cenkalti/backoff/v7"
"go.uber.org/mock/gomock"
"golang.org/x/oauth2"

Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"sync"
"time"

"github.com/cenkalti/backoff/v5"
"github.com/cenkalti/backoff/v7"
"github.com/golang-jwt/jwt/v5"
"github.com/lestrrat-go/httprc/v3"
"github.com/lestrrat-go/jwx/v3/jwk"
Expand Down
16 changes: 9 additions & 7 deletions pkg/container/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package kubernetes
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"log/slog"
Expand All @@ -17,10 +18,10 @@ import (
"strings"
"time"

"github.com/cenkalti/backoff/v5"
"github.com/cenkalti/backoff/v7"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
apimwatch "k8s.io/apimachinery/pkg/watch"
Expand Down Expand Up @@ -253,7 +254,8 @@ func (c *Client) AttachToWorkload(ctx context.Context, workloadName string) (io.
}),
)
if err != nil {
if statusErr, ok := err.(*errors.StatusError); ok {
var statusErr *apierrors.StatusError
if errors.As(err, &statusErr) {
slog.Error("kubernetes API error",
"status", statusErr.ErrStatus.Status,
"message", statusErr.ErrStatus.Message,
Expand Down Expand Up @@ -528,7 +530,7 @@ func (c *Client) applyStatefulSet(
func (c *Client) getExistingStatefulSet(ctx context.Context, namespace, name string) (*appsv1.StatefulSet, error) {
existing, err := c.client.AppsV1().StatefulSets(namespace).Get(ctx, name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
if apierrors.IsNotFound(err) {
return nil, nil
}
return nil, fmt.Errorf("failed to get existing statefulset: %w", err)
Expand Down Expand Up @@ -631,7 +633,7 @@ func (c *Client) GetWorkloadInfo(ctx context.Context, workloadName string) (runt
// Get the statefulset
statefulset, err := c.client.AppsV1().StatefulSets(namespace).Get(ctx, workloadName, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
if apierrors.IsNotFound(err) {
return runtime.ContainerInfo{}, fmt.Errorf("%w: statefulset %s not found", runtime.ErrWorkloadNotFound, workloadName)
}
return runtime.ContainerInfo{}, fmt.Errorf("failed to get statefulset %s: %w", workloadName, err)
Expand Down Expand Up @@ -699,7 +701,7 @@ func (c *Client) IsWorkloadRunning(ctx context.Context, workloadName string) (bo
// Get the statefulset
statefulset, err := c.client.AppsV1().StatefulSets(namespace).Get(ctx, workloadName, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
if apierrors.IsNotFound(err) {
return false, fmt.Errorf("%w: statefulset %s not found", runtime.ErrWorkloadNotFound, workloadName)
}
return false, fmt.Errorf("failed to get statefulset %s: %w", workloadName, err)
Expand Down Expand Up @@ -786,7 +788,7 @@ func (c *Client) RemoveWorkload(ctx context.Context, workloadName string) error
deleteOptions := metav1.DeleteOptions{}
err := c.client.AppsV1().StatefulSets(namespace).Delete(ctx, workloadName, deleteOptions)
if err != nil {
if errors.IsNotFound(err) {
if apierrors.IsNotFound(err) {
// If the statefulset doesn't exist, that's fine
slog.Info("statefulset not found, nothing to remove", "name", workloadName)
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/transport/stdio.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"
"unicode"

"github.com/cenkalti/backoff/v5"
"github.com/cenkalti/backoff/v7"
"golang.org/x/exp/jsonrpc2"
"golang.org/x/oauth2"

Expand Down
2 changes: 1 addition & 1 deletion pkg/vmcp/composer/workflow_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"maps"
"time"

"github.com/cenkalti/backoff/v5"
"github.com/cenkalti/backoff/v7"
"golang.org/x/sync/errgroup"

"github.com/stacklok/toolhive/pkg/audit"
Expand Down
Loading