From 769401f93b330541ac4361d79c85b0a37f2b920b Mon Sep 17 00:00:00 2001 From: Shreyash kashid Date: Mon, 7 Sep 2026 11:37:33 +0530 Subject: [PATCH] Remove references to operator_service_account_name The operator_service_account_name variable is no longer used by any operator role or template. This commit removes: - The variable definition from roles/common/defaults/main.yml - The OPERATOR_SA_NAME env var from config/testing/manager_image.yaml - The molecule test variable override from molecule/kind/molecule.yml - The RBAC Role/RoleBinding test tasks from molecule/default/tasks/pulp_test.yml Fixes #50 --- config/testing/manager_image.yaml | 3 --- molecule/default/tasks/pulp_test.yml | 36 ---------------------------- molecule/kind/molecule.yml | 1 - roles/common/defaults/main.yml | 1 - 4 files changed, 41 deletions(-) diff --git a/config/testing/manager_image.yaml b/config/testing/manager_image.yaml index 88b4b482..76da8935 100644 --- a/config/testing/manager_image.yaml +++ b/config/testing/manager_image.yaml @@ -10,6 +10,3 @@ spec: containers: - name: galaxy-operator image: testing - env: - - name: OPERATOR_SA_NAME - value: osdk-sa diff --git a/molecule/default/tasks/pulp_test.yml b/molecule/default/tasks/pulp_test.yml index 252f8579..fca00a31 100644 --- a/molecule/default/tasks/pulp_test.yml +++ b/molecule/default/tasks/pulp_test.yml @@ -7,42 +7,6 @@ vars: cr_file: 'pulpproject_v1beta1_pulp_cr.molecule.ci.yaml' -- name: Create role to allow patch/get on "{{ operator_service_account_name }}" serviceaccount - k8s: - state: present - namespace: '{{ namespace }}' - definition: - apiVersion: rbac.authorization.k8s.io/v1 - kind: Role - metadata: - name: "{{ operator_service_account_name }}-role" - rules: - - apiGroups: - - "" - resourceNames: - - "{{ operator_service_account_name }}" - resources: - - serviceaccounts - verbs: - - patch - - get - -- name: Bind "{{ operator_service_account_name }}-role" to "{{ operator_service_account_name }}" serviceaccount - k8s: - state: present - namespace: '{{ namespace }}' - definition: - apiVersion: rbac.authorization.k8s.io/v1 - kind: RoleBinding - metadata: - name: "{{ operator_service_account_name }}-rolebinding" - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: "{{ operator_service_account_name }}-role" - subjects: - - kind: ServiceAccount - name: "{{ operator_service_account_name }}" - name: Wait 5m for database reconciliation to run k8s_info: diff --git a/molecule/kind/molecule.yml b/molecule/kind/molecule.yml index a6cc94c8..5791d9c8 100644 --- a/molecule/kind/molecule.yml +++ b/molecule/kind/molecule.yml @@ -28,7 +28,6 @@ provisioner: group_vars: all: namespace: ${TEST_OPERATOR_NAMESPACE:-osdk-test} - operator_service_account_name: osdk-sa host_vars: localhost: ansible_python_interpreter: '{{ ansible_playbook_python }}' diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml index ef2079bc..8a688f9c 100644 --- a/roles/common/defaults/main.yml +++ b/roles/common/defaults/main.yml @@ -1,7 +1,6 @@ --- image_pull_secret: '' image_pull_secrets: [] -operator_service_account_name: '{{ lookup("env","OPERATOR_SA_NAME") | default("galaxy-operator-sa",true) }}' bundle_cacert_secret: '' # Proxy environment variables for Galaxy containers.