Skip to content

Commit

Permalink
fix: Skip processing of missing resources in Rollouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarcher committed Feb 13, 2025
1 parent 558a0a2 commit d83eed4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/peterbourgon/ff/v3/ffcli"
)

const Version = "v0.3.0"
const Version = "v0.3.1"

func NewVersionCmd() *ffcli.Command {
c := &ffcli.Command{
Expand Down
6 changes: 6 additions & 0 deletions pkg/kubernetes/rollout.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"encoding/json"
"fmt"

"github.com/fatih/color"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

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

0 comments on commit d83eed4

Please sign in to comment.