Skip to content

Commit

Permalink
Update hooks. Forbid role-binding with a dash. (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhoherd authored and pgvishnuram committed May 20, 2024
1 parent 9101932 commit 601f41b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
exclude: '^(venv|\.vscode|tests/k8s_schema)' # regex
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.3.7"
rev: "v0.4.4"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --ignore, E501]
- repo: https://github.com/psf/black
rev: 24.4.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -59,6 +59,12 @@ repos:
- id: remove-unicode-zero-width-space
- repo: local
hooks:
- id: ensure-rolebinding-without-dash
language: pygrep
name: "Ensure we're using 'rolebinding' and not 'role-binding'"
entry: "role-binding"
pass_filenames: true
exclude: "^.pre-commit-config.yaml$"
- id: circle-config-yaml
name: Ensure .circleci/config.yml is up to date
language: python
Expand Down
4 changes: 2 additions & 2 deletions templates/dag-deploy/dag-deploy-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#################################
# dag-deploy-role-binding
# dag-deploy-rolebinding
#################################
{{- if .Values.dagDeploy.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
namespace: "{{ .Release.Namespace }}"
name: {{ .Release.Name }}-dag-server-role-binding
name: {{ .Release.Name }}-dag-server-rolebinding
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-dag-server
Expand Down
2 changes: 1 addition & 1 deletion templates/generate-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
annotations:
"helm.sh/hook": "pre-install,pre-upgrade"
"helm.sh/hook-weight": "-2"
name: {{ .Release.Name }}-create-secret-role-binding
name: {{ .Release.Name }}-create-secret-rolebinding
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-pgbouncer-ssl
Expand Down
2 changes: 1 addition & 1 deletion tests/chart/test_dag_deploy_rolebinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def test_dag_deploy_rolebinding_dag_server_enabled(self, kube_version):
doc = docs[0]
assert doc["kind"] == "RoleBinding"
assert doc["apiVersion"] == "rbac.authorization.k8s.io/v1"
assert doc["metadata"]["name"] == "release-name-dag-server-role-binding"
assert doc["metadata"]["name"] == "release-name-dag-server-rolebinding"

0 comments on commit 601f41b

Please sign in to comment.