qontract-reconcile 0.10.1rc1174__py3-none-any.whl → 0.10.1rc1175__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.1rc1174
3
+ Version: 0.10.1rc1175
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
@@ -200,7 +200,7 @@ reconcile/external_resources/manager.py,sha256=fXUm09w-9FRWYfJAwtV4_td1UHNLzdoGh
200
200
  reconcile/external_resources/meta.py,sha256=noaytFzmShpzLA_ebGh7wuP45mOfHIOnnoUxivjDa1I,672
201
201
  reconcile/external_resources/metrics.py,sha256=nMbyonGZEJDD1lYzpQY2eR9TNwvxYC4ZCcpi6wrExcM,1037
202
202
  reconcile/external_resources/model.py,sha256=H3elpiqehg_jACy28fGV5_77n8gKclVO77-7cfbaMNA,9178
203
- reconcile/external_resources/reconciler.py,sha256=Lhzg0O9Sw65KrCae-J14g9PV82xdp29O4jS_T5YNgEY,9661
203
+ reconcile/external_resources/reconciler.py,sha256=K9QvbQCIOCuOHnPIxQE_P_jFtrkF3dGo8d_cCCh08Ys,8973
204
204
  reconcile/external_resources/secrets_sync.py,sha256=6n0oDPLjd9Ql0lf6zsr1AZw8A6EEe3yCzl20XodtgkE,16229
205
205
  reconcile/external_resources/state.py,sha256=z086bnIUTOkzFmQvS9rSAhFsM3Aw_9PLKHBACJ-0tQc,9690
206
206
  reconcile/glitchtip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -880,8 +880,8 @@ tools/test/test_qontract_cli.py,sha256=iuzKbQ6ahinvjoQmQLBrG4shey0z-1rB6qCgS8T6d
880
880
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
881
881
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
882
882
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
883
- qontract_reconcile-0.10.1rc1174.dist-info/METADATA,sha256=nGXeRAgYgcd6_bkiscOuIN-r-nFHkwRnk3kMa1yd_wg,2213
884
- qontract_reconcile-0.10.1rc1174.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
885
- qontract_reconcile-0.10.1rc1174.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
886
- qontract_reconcile-0.10.1rc1174.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
887
- qontract_reconcile-0.10.1rc1174.dist-info/RECORD,,
883
+ qontract_reconcile-0.10.1rc1175.dist-info/METADATA,sha256=W7cOYjf2juRnK6QmkGQqjd_MG3Sft1hMo5imMLED1qo,2213
884
+ qontract_reconcile-0.10.1rc1175.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
885
+ qontract_reconcile-0.10.1rc1175.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
886
+ qontract_reconcile-0.10.1rc1175.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
887
+ qontract_reconcile-0.10.1rc1175.dist-info/RECORD,,
@@ -21,6 +21,7 @@ from kubernetes.client import (
21
21
  from pydantic import BaseModel
22
22
 
23
23
  from reconcile.external_resources.model import (
24
+ Action,
24
25
  Reconciliation,
25
26
  )
26
27
  from reconcile.external_resources.state import ReconcileStatus
@@ -88,6 +89,75 @@ class ReconciliationK8sJob(K8sJob, BaseModel, frozen=True):
88
89
  }
89
90
 
90
91
  def job_spec(self) -> V1JobSpec:
92
+ job_container = V1Container(
93
+ name="job",
94
+ image=self.reconciliation.module_configuration.image_version,
95
+ image_pull_policy="Always",
96
+ env=[
97
+ V1EnvVar(
98
+ name="DRY_RUN",
99
+ value=str(self.is_dry_run),
100
+ ),
101
+ V1EnvVar(
102
+ name="ACTION",
103
+ value=self.reconciliation.action.value,
104
+ ),
105
+ ],
106
+ volume_mounts=[
107
+ V1VolumeMount(
108
+ name="credentials",
109
+ mount_path="/credentials",
110
+ sub_path="credentials",
111
+ ),
112
+ V1VolumeMount(
113
+ name="workdir",
114
+ mount_path="/work",
115
+ ),
116
+ self.scripts_volume_mount("/inputs"),
117
+ ],
118
+ )
119
+ outputs_secret_container = V1Container(
120
+ name="outputs",
121
+ image=self.reconciliation.module_configuration.outputs_secret_image_version,
122
+ image_pull_policy="Always",
123
+ env=[
124
+ V1EnvVar(
125
+ name="NAMESPACE",
126
+ value_from=V1EnvVarSource(
127
+ field_ref=V1ObjectFieldSelector(field_path="metadata.namespace")
128
+ ),
129
+ ),
130
+ V1EnvVar(
131
+ name="ACTION",
132
+ value=self.reconciliation.action,
133
+ ),
134
+ V1EnvVar(
135
+ name="DRY_RUN",
136
+ value=str(self.is_dry_run),
137
+ ),
138
+ ],
139
+ volume_mounts=[
140
+ V1VolumeMount(
141
+ name="credentials",
142
+ mount_path="/.aws/credentials",
143
+ sub_path="credentials",
144
+ ),
145
+ V1VolumeMount(
146
+ name="workdir",
147
+ mount_path="/work",
148
+ ),
149
+ self.scripts_volume_mount("/inputs"),
150
+ ],
151
+ )
152
+
153
+ # For delete actions, we don't need to run the outputs_secrets container
154
+ if self.reconciliation.action == Action.APPLY:
155
+ init_containers = [job_container]
156
+ containers = [outputs_secret_container]
157
+ else:
158
+ init_containers = []
159
+ containers = [job_container]
160
+
91
161
  return V1JobSpec(
92
162
  backoff_limit=0,
93
163
  active_deadline_seconds=self.reconciliation.module_configuration.reconcile_timeout_minutes
@@ -98,72 +168,8 @@ class ReconciliationK8sJob(K8sJob, BaseModel, frozen=True):
98
168
  annotations=self.annotations(), labels=self.labels()
99
169
  ),
100
170
  spec=V1PodSpec(
101
- init_containers=[
102
- V1Container(
103
- name="job",
104
- image=self.reconciliation.module_configuration.image_version,
105
- image_pull_policy="Always",
106
- env=[
107
- V1EnvVar(
108
- name="DRY_RUN",
109
- value=str(self.is_dry_run),
110
- ),
111
- V1EnvVar(
112
- name="ACTION",
113
- value=self.reconciliation.action.value,
114
- ),
115
- ],
116
- volume_mounts=[
117
- V1VolumeMount(
118
- name="credentials",
119
- mount_path="/credentials",
120
- sub_path="credentials",
121
- ),
122
- V1VolumeMount(
123
- name="workdir",
124
- mount_path="/work",
125
- ),
126
- self.scripts_volume_mount("/inputs"),
127
- ],
128
- )
129
- ],
130
- containers=[
131
- V1Container(
132
- name="outputs",
133
- image=self.reconciliation.module_configuration.outputs_secret_image_version,
134
- image_pull_policy="Always",
135
- env=[
136
- V1EnvVar(
137
- name="NAMESPACE",
138
- value_from=V1EnvVarSource(
139
- field_ref=V1ObjectFieldSelector(
140
- field_path="metadata.namespace"
141
- )
142
- ),
143
- ),
144
- V1EnvVar(
145
- name="ACTION",
146
- value=self.reconciliation.action,
147
- ),
148
- V1EnvVar(
149
- name="DRY_RUN",
150
- value=str(self.is_dry_run),
151
- ),
152
- ],
153
- volume_mounts=[
154
- V1VolumeMount(
155
- name="credentials",
156
- mount_path="/.aws/credentials",
157
- sub_path="credentials",
158
- ),
159
- V1VolumeMount(
160
- name="workdir",
161
- mount_path="/work",
162
- ),
163
- self.scripts_volume_mount("/inputs"),
164
- ],
165
- )
166
- ],
171
+ init_containers=init_containers,
172
+ containers=containers,
167
173
  image_pull_secrets=[V1LocalObjectReference(name="quay.io")],
168
174
  volumes=[
169
175
  V1Volume(