Skip to content

Commit d83eed4

Browse files
committed
fix: Skip processing of missing resources in Rollouts.
1 parent 558a0a2 commit d83eed4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pkg/cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/peterbourgon/ff/v3/ffcli"
88
)
99

10-
const Version = "v0.3.0"
10+
const Version = "v0.3.1"
1111

1212
func NewVersionCmd() *ffcli.Command {
1313
c := &ffcli.Command{

pkg/kubernetes/rollout.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"encoding/json"
66
"fmt"
77

8+
"github.com/fatih/color"
9+
apierrors "k8s.io/apimachinery/pkg/api/errors"
810
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
911
"k8s.io/apimachinery/pkg/types"
1012

@@ -14,6 +16,10 @@ import (
1416
func (c *Client) Rollouts(ctx context.Context) (*v1alpha1.RolloutList, error) {
1517
rls, err := c.rolloutsClientset.ArgoprojV1alpha1().Rollouts("").List(ctx, metav1.ListOptions{})
1618
if err != nil {
19+
if apierrors.IsNotFound(err) {
20+
fmt.Printf("%s: %s\n\n", color.YellowString("warn: argo rollouts: not found"), err)
21+
return new(v1alpha1.RolloutList), nil
22+
}
1723
return nil, fmt.Errorf("failed to load argo rollouts: %w", err)
1824
}
1925
return rls, nil

0 commit comments

Comments
 (0)