Skip to content

Commit

Permalink
supportbundle: fix nil pointer error
Browse files Browse the repository at this point in the history
when iproute2 is not installed in docker image, and run `antctl supportbundle` in
antrea-agent, it will panic, this is because, collectAgent will return a nil pointer
for systemv1beta1.SupportBundle, and in `func (r *supportBundleREST) Create`,
antrea handles the nil pointer directly which leads to the panic.

Signed-off-by: Bin Liu <biliu@vmware.com>
  • Loading branch information
liu4480 committed Aug 17, 2021
1 parent bdddc01 commit 9f91972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apiserver/registry/system/supportbundle/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ func (r *supportBundleREST) Create(ctx context.Context, obj runtime.Object, _ re
default:
r.cache = b
}
r.clean(ctx, b.Filepath, bundleExpireDuration)
}()
r.clean(ctx, b.Filepath, bundleExpireDuration)
}()

return r.cache, nil
Expand Down

0 comments on commit 9f91972

Please sign in to comment.