qontract-reconcile 0.10.2.dev166__py3-none-any.whl → 0.10.2.dev167__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.
- {qontract_reconcile-0.10.2.dev166.dist-info → qontract_reconcile-0.10.2.dev167.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.2.dev166.dist-info → qontract_reconcile-0.10.2.dev167.dist-info}/RECORD +6 -6
- tools/cli_commands/erv2.py +61 -0
- tools/qontract_cli.py +4 -2
- {qontract_reconcile-0.10.2.dev166.dist-info → qontract_reconcile-0.10.2.dev167.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev166.dist-info → qontract_reconcile-0.10.2.dev167.dist-info}/entry_points.txt +0 -0
{qontract_reconcile-0.10.2.dev166.dist-info → qontract_reconcile-0.10.2.dev167.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.2.
|
3
|
+
Version: 0.10.2.dev167
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
|
6
6
|
Project-URL: repository, https://github.com/app-sre/qontract-reconcile
|
{qontract_reconcile-0.10.2.dev166.dist-info → qontract_reconcile-0.10.2.dev167.dist-info}/RECORD
RENAMED
@@ -777,12 +777,12 @@ tools/app_sre_tekton_access_reporter.py,sha256=o9prLUgQpwO3msRWc2as1xT1y9OB3znkp
|
|
777
777
|
tools/app_sre_tekton_access_revalidation.py,sha256=66nHEaY-bIqxIhpcmwN8AvQZu6ZXenfkg4Fut0pVZRM,2726
|
778
778
|
tools/glitchtip_access_reporter.py,sha256=o01A6b88t3Wie6tj_tJWWVo2J01LxQ_a9giGm4UzEaU,2901
|
779
779
|
tools/glitchtip_access_revalidation.py,sha256=PXN5wxl6OX8sxddPaakDF3X79nFLvpm-lz0mWLVelw0,2806
|
780
|
-
tools/qontract_cli.py,sha256=
|
780
|
+
tools/qontract_cli.py,sha256=rmR4aUIghazzRPoxTcKY2YCZWKmYqpvwhS-p-uoeL-4,157549
|
781
781
|
tools/sd_app_sre_alert_report.py,sha256=jQpJdXVID68bSNtJNOGDh0-ei1CfEUS4Itr4MAaBNFA,5062
|
782
782
|
tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
|
783
783
|
tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
784
784
|
tools/cli_commands/container_images_report.py,sha256=SXh6sZ1dXXzd-2R5eeBufCtW3J4-Y55--0MZLdo4lr8,5409
|
785
|
-
tools/cli_commands/erv2.py,sha256=
|
785
|
+
tools/cli_commands/erv2.py,sha256=WJgom7Fe2HuM31QKieYs_3evJuH7DEyd53sV-FKX7PU,26047
|
786
786
|
tools/cli_commands/gpg_encrypt.py,sha256=JWwds_Qg7KhSJMIGUh8TfI5-Jf17iUtmaEi4kWJxfVE,4907
|
787
787
|
tools/cli_commands/systems_and_tools.py,sha256=EMHOF1AtUDaoSk0bbjl6oUKYAz4rTZjIBaF-6E6GspM,16816
|
788
788
|
tools/cli_commands/cost_report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -804,7 +804,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
804
804
|
tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
|
805
805
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
806
806
|
tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
|
807
|
-
qontract_reconcile-0.10.2.
|
808
|
-
qontract_reconcile-0.10.2.
|
809
|
-
qontract_reconcile-0.10.2.
|
810
|
-
qontract_reconcile-0.10.2.
|
807
|
+
qontract_reconcile-0.10.2.dev167.dist-info/METADATA,sha256=gC7vJiajfAcAoktNwpvYbj0FZ0-Lje0pXtytx7-S-Tc,24627
|
808
|
+
qontract_reconcile-0.10.2.dev167.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
809
|
+
qontract_reconcile-0.10.2.dev167.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
|
810
|
+
qontract_reconcile-0.10.2.dev167.dist-info/RECORD,,
|
tools/cli_commands/erv2.py
CHANGED
@@ -123,6 +123,7 @@ class Erv2Cli:
|
|
123
123
|
m_inventory.get_from_spec(spec), spec, self._er_settings
|
124
124
|
)
|
125
125
|
)
|
126
|
+
self.module_type = m_inventory.get_from_spec(spec).module_type
|
126
127
|
self._resource = f.create_external_resource(spec, self._module_configuration)
|
127
128
|
f.validate_external_resource(self._resource, self._module_configuration)
|
128
129
|
|
@@ -221,6 +222,66 @@ class Erv2Cli:
|
|
221
222
|
print(e.stdout.decode("utf-8"))
|
222
223
|
raise
|
223
224
|
|
225
|
+
def build_terraform(self, credentials: Path) -> None:
|
226
|
+
input_file = self.temp / "input.json"
|
227
|
+
input_file.write_text(self.input_data)
|
228
|
+
tf_module = "tfmodule"
|
229
|
+
|
230
|
+
# delete previous ERv2 container
|
231
|
+
run(["docker", "rm", "-f", "erv2"], capture_output=True, check=True)
|
232
|
+
|
233
|
+
try:
|
234
|
+
with task(self.progress_spinner, "-- Running terraform"):
|
235
|
+
run(["docker", "pull", self.image], check=True)
|
236
|
+
run(
|
237
|
+
[
|
238
|
+
"docker",
|
239
|
+
"run",
|
240
|
+
"--name",
|
241
|
+
"erv2",
|
242
|
+
"-v",
|
243
|
+
f"{input_file!s}:/inputs/input.json:Z",
|
244
|
+
"-v",
|
245
|
+
f"{credentials!s}:/credentials:Z",
|
246
|
+
"-v",
|
247
|
+
f"{self.temp}:/work:Z",
|
248
|
+
"-e",
|
249
|
+
"AWS_SHARED_CREDENTIALS_FILE=/credentials",
|
250
|
+
"-e",
|
251
|
+
f"TERRAFORM_MODULE_WORK_DIR=/tmp/{tf_module}",
|
252
|
+
"-e",
|
253
|
+
"LOCAL_STATE=False",
|
254
|
+
self.image,
|
255
|
+
],
|
256
|
+
check=True,
|
257
|
+
capture_output=True,
|
258
|
+
)
|
259
|
+
|
260
|
+
with task(self.progress_spinner, "-- Copying the terraform module"):
|
261
|
+
run(
|
262
|
+
[
|
263
|
+
"docker",
|
264
|
+
"cp",
|
265
|
+
f"erv2:/tmp/{tf_module}",
|
266
|
+
str(self.temp),
|
267
|
+
],
|
268
|
+
check=True,
|
269
|
+
capture_output=True,
|
270
|
+
)
|
271
|
+
|
272
|
+
# move all assets to local workdir
|
273
|
+
src_dir = self.temp / tf_module
|
274
|
+
for item in src_dir.iterdir():
|
275
|
+
if item.name != ".terraform":
|
276
|
+
item.rename(self.temp / item.name)
|
277
|
+
|
278
|
+
except CalledProcessError as e:
|
279
|
+
if e.stderr:
|
280
|
+
print(e.stderr.decode("utf-8"))
|
281
|
+
if e.stdout:
|
282
|
+
print(e.stdout.decode("utf-8"))
|
283
|
+
raise
|
284
|
+
|
224
285
|
def enter_shell(self, credentials: Path) -> None:
|
225
286
|
"""Run the ERv2 container and enter the shell."""
|
226
287
|
input_file = self.temp / "input.json"
|
tools/qontract_cli.py
CHANGED
@@ -4381,8 +4381,10 @@ def migrate(ctx: click.Context, dry_run: bool, skip_build: bool) -> None:
|
|
4381
4381
|
|
4382
4382
|
with task(progress, "(erv2) Building the terraform configuration"):
|
4383
4383
|
if not skip_build:
|
4384
|
-
|
4385
|
-
|
4384
|
+
if erv2cli.module_type == "cdktf":
|
4385
|
+
erv2cli.build_cdktf(credentials_file)
|
4386
|
+
else:
|
4387
|
+
erv2cli.build_terraform(credentials_file)
|
4386
4388
|
erv2_tf_cli = TerraformCli(
|
4387
4389
|
temp_erv2, dry_run=dry_run, progress_spinner=progress
|
4388
4390
|
)
|
{qontract_reconcile-0.10.2.dev166.dist-info → qontract_reconcile-0.10.2.dev167.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|