From 339d9dd5f91b4ce701ad50ac241f99e55af70dc0 Mon Sep 17 00:00:00 2001 From: Ishan Gulhane <26394621+ishangulhane@users.noreply.github.com> Date: Wed, 29 Jan 2020 10:08:49 -0600 Subject: [PATCH] Update deployment yaml file (#39) * update deployment yaml file * fix spacing * fix spacing --- adapter/authserver/authserver.go | 6 +++--- adapter/authserver/keyset/keyset_test.go | 2 +- adapter/networking/networking.go | 2 +- helm/appidentityandaccessadapter/templates/deployment.yaml | 5 ++++- samples/app/sample-app.yaml | 5 ++++- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/adapter/authserver/authserver.go b/adapter/authserver/authserver.go index 5763491..86746f3 100644 --- a/adapter/authserver/authserver.go +++ b/adapter/authserver/authserver.go @@ -122,9 +122,9 @@ func (s *RemoteService) UserInfoEndpoint() string { // GetTokens performs a request to the token endpoint func (s *RemoteService) GetTokens(authnMethod string, clientID string, clientSecret string, authorizationCode string, redirectURI string, refreshToken string) (*TokenResponse, error) { _ = s.initialize() - form := url.Values{ - "client_id": {clientID}, - } + + form := url.Values{} + if refreshToken != "" { form.Add("grant_type", "refresh_token") form.Add("refresh_token", refreshToken) diff --git a/adapter/authserver/keyset/keyset_test.go b/adapter/authserver/keyset/keyset_test.go index 24f52c2..fd96f28 100644 --- a/adapter/authserver/keyset/keyset_test.go +++ b/adapter/authserver/keyset/keyset_test.go @@ -39,7 +39,7 @@ func TestNew(t *testing.T) { h := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { assert.Equal(t, req.URL.String(), "/publicKeys") - assert.Equal(t, req.Header.Get("xFilterType"), "IstioAdapter") + assert.Equal(t, req.Header.Get("x-filter-type"), "IstioAdapter") w.Write([]byte(e.res)) }) diff --git a/adapter/networking/networking.go b/adapter/networking/networking.go index 903237c..ce9ad2b 100644 --- a/adapter/networking/networking.go +++ b/adapter/networking/networking.go @@ -8,7 +8,7 @@ import ( ) const ( - filterType = "xFilterType" + filterType = "x-filter-type" istioAdapter = "IstioAdapter" defaultTimeout = 5 * time.Second ) diff --git a/helm/appidentityandaccessadapter/templates/deployment.yaml b/helm/appidentityandaccessadapter/templates/deployment.yaml index e60c299..ca172c4 100644 --- a/helm/appidentityandaccessadapter/templates/deployment.yaml +++ b/helm/appidentityandaccessadapter/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: dpl-{{ .Values.appName }} @@ -7,6 +7,9 @@ metadata: app: {{ .Values.appName }} spec: replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ .Values.appName }} template: metadata: labels: diff --git a/samples/app/sample-app.yaml b/samples/app/sample-app.yaml index 2daf9bb..c32d708 100644 --- a/samples/app/sample-app.yaml +++ b/samples/app/sample-app.yaml @@ -41,7 +41,7 @@ spec: number: 8000 host: svc-sample-app --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: dpl-sample-app @@ -50,6 +50,9 @@ metadata: app: sample-app spec: replicas: 1 + selector: + matchLabels: + app: sample-app template: metadata: labels: