Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 5b5e17c

Browse files
committed
Removes unused func and adds context to probe func
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
1 parent 2dbaff3 commit 5b5e17c

File tree

2 files changed

+8
-37
lines changed

2 files changed

+8
-37
lines changed

pkg/probe/probe.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import (
1414
"k8s.io/klog"
1515
)
1616

17+
const (
18+
timeout = time.Second * 10
19+
)
20+
1721
type HealthCheck struct {
1822
handler healthcheck.Handler
1923

@@ -50,7 +54,10 @@ func (h *HealthCheck) Check() error {
5054
return nil
5155
}
5256

53-
_, _, err := h.oidcAuther.AuthenticateToken(context.Background(), h.fakeJWT)
57+
ctx, cancel := context.WithTimeout(context.Background(), timeout)
58+
defer cancel()
59+
60+
_, _, err := h.oidcAuther.AuthenticateToken(ctx, h.fakeJWT)
5461
if err != nil && strings.HasSuffix(err.Error(), "authenticator not initialized") {
5562
err = fmt.Errorf("OIDC provider not yet initialized: %s", err)
5663
klog.V(4).Infof(err.Error())

pkg/util/pods.go

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)