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

Commit 4e88a00

Browse files
authored
Merge pull request #147 from JoshVanL/update-k8s-1.18
Updates Kubernetes discrepancies to v1.18
2 parents ca823e5 + 0deb0ac commit 4e88a00

File tree

27 files changed

+193
-184
lines changed

27 files changed

+193
-184
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
}

deploy/charts/kube-oidc-proxy/templates/deployment.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ spec:
5959
{{- if .Values.oidc.requiredClaims }}
6060
- "--oidc-signing-algs=$(OIDC_REQUIRED_CLAIMS)"
6161
{{ end }}
62-
{{- if .Values.oidc.apiAudiences }}
63-
- "--api-audiences=$(API_AUDIENCES)"
64-
{{ end }}
6562
{{- if .Values.tokenPassthrough.enabled }}
6663
- "--token-passthrough"
6764
{{- if .Values.tokenPassthrough.audiences }}
@@ -130,13 +127,6 @@ spec:
130127
name: {{ include "kube-oidc-proxy.fullname" . }}-config
131128
key: oidc.required-claims
132129
{{ end }}
133-
{{- if .Values.oidc.apiAudiences }}
134-
- name: API_AUDIENCES
135-
valueFrom:
136-
secretKeyRef:
137-
name: {{ include "kube-oidc-proxy.fullname" . }}-config
138-
key: api-audiences
139-
{{ end }}
140130
volumeMounts:
141131
{{- if .Values.oidc.caPEM }}
142132
- name: kube-oidc-proxy-config

deploy/charts/kube-oidc-proxy/templates/secret_config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ data:
2121
{{ if .Values.oidc.requiredClaims }}
2222
oidc.required-claims: {{ include "requiredClaims" . | b64enc }}
2323
{{- end }}
24-
{{- if .Values.oidc.apiAudiences -}}
25-
api-audiences: {{ join "," .Values.oidc.apiAudiences | b64enc }}
26-
{{- end }}
2724
kind: Secret
2825
metadata:
2926
name: {{ include "kube-oidc-proxy.fullname" . }}-config
3027
labels:
3128
{{ include "kube-oidc-proxy.labels" . | indent 4 }}
32-
type: Opaque
29+
type: Opaque

deploy/charts/kube-oidc-proxy/values.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ oidc:
3939
usernameClaim: ""
4040

4141
# PEM encoded value of CA cert that will verify TLS connection to
42-
# OIDC issuer URL. If not provided default hosts root CA's will be used.
42+
# OIDC issuer URL. If not provided, default hosts root CA's will be used.
4343
caPEM:
4444

4545
usernamePrefix:
@@ -49,7 +49,6 @@ oidc:
4949
signingAlgs:
5050
- RS256
5151
requiredClaims: {}
52-
apiAudiences: []
5352

5453
# To enable token passthrough feature
5554
# https://github.com/jetstack/kube-oidc-proxy/blob/master/docs/tasks/token-passthrough.md

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.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/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,

0 commit comments

Comments
 (0)