qontract-reconcile 0.10.1rc518__py3-none-any.whl → 0.10.1rc519__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc518
3
+ Version: 0.10.1rc519
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -61,7 +61,7 @@ reconcile/ocm_machine_pools.py,sha256=eebJ6iiTdUcuKE5zBcfNxW1OGmPOvgBtmVu3xNVOoy
61
61
  reconcile/ocm_update_recommended_version.py,sha256=IYkfLXIprOW1jguZeELcGP1iBPuj-b53R-FTqKulMl8,4204
62
62
  reconcile/ocm_upgrade_scheduler_org_updater.py,sha256=ta8hMJ-su5mRcPpYrvB1COsojXV-SU3PzLPbQhy2Q0I,4190
63
63
  reconcile/openshift_base.py,sha256=7aifvl-ay5wpY6encbUX9pGbKdjiwJmevZ3XWGRzpCM,49696
64
- reconcile/openshift_cluster_bots.py,sha256=6L4eQuT76AmZGr-tN8hymqqCyCBgOj07nod-35PJtHw,10165
64
+ reconcile/openshift_cluster_bots.py,sha256=8cb-1j9ksIUxhfn_9oD--5YN9OznTCZky83MX8KgffM,10873
65
65
  reconcile/openshift_clusterrolebindings.py,sha256=QfSy1Ik8eEY5XObc1Q4xyhqyErZenJmbPv_u9wcDNNo,5864
66
66
  reconcile/openshift_groups.py,sha256=d-qGI1aUEpZZLZq7PuSnjVDgsy5EB063CQr2tNvYPCE,9419
67
67
  reconcile/openshift_limitranges.py,sha256=UvCGo_OQ4XoDK55TJmn55qEhhlkhLzhU12tX8nT5kPQ,3442
@@ -411,7 +411,7 @@ reconcile/test/test_ocm_machine_pools.py,sha256=3qo6t2Jfr1Wee0NUacyLTDmatp0o7CUN
411
411
  reconcile/test/test_ocm_update_recommended_version.py,sha256=iA4BVirTGVXlwcOyeR52IuNO81X_8NR6ZNd7ZFE7igs,4328
412
412
  reconcile/test/test_ocm_upgrade_scheduler_org_updater.py,sha256=zYRGUX7pAmxSv9oFYw2ZnPGa-YAPgDfmqXOJM4eE-8A,4353
413
413
  reconcile/test/test_openshift_base.py,sha256=uVsnMghAQhHaJTreeOw4x2INTKJ6qeiZiiteWeKflW8,33874
414
- reconcile/test/test_openshift_cluster_bots.py,sha256=GzwG73V-psL3qZ2R1ekiSWr9L6935eLduw7tls5KaUI,7928
414
+ reconcile/test/test_openshift_cluster_bots.py,sha256=-h1wDki9wh_WsNvNdPGuf-EjXP1MKWGRIIF9GcSuGjw,7928
415
415
  reconcile/test/test_openshift_namespace_labels.py,sha256=P1hqi6P88NijNrurdXG_QR2usyo3EYZSy9zpwYHvDsM,12104
416
416
  reconcile/test/test_openshift_namespaces.py,sha256=HmRnCE5EnFt3MYceVEFHmk8wWRtCrxu2AFGFkY9pdyA,9214
417
417
  reconcile/test/test_openshift_resource.py,sha256=lbTf48jX1q6rGnRiA5pPvfU0uPfY8zhNylMtryn0sLI,12995
@@ -668,8 +668,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
668
668
  tools/test/test_qontract_cli.py,sha256=d18KrdhtUGqoC7_kWZU128U0-VJEj-0rjFkLVufcI6I,2755
669
669
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
670
670
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
671
- qontract_reconcile-0.10.1rc518.dist-info/METADATA,sha256=ZHIKdYpB_uP2Zw1T7VGzb55Zemh_NrefQFPc8opTj4Q,2349
672
- qontract_reconcile-0.10.1rc518.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
673
- qontract_reconcile-0.10.1rc518.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
674
- qontract_reconcile-0.10.1rc518.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
675
- qontract_reconcile-0.10.1rc518.dist-info/RECORD,,
671
+ qontract_reconcile-0.10.1rc519.dist-info/METADATA,sha256=PkWYKrPAojcwXRY7Pu263rk2RvG9DyNwH8Tsqzg_JqA,2349
672
+ qontract_reconcile-0.10.1rc519.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
673
+ qontract_reconcile-0.10.1rc519.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
674
+ qontract_reconcile-0.10.1rc519.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
675
+ qontract_reconcile-0.10.1rc519.dist-info/RECORD,,
@@ -124,7 +124,11 @@ def retrieve_token(kubeconfig: str, namespace: str, sa: str) -> str:
124
124
 
125
125
 
126
126
  def create_sa(
127
- kubeconfig: str, namespace: str, sa: str, create_namespace: bool = False
127
+ kubeconfig: str,
128
+ namespace: str,
129
+ sa: str,
130
+ create_namespace: bool = False,
131
+ cluster_admin: bool = False,
128
132
  ) -> str:
129
133
  items: list[dict] = []
130
134
  if create_namespace:
@@ -159,6 +163,26 @@ def create_sa(
159
163
  "type": "kubernetes.io/service-account-token",
160
164
  },
161
165
  ])
166
+ if cluster_admin:
167
+ items.append({
168
+ "apiVersion": "rbac.authorization.k8s.io/v1",
169
+ "kind": "ClusterRoleBinding",
170
+ "metadata": {
171
+ "name": f"{namespace}-{sa}",
172
+ },
173
+ "roleRef": {
174
+ "apiGroup": "rbac.authorization.k8s.io",
175
+ "kind": "ClusterRole",
176
+ "name": "cluster-admin",
177
+ },
178
+ "subjects": [
179
+ {
180
+ "kind": "ServiceAccount",
181
+ "name": sa,
182
+ "namespace": namespace,
183
+ }
184
+ ],
185
+ })
162
186
 
163
187
  oc_apply(kubeconfig, namespace, items)
164
188
  token = retrieve_token(kubeconfig, namespace, sa)
@@ -200,6 +224,7 @@ def create_cluster_bots(
200
224
  config.cluster_admin_ns,
201
225
  config.cluster_admin_sa,
202
226
  create_namespace=True,
227
+ cluster_admin=True,
203
228
  )
204
229
  except subprocess.CalledProcessError as e:
205
230
  logging.error(e.stderr)
@@ -234,6 +234,6 @@ def test_run_cluster_admin(
234
234
  )
235
235
  mocks.oc.return_value = {"data": {"token": "mytoken"}}
236
236
  ocb.run(**integ_params)
237
- assert mocks.oc.call_count == 7
237
+ assert mocks.oc.call_count == 8
238
238
  mocks.vault.assert_called_once()
239
239
  mocks.submit_mr.assert_called_once()