mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-25 19:18:29 +03:00
Enable reserved variable name checks and fix violations (#12463)
* Enable reserved variable name checks and fix violations Updated .ansible-lint configuration to skip only var-naming[pattern] and var-naming[no-role-prefix] instead of skipping the entire var-naming rule. This enables the check for reserved variable names. Renamed variables that used reserved names to avoid conflicts. Updated all references in tasks, variables, and templates. Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com> * Rename namespace variable inside tasks instead of deleting it Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com> * Change hosts variable to vm_hosts Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com> * Use k8s_namespace instead of dashboard_namespace in dashboard.yml.j2 template Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com> --------- Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
This commit is contained in:
@@ -17,14 +17,14 @@
|
||||
#
|
||||
# Example usage: kubectl create -f <this_file>
|
||||
|
||||
{% if namespace != 'kube-system' %}
|
||||
{% if k8s_namespace != 'kube-system' %}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ namespace }}
|
||||
name: {{ k8s_namespace }}
|
||||
labels:
|
||||
name: {{ namespace }}
|
||||
name: {{ k8s_namespace }}
|
||||
{% endif %}
|
||||
---
|
||||
# ------------------- Dashboard Secrets ------------------- #
|
||||
@@ -118,7 +118,7 @@ roleRef:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kubernetes-dashboard
|
||||
namespace: {{ namespace }}
|
||||
namespace: {{ k8s_namespace }}
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
@@ -132,7 +132,7 @@ roleRef:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kubernetes-dashboard
|
||||
namespace: {{ namespace }}
|
||||
namespace: {{ k8s_namespace }}
|
||||
|
||||
---
|
||||
# ------------------- Dashboard Deployment ------------------- #
|
||||
@@ -173,7 +173,7 @@ spec:
|
||||
- containerPort: 8443
|
||||
protocol: TCP
|
||||
args:
|
||||
- --namespace={{ namespace }}
|
||||
- --namespace={{ k8s_namespace }}
|
||||
{% if dashboard_use_custom_certs %}
|
||||
- --tls-key-file={{ dashboard_tls_key_file }}
|
||||
- --tls-cert-file={{ dashboard_tls_cert_file }}
|
||||
|
||||
Reference in New Issue
Block a user