Skip to content

Commit

Permalink
fixup! Add oauth env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Janelle Law committed Nov 22, 2021
1 parent c5f37d1 commit 468b012
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
36 changes: 36 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- get
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- get
- apiGroups:
- authentication.k8s.io
resources:
Expand All @@ -36,6 +50,28 @@ rules:
- get
- list
- update
- apiGroups:
- operator.cryostat.io
resources:
- cryostats
verbs:
- create
- get
- apiGroups:
- operator.cryostat.io
resources:
- flightrecorders
verbs:
- get
- apiGroups:
- operator.cryostat.io
resources:
- recordings
verbs:
- create
- delete
- get
- patch
- apiGroups:
- rbac.authorization.k8s.io
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ func NewCoreContainer(cr *operatorv1beta1.Cryostat, specs *ServiceSpecs, imageTa
Name: "CRYOSTAT_AUTH_MANAGER",
Value: "io.cryostat.net.OpenShiftAuthManager",
},
// OpenShift OAuth env vars
{
Name: "CRYOSTAT_OAUTH_CLIENT_ID",
Value: cr.Name,
Expand Down
17 changes: 8 additions & 9 deletions internal/test/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,14 @@ func NewCoreEnvironmentVariables(minimal bool, tls bool, externalTLS bool, opens
Name: "CRYOSTAT_CLIENTLIB_PATH",
Value: "/opt/cryostat.d/clientlib.d",
},
{
Name: "CRYOSTAT_OAUTH_CLIENT_ID",
Value: "cryostat-serviceaccount-name",
},
{
Name: "CRYOSTAT_OAUTH_ROLE",
Value: "cryostat-cluster-role",
},
}

if externalTLS {
Expand Down Expand Up @@ -871,15 +879,6 @@ func NewDatasourceEnvironmentVariables() []corev1.EnvVar {
}
}

func NewOAuthClientEnvironmentVariables() []corev1.EnvVar {
return []corev1.EnvVar{
{
Name: "CRYOSTAT_OAUTH_CLIENT_ID",
Value: "cryostat",
},
}
}

func NewCoreEnvFromSource(tls bool) []corev1.EnvFromSource {
envsFrom := []corev1.EnvFromSource{
{
Expand Down

0 comments on commit 468b012

Please sign in to comment.