Skip to content

Commit ff5fa6f

Browse files
authored
Refactor name (#9)
* Update README.md * Green test * renamed chart * ran make helm * update chart * Updated README * Fix deployment
1 parent 8e85af8 commit ff5fa6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+226
-227
lines changed

.github/workflows/test-build-update-helm.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- 'charts/openfga-operator/values.yaml'
9-
- 'charts/openfga-operator/Chart.yaml'
8+
- 'charts/fga-operator/values.yaml'
9+
- 'charts/fga-operator/Chart.yaml'
1010
pull_request:
1111
branches:
1212
- main
@@ -91,15 +91,15 @@ jobs:
9191
9292
- name: Update values.yaml
9393
run: |
94-
sed -i 's/tag: .*/tag: ${{ github.run_id }}/' charts/openfga-operator/values.yaml
94+
sed -i 's/tag: .*/tag: ${{ github.run_id }}/' charts/fga-operator/values.yaml
9595
9696
- name: Update Chart.yaml version
9797
run: |
98-
sed -i -E 's/(version: [0-9]+\.[0-9]+\.[0-9]+).*/\1-${{ github.run_id }}/' charts/openfga-operator/Chart.yaml
98+
sed -i -E 's/(version: [0-9]+\.[0-9]+\.[0-9]+).*/\1-${{ github.run_id }}/' charts/fga-operator/Chart.yaml
9999
100100
- name: Commit updated files
101101
run: |
102-
git add charts/openfga-operator/values.yaml charts/openfga-operator/Chart.yaml
102+
git add charts/fga-operator/values.yaml charts/fga-operator/Chart.yaml
103103
git commit -m "Update controllerManager.image.tag and chart version to ${{ github.run_id }}"
104104
105105
- name: Push changes
File renamed without changes.

charts/fga-operator/Chart.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
name: fga-operator
3+
description: |
4+
A Helm chart for deploying fga-operator on Kubernetes.
5+
The operator manages and automates the deployment,
6+
scaling, and maintenance of OpenFGA instances.
7+
type: application
8+
version: 0.1.0-9817780624
9+
appVersion: "0.1.0"

charts/openfga-operator/crds/authorizationmodel-crd.yaml charts/fga-operator/crds/authorizationmodel-crd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ kind: CustomResourceDefinition
33
metadata:
44
annotations:
55
controller-gen.kubebuilder.io/version: v0.14.0
6-
name: authorizationmodels.extensions.openfga-controller
6+
name: authorizationmodels.extensions.fga-controller
77
spec:
8-
group: extensions.openfga-controller
8+
group: extensions.fga-controller
99
names:
1010
kind: AuthorizationModel
1111
listKind: AuthorizationModelList

charts/openfga-operator/crds/authorizationmodelrequest-crd.yaml charts/fga-operator/crds/authorizationmodelrequest-crd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ kind: CustomResourceDefinition
33
metadata:
44
annotations:
55
controller-gen.kubebuilder.io/version: v0.14.0
6-
name: authorizationmodelrequests.extensions.openfga-controller
6+
name: authorizationmodelrequests.extensions.fga-controller
77
spec:
8-
group: extensions.openfga-controller
8+
group: extensions.fga-controller
99
names:
1010
kind: AuthorizationModelRequest
1111
listKind: AuthorizationModelRequestList

charts/openfga-operator/crds/store-crd.yaml charts/fga-operator/crds/store-crd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ kind: CustomResourceDefinition
33
metadata:
44
annotations:
55
controller-gen.kubebuilder.io/version: v0.14.0
6-
name: stores.extensions.openfga-controller
6+
name: stores.extensions.fga-controller
77
spec:
8-
group: extensions.openfga-controller
8+
group: extensions.fga-controller
99
names:
1010
kind: Store
1111
listKind: StoreList

charts/openfga-operator/templates/_helpers.tpl charts/fga-operator/templates/_helpers.tpl

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{/*
22
Expand the name of the chart.
33
*/}}
4-
{{- define "openfga-operator.name" -}}
4+
{{- define "fga-operator.name" -}}
55
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

@@ -10,7 +10,7 @@ Create a default fully qualified app name.
1010
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1111
If release name contains chart name it will be used as a full name.
1212
*/}}
13-
{{- define "openfga-operator.fullname" -}}
13+
{{- define "fga-operator.fullname" -}}
1414
{{- if .Values.fullnameOverride }}
1515
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
1616
{{- else }}
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
2626
{{/*
2727
Create chart name and version as used by the chart label.
2828
*/}}
29-
{{- define "openfga-operator.chart" -}}
29+
{{- define "fga-operator.chart" -}}
3030
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
3131
{{- end }}
3232

3333
{{/*
3434
Common labels
3535
*/}}
36-
{{- define "openfga-operator.labels" -}}
37-
helm.sh/chart: {{ include "openfga-operator.chart" . }}
38-
{{ include "openfga-operator.selectorLabels" . }}
36+
{{- define "fga-operator.labels" -}}
37+
helm.sh/chart: {{ include "fga-operator.chart" . }}
38+
{{ include "fga-operator.selectorLabels" . }}
3939
{{- if .Chart.AppVersion }}
4040
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4141
{{- end }}
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
4545
{{/*
4646
Selector labels
4747
*/}}
48-
{{- define "openfga-operator.selectorLabels" -}}
49-
app.kubernetes.io/name: {{ include "openfga-operator.name" . }}
48+
{{- define "fga-operator.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "fga-operator.name" . }}
5050
app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252

5353
{{/*
5454
Create the name of the service account to use
5555
*/}}
56-
{{- define "openfga-operator.serviceAccountName" -}}
56+
{{- define "fga-operator.serviceAccountName" -}}
5757
{{- if .Values.serviceAccount.create }}
58-
{{- default (include "openfga-operator.fullname" .) .Values.serviceAccount.name }}
58+
{{- default (include "fga-operator.fullname" .) .Values.serviceAccount.name }}
5959
{{- else }}
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}

charts/openfga-operator/templates/authorizationmodel-editor-rbac.yaml charts/fga-operator/templates/authorizationmodel-editor-rbac.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: {{ include "openfga-operator.fullname" . }}-authorizationmodel-editor-role
4+
name: {{ include "fga-operator.fullname" . }}-authorizationmodel-editor-role
55
labels:
6-
{{- include "openfga-operator.labels" . | nindent 4 }}
6+
{{- include "fga-operator.labels" . | nindent 4 }}
77
rules:
88
- apiGroups:
9-
- extensions.openfga-controller
9+
- extensions.fga-controller
1010
resources:
1111
- authorizationmodels
1212
verbs:
@@ -18,7 +18,7 @@ rules:
1818
- update
1919
- watch
2020
- apiGroups:
21-
- extensions.openfga-controller
21+
- extensions.fga-controller
2222
resources:
2323
- authorizationmodels/status
2424
verbs:

charts/openfga-operator/templates/authorizationmodel-viewer-rbac.yaml charts/fga-operator/templates/authorizationmodel-viewer-rbac.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: {{ include "openfga-operator.fullname" . }}-authorizationmodel-viewer-role
4+
name: {{ include "fga-operator.fullname" . }}-authorizationmodel-viewer-role
55
labels:
6-
{{- include "openfga-operator.labels" . | nindent 4 }}
6+
{{- include "fga-operator.labels" . | nindent 4 }}
77
rules:
88
- apiGroups:
9-
- extensions.openfga-controller
9+
- extensions.fga-controller
1010
resources:
1111
- authorizationmodels
1212
verbs:
1313
- get
1414
- list
1515
- watch
1616
- apiGroups:
17-
- extensions.openfga-controller
17+
- extensions.fga-controller
1818
resources:
1919
- authorizationmodels/status
2020
verbs:

charts/openfga-operator/templates/authorizationmodelrequest-editor-rbac.yaml charts/fga-operator/templates/authorizationmodelrequest-editor-rbac.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: {{ include "openfga-operator.fullname" . }}-authorizationmodelrequest-editor-role
4+
name: {{ include "fga-operator.fullname" . }}-authorizationmodelrequest-editor-role
55
labels:
6-
{{- include "openfga-operator.labels" . | nindent 4 }}
6+
{{- include "fga-operator.labels" . | nindent 4 }}
77
rules:
88
- apiGroups:
9-
- extensions.openfga-controller
9+
- extensions.fga-controller
1010
resources:
1111
- authorizationmodelrequests
1212
verbs:
@@ -18,7 +18,7 @@ rules:
1818
- update
1919
- watch
2020
- apiGroups:
21-
- extensions.openfga-controller
21+
- extensions.fga-controller
2222
resources:
2323
- authorizationmodelrequests/status
2424
verbs:

charts/openfga-operator/templates/authorizationmodelrequest-viewer-rbac.yaml charts/fga-operator/templates/authorizationmodelrequest-viewer-rbac.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: {{ include "openfga-operator.fullname" . }}-authorizationmodelrequest-viewer-role
4+
name: {{ include "fga-operator.fullname" . }}-authorizationmodelrequest-viewer-role
55
labels:
6-
{{- include "openfga-operator.labels" . | nindent 4 }}
6+
{{- include "fga-operator.labels" . | nindent 4 }}
77
rules:
88
- apiGroups:
9-
- extensions.openfga-controller
9+
- extensions.fga-controller
1010
resources:
1111
- authorizationmodelrequests
1212
verbs:
1313
- get
1414
- list
1515
- watch
1616
- apiGroups:
17-
- extensions.openfga-controller
17+
- extensions.fga-controller
1818
resources:
1919
- authorizationmodelrequests/status
2020
verbs:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: {{ include "fga-operator.fullname" . }}-authorizationmodel-editor-binding
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: {{ include "fga-operator.fullname" . }}-authorizationmodel-editor-role
9+
subjects:
10+
- kind: ServiceAccount
11+
name: {{ include "fga-operator.fullname" . }}-controller-manager
12+
namespace: {{ .Release.Namespace }}
13+
---
14+
apiVersion: rbac.authorization.k8s.io/v1
15+
kind: ClusterRoleBinding
16+
metadata:
17+
name: {{ include "fga-operator.fullname" . }}-authorizationmodel-viewer-binding
18+
roleRef:
19+
apiGroup: rbac.authorization.k8s.io
20+
kind: ClusterRole
21+
name: {{ include "fga-operator.fullname" . }}-authorizationmodel-viewer-role
22+
subjects:
23+
- kind: ServiceAccount
24+
name: {{ include "fga-operator.fullname" . }}-controller-manager
25+
namespace: {{ .Release.Namespace }}
26+
---
27+
apiVersion: rbac.authorization.k8s.io/v1
28+
kind: ClusterRoleBinding
29+
metadata:
30+
name: {{ include "fga-operator.fullname" . }}-store-editor-binding
31+
roleRef:
32+
apiGroup: rbac.authorization.k8s.io
33+
kind: ClusterRole
34+
name: {{ include "fga-operator.fullname" . }}-store-editor-role
35+
subjects:
36+
- kind: ServiceAccount
37+
name: {{ include "fga-operator.fullname" . }}-controller-manager
38+
namespace: {{ .Release.Namespace }}
39+
---
40+
apiVersion: rbac.authorization.k8s.io/v1
41+
kind: ClusterRoleBinding
42+
metadata:
43+
name: {{ include "fga-operator.fullname" . }}-store-viewer-binding
44+
roleRef:
45+
apiGroup: rbac.authorization.k8s.io
46+
kind: ClusterRole
47+
name: {{ include "fga-operator.fullname" . }}-store-viewer-role
48+
subjects:
49+
- kind: ServiceAccount
50+
name: {{ include "fga-operator.fullname" . }}-controller-manager
51+
namespace: {{ .Release.Namespace }}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: {{ include "openfga-operator.fullname" . }}-deployment-clusterrole
4+
name: {{ include "fga-operator.fullname" . }}-deployment-clusterrole
55
rules:
66
- apiGroups: ["apps"]
77
resources: ["deployments"]
@@ -10,12 +10,12 @@ rules:
1010
apiVersion: rbac.authorization.k8s.io/v1
1111
kind: ClusterRoleBinding
1212
metadata:
13-
name: {{ include "openfga-operator.fullname" . }}-deployment-clusterrolebinding
13+
name: {{ include "fga-operator.fullname" . }}-deployment-clusterrolebinding
1414
subjects:
1515
- kind: ServiceAccount
16-
name: {{ include "openfga-operator.fullname" . }}-controller-manager
16+
name: {{ include "fga-operator.fullname" . }}-controller-manager
1717
namespace: '{{ .Release.Namespace }}'
1818
roleRef:
1919
kind: ClusterRole
20-
name: {{ include "openfga-operator.fullname" . }}-deployment-clusterrole
20+
name: {{ include "fga-operator.fullname" . }}-deployment-clusterrole
2121
apiGroup: rbac.authorization.k8s.io

charts/openfga-operator/templates/deployment.yaml charts/fga-operator/templates/deployment.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: {{ include "openfga-operator.fullname" . }}-controller-manager
4+
name: {{ include "fga-operator.fullname" . }}-controller-manager
55
labels:
66
control-plane: controller-manager
7-
{{- include "openfga-operator.labels" . | nindent 4 }}
7+
{{- include "fga-operator.labels" . | nindent 4 }}
88
spec:
99
replicas: {{ .Values.controllerManager.replicas }}
1010
selector:
1111
matchLabels:
1212
control-plane: controller-manager
13-
{{- include "openfga-operator.selectorLabels" . | nindent 6 }}
13+
{{- include "fga-operator.selectorLabels" . | nindent 6 }}
1414
template:
1515
metadata:
1616
labels:
1717
control-plane: controller-manager
18-
{{- include "openfga-operator.selectorLabels" . | nindent 8 }}
18+
{{- include "fga-operator.selectorLabels" . | nindent 8 }}
1919
annotations:
2020
kubectl.kubernetes.io/default-container: manager
2121
spec:
@@ -53,5 +53,5 @@ spec:
5353
| nindent 10 }}
5454
securityContext:
5555
runAsNonRoot: true
56-
serviceAccountName: {{ include "openfga-operator.fullname" . }}-controller-manager
56+
serviceAccountName: {{ include "fga-operator.fullname" . }}-controller-manager
5757
terminationGracePeriodSeconds: 10

charts/openfga-operator/templates/leader-election-rbac.yaml charts/fga-operator/templates/leader-election-rbac.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: Role
33
metadata:
4-
name: {{ include "openfga-operator.fullname" . }}-leader-election-role
4+
name: {{ include "fga-operator.fullname" . }}-leader-election-role
55
labels:
6-
{{- include "openfga-operator.labels" . | nindent 4 }}
6+
{{- include "fga-operator.labels" . | nindent 4 }}
77
rules:
88
- apiGroups:
99
- ""
@@ -40,14 +40,14 @@ rules:
4040
apiVersion: rbac.authorization.k8s.io/v1
4141
kind: RoleBinding
4242
metadata:
43-
name: {{ include "openfga-operator.fullname" . }}-leader-election-rolebinding
43+
name: {{ include "fga-operator.fullname" . }}-leader-election-rolebinding
4444
labels:
45-
{{- include "openfga-operator.labels" . | nindent 4 }}
45+
{{- include "fga-operator.labels" . | nindent 4 }}
4646
roleRef:
4747
apiGroup: rbac.authorization.k8s.io
4848
kind: Role
49-
name: '{{ include "openfga-operator.fullname" . }}-leader-election-role'
49+
name: '{{ include "fga-operator.fullname" . }}-leader-election-role'
5050
subjects:
5151
- kind: ServiceAccount
52-
name: '{{ include "openfga-operator.fullname" . }}-controller-manager'
52+
name: '{{ include "fga-operator.fullname" . }}-controller-manager'
5353
namespace: '{{ .Release.Namespace }}'

0 commit comments

Comments
 (0)