11package healthcheck_test
22
33import (
4+ "context"
45 "encoding/json"
56 "errors"
67 "io"
@@ -14,7 +15,7 @@ import (
1415
1516 "github.com/google/go-cmp/cmp"
1617 "github.com/nginxinc/kubernetes-ingress/internal/healthcheck"
17- "github.com/nginxinc/nginx-plus-go-client/client"
18+ "github.com/nginxinc/nginx-plus-go-client/v2/ client"
1819)
1920
2021// testHandler creates http handler for testing HealthServer.
@@ -356,7 +357,7 @@ func getUpstreamsForHost(host string) []string {
356357// Upstreams retrieved using NGINX API client:
357358// foo.tea.com -> upstream1, upstream2
358359// bar.tea.com -> upstream2
359- func getUpstreamsFromNGINXAllUp () (* client.Upstreams , error ) {
360+ func getUpstreamsFromNGINXAllUp (_ context. Context ) (* client.Upstreams , error ) {
360361 ups := client.Upstreams {
361362 "upstream1" : client.Upstream {
362363 Peers : []client.Peer {
@@ -390,7 +391,7 @@ func getUpstreamsFromNGINXAllUp() (*client.Upstreams, error) {
390391// Upstreams retrieved using NGINX API client:
391392// foo.tea.com -> upstream1, upstream2
392393// bar.tea.com -> upstream2
393- func getUpstreamsFromNGINXAllUnhealthy () (* client.Upstreams , error ) {
394+ func getUpstreamsFromNGINXAllUnhealthy (_ context. Context ) (* client.Upstreams , error ) {
394395 ups := client.Upstreams {
395396 "upstream1" : client.Upstream {
396397 Peers : []client.Peer {
@@ -425,7 +426,7 @@ func getUpstreamsFromNGINXAllUnhealthy() (*client.Upstreams, error) {
425426// Upstreams retrieved using NGINX API client
426427// foo.tea.com -> upstream1, upstream2
427428// bar.tea.com -> upstream2
428- func getUpstreamsFromNGINXPartiallyUp () (* client.Upstreams , error ) {
429+ func getUpstreamsFromNGINXPartiallyUp (_ context. Context ) (* client.Upstreams , error ) {
429430 ups := client.Upstreams {
430431 "upstream1" : client.Upstream {
431432 Peers : []client.Peer {
@@ -455,14 +456,14 @@ func getUpstreamsFromNGINXPartiallyUp() (*client.Upstreams, error) {
455456// getUpstreamsFromNGINXNotExistingHost is a helper func used
456457// for faking response data from NGINX API. It responds
457458// with empty upstreams on a request for not existing host.
458- func getUpstreamsFromNGINXNotExistingHost () (* client.Upstreams , error ) {
459+ func getUpstreamsFromNGINXNotExistingHost (_ context. Context ) (* client.Upstreams , error ) {
459460 ups := client.Upstreams {}
460461 return & ups , nil
461462}
462463
463464// getUpstreamsFromNGINXErrorFromAPI is a helper func used
464465// for faking err response from NGINX API client.
465- func getUpstreamsFromNGINXErrorFromAPI () (* client.Upstreams , error ) {
466+ func getUpstreamsFromNGINXErrorFromAPI (_ context. Context ) (* client.Upstreams , error ) {
466467 return nil , errors .New ("nginx api error" )
467468}
468469
@@ -483,7 +484,7 @@ func streamUpstreamsForName(name string) []string {
483484// for faking response from NGINX Plus client.
484485//
485486//nolint:unparam
486- func streamUpstreamsFromNGINXAllUp () (* client.StreamUpstreams , error ) {
487+ func streamUpstreamsFromNGINXAllUp (_ context. Context ) (* client.StreamUpstreams , error ) {
487488 streamUpstreams := client.StreamUpstreams {
488489 "streamUpstream1" : client.StreamUpstream {
489490 Peers : []client.StreamPeer {
@@ -507,7 +508,7 @@ func streamUpstreamsFromNGINXAllUp() (*client.StreamUpstreams, error) {
507508// for faking response from NGINX Plus client.
508509//
509510//nolint:unparam
510- func streamUpstreamsFromNGINXPartiallyUp () (* client.StreamUpstreams , error ) {
511+ func streamUpstreamsFromNGINXPartiallyUp (_ context. Context ) (* client.StreamUpstreams , error ) {
511512 streamUpstreams := client.StreamUpstreams {
512513 "streamUpstream1" : client.StreamUpstream {
513514 Peers : []client.StreamPeer {
@@ -531,7 +532,7 @@ func streamUpstreamsFromNGINXPartiallyUp() (*client.StreamUpstreams, error) {
531532// for faking response from NGINX Plus client.
532533//
533534//nolint:unparam
534- func streamUpstreamsFromNGINXAllPeersDown () (* client.StreamUpstreams , error ) {
535+ func streamUpstreamsFromNGINXAllPeersDown (_ context. Context ) (* client.StreamUpstreams , error ) {
535536 streamUpstreams := client.StreamUpstreams {
536537 "streamUpstream1" : client.StreamUpstream {
537538 Peers : []client.StreamPeer {
0 commit comments