Skip to content

Commit de34f2c

Browse files
jmickeyfoot
andauthored
chore: add additional CRB for auth-delegator, allows token validation (#1145)
* chore: add additional CRB for auth-delegator, allows token validation * chore: bump chart version * Update to weave-gitops with token checking * Fixes up interface change in weave-gitops Co-authored-by: Simon Howe <[email protected]> Co-authored-by: Simon <[email protected]>
1 parent 6cd73b5 commit de34f2c

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

charts/mccp/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.2.0
18+
version: 0.2.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: clusters-service-token-review
5+
namespace: {{ .Release.Namespace | quote }}
6+
roleRef:
7+
apiGroup: rbac.authorization.k8s.io
8+
kind: ClusterRole
9+
name: system:auth-delegator
10+
subjects:
11+
- kind: ServiceAccount
12+
name: {{ include "mccp.serviceAccountName" . }}
13+
namespace: {{ .Release.Namespace | quote }}

cmd/clusters-service/app/server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,11 @@ func StartServer(ctx context.Context, log logr.Logger, tempDir string, p Params)
347347
return err
348348
}
349349

350-
clientsFactoryScheme := kube.CreateScheme()
350+
clientsFactoryScheme, err := kube.CreateScheme()
351+
if err != nil {
352+
return fmt.Errorf("could not create scheme: %w", err)
353+
}
354+
351355
runtimeUtil.Must(pacv2beta1.AddToScheme(clientsFactoryScheme))
352356
runtimeUtil.Must(flaggerv1beta1.AddToScheme(clientsFactoryScheme))
353357
clusterClientsFactory := clustersmngr.NewClientFactory(

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/sirupsen/logrus v1.8.1
1616
github.com/spf13/cobra v1.5.0
1717
github.com/stretchr/testify v1.7.2
18-
github.com/weaveworks/weave-gitops v0.9.1-rc.1.0.20220720151155-47b9020ad0eb
18+
github.com/weaveworks/weave-gitops v0.9.1-rc.1.0.20220726110232-5aae702086e7
1919
github.com/weaveworks/weave-gitops-enterprise-credentials v0.0.2
2020
github.com/weaveworks/weave-gitops-enterprise/common v0.0.0
2121
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ github.com/weaveworks/policy-agent/api v1.0.4 h1:dznn4I3+tfSniNbERFaAXOMpLsvwW+6
10191019
github.com/weaveworks/policy-agent/api v1.0.4/go.mod h1:GbePwORMtByaPqKoD7xuY/oqdq8iagfh5R6NZS14+AA=
10201020
github.com/weaveworks/progressive-delivery v0.0.0-20220719161717-3318c52a96f8 h1:heu/YEkVgb+YKiX1e0iuxlSNkF395DMltyoWfQ+Lq/g=
10211021
github.com/weaveworks/progressive-delivery v0.0.0-20220719161717-3318c52a96f8/go.mod h1:DKROFoMYek6LRX/Us3W2Jb/VCjvqNduxhKz4E7hgq8c=
1022-
github.com/weaveworks/weave-gitops v0.9.1-rc.1.0.20220720151155-47b9020ad0eb h1:Cbj/xErhzJ+Ki1ZgVWZ/qdwFc6Z+RL0CG5WG8uedNwc=
1023-
github.com/weaveworks/weave-gitops v0.9.1-rc.1.0.20220720151155-47b9020ad0eb/go.mod h1:sJhdINlDBhO2SoRCH6h8Q0Op0qaPBUNfOptwEbqY/N0=
1022+
github.com/weaveworks/weave-gitops v0.9.1-rc.1.0.20220726110232-5aae702086e7 h1:DguFWWfDAuxyYO12almZplmbSL0ouhPjebbpyQzA7JA=
1023+
github.com/weaveworks/weave-gitops v0.9.1-rc.1.0.20220726110232-5aae702086e7/go.mod h1:prdoxOe8u1xjQkSx11BneBs58LGSYidSrXmNjfNEElk=
10241024
github.com/weaveworks/weave-gitops-enterprise-credentials v0.0.2 h1:7jeiQehqmI4ds6YIq8TW1Vqhlb6V7G2BVRJ8VM3r99I=
10251025
github.com/weaveworks/weave-gitops-enterprise-credentials v0.0.2/go.mod h1:6PMYg+VtSNePnP7EXyNG+/hNRNZ3r0mQtolIZU4s/J0=
10261026
github.com/xanzy/go-gitlab v0.58.0 h1:Entnl8GrVDlc1jd1BlOWhNR0QVQgiO3WDom5DJbT+1s=

0 commit comments

Comments
 (0)