diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 9e0b093..0b40b09 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -29,3 +29,4 @@ spec: - "--leader-election-id=gitea-operator" image: controller:latest terminationGracePeriodSeconds: 10 + serviceAccountName: gitea-operator-sa diff --git a/config/rbac/cluster_role_binding.yaml b/config/rbac/cluster_role_binding.yaml index 98f8782..dae9905 100644 --- a/config/rbac/cluster_role_binding.yaml +++ b/config/rbac/cluster_role_binding.yaml @@ -9,5 +9,4 @@ roleRef: name: manager-role subjects: - kind: ServiceAccount - name: default - namespace: system + name: sa diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index c86f13b..5ccdf5a 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -8,3 +8,4 @@ resources: - leader_election_role_binding.yaml - gitea_editor_role.yaml - gitea_viewer_role.yaml +- service_account.yaml diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index 2626b97..482a32c 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -8,5 +8,4 @@ roleRef: name: leader-election-role subjects: - kind: ServiceAccount - name: default - namespace: system + name: sa diff --git a/config/rbac/namespaced/kustomization.yaml b/config/rbac/namespaced/kustomization.yaml index b3c8b59..30ee59f 100644 --- a/config/rbac/namespaced/kustomization.yaml +++ b/config/rbac/namespaced/kustomization.yaml @@ -8,3 +8,4 @@ resources: - ../leader_election_role_binding.yaml - ../gitea_editor_role.yaml - ../gitea_viewer_role.yaml +- ../service_account.yaml diff --git a/config/rbac/namespaced/role_binding.yaml b/config/rbac/namespaced/role_binding.yaml index 80fddbe..29b426f 100644 --- a/config/rbac/namespaced/role_binding.yaml +++ b/config/rbac/namespaced/role_binding.yaml @@ -9,5 +9,4 @@ roleRef: name: manager-role subjects: - kind: ServiceAccount - name: default - namespace: system + name: sa diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml new file mode 100644 index 0000000..e222fcb --- /dev/null +++ b/config/rbac/service_account.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: sa diff --git a/config/testing/cluster_scope/kustomization.yaml b/config/testing/cluster_scope/kustomization.yaml index 99f6114..b90c3da 100644 --- a/config/testing/cluster_scope/kustomization.yaml +++ b/config/testing/cluster_scope/kustomization.yaml @@ -5,8 +5,8 @@ resources: - ../../rbac - ../../manager -namespace: osdk-test -namePrefix: osdk- +namespace: gitea-operator-test +namePrefix: gitea-operator- images: - name: testing diff --git a/config/testing/namespace_scope/kustomization.yaml b/config/testing/namespace_scope/kustomization.yaml index 210147e..baf9b16 100644 --- a/config/testing/namespace_scope/kustomization.yaml +++ b/config/testing/namespace_scope/kustomization.yaml @@ -5,8 +5,8 @@ resources: - ../../rbac/namespaced - ../../manager -namespace: osdk-test -namePrefix: osdk- +namespace: gitea-operator-test +namePrefix: gitea-operator- images: - name: testing diff --git a/roles/gitea-ocp/tasks/main.yml b/roles/gitea-ocp/tasks/main.yml index 45aaad3..700cbd8 100644 --- a/roles/gitea-ocp/tasks/main.yml +++ b/roles/gitea-ocp/tasks/main.yml @@ -41,9 +41,9 @@ namespace: "{{ _gitea_namespace }}" register: r_route until: - - (r_route.resources|length) > 0 - - r_route.resources[0].spec.host is defined - - r_route.resources[0].spec.host|length > 0 + - (r_route.resources|length) > 0 + - r_route.resources[0].spec.host is defined + - r_route.resources[0].spec.host|length > 0 - name: Store Gitea Route Hostname when: @@ -64,8 +64,8 @@ - name: Wait until application is available when: - - _gitea_state == "present" - - _gitea_wait_for_init|bool + - _gitea_state == "present" + - _gitea_wait_for_init|bool k8s_facts: api_version: apps/v1 kind: Deployment