qontract-reconcile 0.10.2.dev187__py3-none-any.whl → 0.10.2.dev189__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.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev187
3
+ Version: 0.10.2.dev189
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
@@ -783,7 +783,7 @@ tools/app_sre_tekton_access_reporter.py,sha256=o9prLUgQpwO3msRWc2as1xT1y9OB3znkp
783
783
  tools/app_sre_tekton_access_revalidation.py,sha256=66nHEaY-bIqxIhpcmwN8AvQZu6ZXenfkg4Fut0pVZRM,2726
784
784
  tools/glitchtip_access_reporter.py,sha256=o01A6b88t3Wie6tj_tJWWVo2J01LxQ_a9giGm4UzEaU,2901
785
785
  tools/glitchtip_access_revalidation.py,sha256=PXN5wxl6OX8sxddPaakDF3X79nFLvpm-lz0mWLVelw0,2806
786
- tools/qontract_cli.py,sha256=pSN7UAWiI4lpOe_UHPWTBNG9adDLsJ5ZtcaIap0ChYg,157687
786
+ tools/qontract_cli.py,sha256=Y3f4VQSeA_vLzXPVjmOblnoPc5FlQVOgrVBVtFCVFeA,158986
787
787
  tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
788
788
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
789
789
  tools/cli_commands/container_images_report.py,sha256=SXh6sZ1dXXzd-2R5eeBufCtW3J4-Y55--0MZLdo4lr8,5409
@@ -809,7 +809,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
809
809
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
810
810
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
811
811
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
812
- qontract_reconcile-0.10.2.dev187.dist-info/METADATA,sha256=-iInkgy_ICSk6OCktOC27DWeGBEvZpYlsXpPFJ640IU,24555
813
- qontract_reconcile-0.10.2.dev187.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
814
- qontract_reconcile-0.10.2.dev187.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
815
- qontract_reconcile-0.10.2.dev187.dist-info/RECORD,,
812
+ qontract_reconcile-0.10.2.dev189.dist-info/METADATA,sha256=2hJPnXW-ZdwhTj_g9obkwaGtCxgY4xriSzLs9u1vlnA,24555
813
+ qontract_reconcile-0.10.2.dev189.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
814
+ qontract_reconcile-0.10.2.dev189.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
815
+ qontract_reconcile-0.10.2.dev189.dist-info/RECORD,,
tools/qontract_cli.py CHANGED
@@ -2112,12 +2112,40 @@ def quay_mirrors(ctx: click.Context) -> None:
2112
2112
 
2113
2113
  mirrors.append({
2114
2114
  "repo": f"quay.io/{org_name}/{name}",
2115
- "public": public,
2116
2115
  "upstream": url,
2116
+ "public": public,
2117
2117
  })
2118
2118
 
2119
- columns = ["repo", "upstream", "public"]
2120
- print_output(ctx.obj["options"], mirrors, columns)
2119
+ if ctx.obj["options"]["output"] == "md":
2120
+ json_table = {
2121
+ "filter": True,
2122
+ "fields": [
2123
+ {"key": "repo", "sortable": True},
2124
+ {"key": "upstream", "sortable": True},
2125
+ {"key": "public", "sortable": True},
2126
+ ],
2127
+ "items": mirrors,
2128
+ }
2129
+
2130
+ print(
2131
+ f"""
2132
+ You can view the source of this Markdown to extract the JSON data.
2133
+
2134
+ {len(mirrors)} mirror images found.
2135
+
2136
+ ```json:table
2137
+ {json.dumps(json_table)}
2138
+ ```
2139
+ """
2140
+ )
2141
+ else:
2142
+ columns = [
2143
+ "repo",
2144
+ "upstream",
2145
+ "public",
2146
+ ]
2147
+ ctx.obj["options"]["sort"] = False
2148
+ print_output(ctx.obj["options"], mirrors, columns)
2121
2149
 
2122
2150
 
2123
2151
  @get.command()
@@ -3142,8 +3170,6 @@ def container_image_details(ctx: click.Context) -> None:
3142
3170
  for org_items in app.quay_repos or []:
3143
3171
  org_name = org_items.org.name
3144
3172
  for repo in org_items.items or []:
3145
- if repo.mirror:
3146
- continue
3147
3173
  repository = f"quay.io/{org_name}/{repo.name}"
3148
3174
  item: dict[str, str | list[str]] = {
3149
3175
  "app": app_name,
@@ -3152,8 +3178,39 @@ def container_image_details(ctx: click.Context) -> None:
3152
3178
  "slack": slack,
3153
3179
  }
3154
3180
  data.append(item)
3155
- columns = ["app", "repository", "email", "slack"]
3156
- print_output(ctx.obj["options"], data, columns)
3181
+
3182
+ if ctx.obj["options"]["output"] == "md":
3183
+ json_table = {
3184
+ "filter": True,
3185
+ "fields": [
3186
+ {"key": "app", "sortable": True},
3187
+ {"key": "repository", "sortable": True},
3188
+ {"key": "email", "sortable": True},
3189
+ {"key": "slack", "sortable": True},
3190
+ ],
3191
+ "items": data,
3192
+ }
3193
+
3194
+ print(
3195
+ f"""
3196
+ You can view the source of this Markdown to extract the JSON data.
3197
+
3198
+ {len(data)} container images found.
3199
+
3200
+ ```json:table
3201
+ {json.dumps(json_table)}
3202
+ ```
3203
+ """
3204
+ )
3205
+ else:
3206
+ columns = [
3207
+ "app",
3208
+ "repository",
3209
+ "email",
3210
+ "slack",
3211
+ ]
3212
+ ctx.obj["options"]["sort"] = False
3213
+ print_output(ctx.obj["options"], data, columns)
3157
3214
 
3158
3215
 
3159
3216
  @get.command