Skip to content

Commit

Permalink
fixup! disruptors: error out if there are no targets
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre committed Aug 28, 2023
1 parent 5bcd09b commit 4a2435d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/disruptors/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
// DefaultTargetPort defines default target port if not specified in Fault
const DefaultTargetPort = 80

// ErrSelectorNoPods is returned by NewPodDisruptor when the selector passed to it does not match any pod in the
// cluster.
var ErrSelectorNoPods = errors.New("no pods found matching selector")

// PodDisruptor defines the types of faults that can be injected in a Pod
Expand Down
1 change: 1 addition & 0 deletions pkg/disruptors/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// ErrServiceNoTargets is returned by NewServiceDisruptor when passed a service without any pod matching its selector.
var ErrServiceNoTargets = errors.New("service does not have any backing pods")

// ServiceDisruptor defines operations for injecting faults in services
Expand Down

0 comments on commit 4a2435d

Please sign in to comment.