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

Commit c25565f

Browse files
committed
Updates Kubernetes dependencies to v1.18.0
Signed-off-by: JoshVanL <[email protected]>
1 parent 9838781 commit c25565f

File tree

10 files changed

+74
-39
lines changed

10 files changed

+74
-39
lines changed

cmd/app/options/oidc.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
)
1111

1212
type OIDCAuthenticationOptions struct {
13-
APIAudiences []string
1413
CAFile string
1514
ClientID string
1615
IssuerURL string
@@ -35,11 +34,6 @@ func (o *OIDCAuthenticationOptions) Validate() error {
3534
}
3635

3736
func (o *OIDCAuthenticationOptions) AddFlags(fs *pflag.FlagSet) *OIDCAuthenticationOptions {
38-
fs.StringSliceVar(&o.APIAudiences, "api-audiences", o.APIAudiences, ""+
39-
"Identifiers of the API. This can be used as an additional list of "+
40-
"identifiers that exist in the target audiences of requests when "+
41-
"authenticating with OIDC.")
42-
4337
fs.StringVar(&o.IssuerURL, "oidc-issuer-url", o.IssuerURL, ""+
4438
"The URL of the OpenID issuer, only HTTPS scheme will be accepted.")
4539

cmd/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func buildRunCommand(stopCh <-chan struct{}, opts *options.Options) *cobra.Comma
9191
}
9292

9393
// Create a fake JWT to set up readiness probe
94-
fakeJWT, err := util.FakeJWT(opts.OIDCAuthentication.IssuerURL, opts.OIDCAuthentication.APIAudiences)
94+
fakeJWT, err := util.FakeJWT(opts.OIDCAuthentication.IssuerURL)
9595
if err != nil {
9696
return err
9797
}

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ go 1.13
55
require (
66
github.com/golang/mock v1.2.0
77
github.com/heptiolabs/healthcheck v0.0.0-20180807145615-6ff867650f40
8-
github.com/onsi/ginkgo v1.10.1
8+
github.com/onsi/ginkgo v1.11.0
99
github.com/onsi/gomega v1.7.0
1010
github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35
1111
github.com/sirupsen/logrus v1.4.2
1212
github.com/spf13/cobra v0.0.5
1313
github.com/spf13/pflag v1.0.5
1414
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
1515
gopkg.in/square/go-jose.v2 v2.3.1
16-
k8s.io/api v0.17.0
17-
k8s.io/apimachinery v0.17.0
18-
k8s.io/apiserver v0.17.0
19-
k8s.io/cli-runtime v0.17.0
20-
k8s.io/client-go v0.17.0
21-
k8s.io/component-base v0.17.0
16+
k8s.io/api v0.18.0
17+
k8s.io/apimachinery v0.18.0
18+
k8s.io/apiserver v0.18.0
19+
k8s.io/cli-runtime v0.18.0
20+
k8s.io/client-go v0.18.0
21+
k8s.io/component-base v0.18.0
2222
k8s.io/klog v1.0.0
2323
sigs.k8s.io/kind v0.7.0
2424
)

go.sum

Lines changed: 52 additions & 18 deletions
Large diffs are not rendered by default.

pkg/probe/probe_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestRun(t *testing.T) {
3838
t.FailNow()
3939
}
4040

41-
fakeJWT, err := util.FakeJWT("issuer", nil)
41+
fakeJWT, err := util.FakeJWT("issuer")
4242
if err != nil {
4343
t.Error(err.Error())
4444
t.FailNow()

pkg/proxy/proxy.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func New(restConfig *rest.Config,
8080

8181
// generate tokenAuther from oidc config
8282
tokenAuther, err := oidc.New(oidc.Options{
83-
APIAudiences: oidcOptions.APIAudiences,
8483
CAFile: oidcOptions.CAFile,
8584
ClientID: oidcOptions.ClientID,
8685
GroupsClaim: oidcOptions.GroupsClaim,

pkg/proxy/tokenreview/fake/tokenreview.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66

77
authv1 "k8s.io/api/authentication/v1"
8+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
89
clientauthv1 "k8s.io/client-go/kubernetes/typed/authentication/v1"
910
)
1011

@@ -22,7 +23,7 @@ func New() *FakeReviewer {
2223
}
2324
}
2425

25-
func (f *FakeReviewer) Create(req *authv1.TokenReview) (*authv1.TokenReview, error) {
26+
func (f *FakeReviewer) Create(ctx context.Context, req *authv1.TokenReview, co metav1.CreateOptions) (*authv1.TokenReview, error) {
2627
return f.CreateFn(req)
2728
}
2829

pkg/proxy/tokenreview/tokenreview.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
package tokenreview
33

44
import (
5+
"context"
56
"errors"
67
"fmt"
78
"net/http"
9+
"time"
810

911
authv1 "k8s.io/api/authentication/v1"
12+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1013
"k8s.io/client-go/kubernetes"
1114
clientauthv1 "k8s.io/client-go/kubernetes/typed/authentication/v1"
1215
"k8s.io/client-go/rest"
@@ -39,7 +42,10 @@ func (t *TokenReview) Review(req *http.Request) (bool, error) {
3942

4043
review := t.buildReview(token)
4144

42-
resp, err := t.reviewRequester.Create(review)
45+
ctx, cancel := context.WithTimeout(req.Context(), time.Second*10)
46+
defer cancel()
47+
48+
resp, err := t.reviewRequester.Create(ctx, review, metav1.CreateOptions{})
4349
if err != nil {
4450
return false, err
4551
}

pkg/util/pods.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
package util
33

44
import (
5+
"context"
56
"fmt"
67
"time"
78

@@ -15,7 +16,7 @@ func WaitForPodReady(kubeclient *kubernetes.Clientset,
1516
i := 0
1617

1718
for {
18-
pod, err := kubeclient.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{})
19+
pod, err := kubeclient.CoreV1().Pods(namespace).Get(context.Background(), name, metav1.GetOptions{})
1920
if err != nil {
2021
return err
2122
}

pkg/util/token.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func ParseTokenFromRequest(req *http.Request) (string, bool) {
3939
// fakeJWT generates a valid JWT using the passed input parameters which is
4040
// signed by a generated key. This is useful for checking the status of a
4141
// signer.
42-
func FakeJWT(issuerURL string, apiAudiences []string) (string, error) {
42+
func FakeJWT(issuerURL string) (string, error) {
4343
key := []byte("secret")
4444

4545
sig, err := jose.NewSigner(
@@ -53,7 +53,7 @@ func FakeJWT(issuerURL string, apiAudiences []string) (string, error) {
5353
Subject: "fake",
5454
Issuer: issuerURL,
5555
NotBefore: jwt.NewNumericDate(time.Date(2016, 1, 1, 0, 0, 0, 0, time.UTC)),
56-
Audience: jwt.Audience(apiAudiences),
56+
Audience: jwt.Audience(nil),
5757
}
5858

5959
return jwt.Signed(sig).Claims(cl).CompactSerialize()

0 commit comments

Comments
 (0)