Skip to content

Commit

Permalink
connectivity: fix panic if the cilium-health test fails
Browse files Browse the repository at this point in the history
Fix a possible panic occurring if the cilium-health test fails and flow
validation is enabled, or --print-flow is given. Indeed, that action is
configured with a nil destination (as the check has no strict destination
target), in turn causing the panic during flow visualization. Hence,
let's switch to creating a generic action (i.e., intended for generic
assertions), effectively disabling flow collection and display.

Signed-off-by: Marco Iorio <[email protected]>
  • Loading branch information
giorio94 committed Jan 30, 2024
1 parent 976322c commit df0a9e5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions connectivity/tests/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

"github.com/cilium/cilium-cli/connectivity/check"
"github.com/cilium/cilium-cli/defaults"
"github.com/cilium/cilium-cli/utils/features"
)

func CiliumHealth() check.Scenario {
Expand All @@ -33,7 +32,7 @@ func (s *ciliumHealth) Name() string {
func (s *ciliumHealth) Run(ctx context.Context, t *check.Test) {
for name, pod := range t.Context().CiliumPods() {
pod := pod
t.NewAction(s, name, &pod, nil, features.IPFamilyAny).Run(func(a *check.Action) {
t.NewGenericAction(s, name).Run(func(a *check.Action) {
runHealthProbe(ctx, t, &pod)
})
}
Expand Down

0 comments on commit df0a9e5

Please sign in to comment.