qontract-reconcile 0.10.1rc1154__py3-none-any.whl → 0.10.1rc1156__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.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/RECORD +9 -9
- reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py +3 -1
- reconcile/quay_mirror.py +31 -13
- reconcile/test/test_quay_mirror.py +7 -14
- reconcile/utils/helpers.py +11 -0
- {qontract_reconcile-0.10.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc1156
|
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
|
{qontract_reconcile-0.10.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/RECORD
RENAMED
@@ -90,7 +90,7 @@ reconcile/openshift_users.py,sha256=63mar-swgidz8f10TCPJcofbMN9FETq-HuVFpi8dUL4,
|
|
90
90
|
reconcile/openshift_vault_secrets.py,sha256=9rTqV6wzCQx2Oh712E_Xj8wMG7u8Oh-pY8DWjlv4mZw,1660
|
91
91
|
reconcile/quay_base.py,sha256=h5xNjb7EZm8L2JgpO42r6w0UA4im5dabZXJSIW69zKU,1987
|
92
92
|
reconcile/quay_membership.py,sha256=YDLY7ayDsatEpYCe_iMdf3pkvrbmN8mAwrDKUJUa4Lg,6260
|
93
|
-
reconcile/quay_mirror.py,sha256=
|
93
|
+
reconcile/quay_mirror.py,sha256=mFp4Z5Nwl-DcFbbsJBOB8f9ldohFT-V67o868d5ux1s,15369
|
94
94
|
reconcile/quay_mirror_org.py,sha256=utrJpJaKCs7U6WX6DODdfCeB0EmX-lUC8Y5fkmpgFSs,10764
|
95
95
|
reconcile/quay_permissions.py,sha256=9KOutS1w4RFQqkvMSy54VtsKNx56-phzP6yI_rEW-B8,4244
|
96
96
|
reconcile/quay_repos.py,sha256=cuEYG0HUe0ut5yvLdEwOF5-CmccpXQHRb_wDazvDrvQ,6895
|
@@ -400,7 +400,7 @@ reconcile/gql_definitions/terraform_repo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
|
|
400
400
|
reconcile/gql_definitions/terraform_repo/terraform_repo.py,sha256=nm4CH7Vog4aabdvCKmhVSUvoUb7dxSLx8nwAEJAVqG0,3706
|
401
401
|
reconcile/gql_definitions/terraform_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
402
402
|
reconcile/gql_definitions/terraform_resources/database_access_manager.py,sha256=yv0_YC-LmhaKD_gyGG3le1w5BtypBjlsO894-Zgdg4U,4813
|
403
|
-
reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py,sha256=
|
403
|
+
reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py,sha256=_man82NXH9Jw7OvgDiQCKiLDG6Q7aV_ktOAi12QCXbI,42793
|
404
404
|
reconcile/gql_definitions/terraform_tgw_attachments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
405
405
|
reconcile/gql_definitions/terraform_tgw_attachments/aws_accounts.py,sha256=FPyPEikpkZ_kvHfXqnkzSUDNmxMMTiUwhI-eLQtuIHM,2616
|
406
406
|
reconcile/gql_definitions/unleash_feature_toggles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -549,7 +549,7 @@ reconcile/test/test_openshift_tekton_resources.py,sha256=O6-qPQwSiPHQKm1a1iqRU2V
|
|
549
549
|
reconcile/test/test_openshift_upgrade_watcher.py,sha256=0GDQ_YFHIX8DbkbDYSuLv9uZeeg4NwP1vlOqvSaZvN4,7183
|
550
550
|
reconcile/test/test_prometheus_rules_tester.py,sha256=cgVkPM3KcAw69bOkJ6iR2Lfog_WgblyoqVRtXv4ly7o,5685
|
551
551
|
reconcile/test/test_quay_membership.py,sha256=e29Giz5S9ckFgjpTO8PBo8qVPocIQmy4WqsRhgTFd9A,2643
|
552
|
-
reconcile/test/test_quay_mirror.py,sha256=
|
552
|
+
reconcile/test/test_quay_mirror.py,sha256=9TIu1-YQl0CG705m-FeEOs4OwKG3UVJzVhISw525Lco,6324
|
553
553
|
reconcile/test/test_quay_mirror_org.py,sha256=67XwB0WkqO6l9SeR9cSfjODyt-P587Kvqvam7hR8rLQ,3008
|
554
554
|
reconcile/test/test_quay_repos.py,sha256=TdkcRF_a8PLp01Kti9eZZN-vGup2yPBT4Iba3k08qe0,1810
|
555
555
|
reconcile/test/test_queries.py,sha256=SpH3RmNpBjEr_ne3VjAMCgKK8RE1z1zo7bypkT5uoO4,1946
|
@@ -683,7 +683,7 @@ reconcile/utils/gpg.py,sha256=EKG7_fdMv8BMlV5yUdPiqoTx-KrzmVSEAl2sLkaKwWI,1123
|
|
683
683
|
reconcile/utils/gql.py,sha256=C0thIm_k9MBldfqwHzyqtYZk9sIvMdm9IbbnXLGwjD8,14158
|
684
684
|
reconcile/utils/grouping.py,sha256=vr9SFHZ7bqmHYrvYcEZt-Er3-yQYfAAdq5sHLZVmXPY,456
|
685
685
|
reconcile/utils/helm.py,sha256=hr4J_9mBZwbc1FDNfFh4QKAj0h3eLxyTN2Y3UxIRp8U,3893
|
686
|
-
reconcile/utils/helpers.py,sha256=
|
686
|
+
reconcile/utils/helpers.py,sha256=womAD2bKPUAFOjHvNPAe_2Hsb-oVTxuQiYPGeR-Thp0,1772
|
687
687
|
reconcile/utils/imap_client.py,sha256=h8YDiCSCvroErhpH_-KGYI7Y2WU2Q2oSpuxDFbOkSbY,1989
|
688
688
|
reconcile/utils/instrumented_wrappers.py,sha256=eVwMoa6FCrYxLv3RML3WpZF9qKVfCTjMxphgVXG03OM,1073
|
689
689
|
reconcile/utils/jenkins_api.py,sha256=RaKuZmO7_lbI-hE6c_Pq2a6CQdmBVj7BcP2jR68cIbI,7081
|
@@ -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.
|
884
|
-
qontract_reconcile-0.10.
|
885
|
-
qontract_reconcile-0.10.
|
886
|
-
qontract_reconcile-0.10.
|
887
|
-
qontract_reconcile-0.10.
|
883
|
+
qontract_reconcile-0.10.1rc1156.dist-info/METADATA,sha256=D2tqUXy5_zzyo4jVzyKqbx6mHDHX_0yyZPFCfmavdUo,2213
|
884
|
+
qontract_reconcile-0.10.1rc1156.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
885
|
+
qontract_reconcile-0.10.1rc1156.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
|
886
|
+
qontract_reconcile-0.10.1rc1156.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
887
|
+
qontract_reconcile-0.10.1rc1156.dist-info/RECORD,,
|
@@ -134,6 +134,7 @@ query TerraformResourcesNamespaces {
|
|
134
134
|
overrides
|
135
135
|
output_resource_name
|
136
136
|
annotations
|
137
|
+
managed_by_erv2
|
137
138
|
}
|
138
139
|
... on NamespaceTerraformResourceServiceAccount_v1 {
|
139
140
|
identifier
|
@@ -600,6 +601,7 @@ class NamespaceTerraformResourceElastiCacheV1(NamespaceTerraformResourceAWSV1):
|
|
600
601
|
overrides: Optional[str] = Field(..., alias="overrides")
|
601
602
|
output_resource_name: Optional[str] = Field(..., alias="output_resource_name")
|
602
603
|
annotations: Optional[str] = Field(..., alias="annotations")
|
604
|
+
managed_by_erv2: Optional[bool] = Field(..., alias="managed_by_erv2")
|
603
605
|
|
604
606
|
|
605
607
|
class ClusterV1(ConfiguredBaseModel):
|
@@ -1017,7 +1019,7 @@ class NamespaceTerraformResourceMskV1(NamespaceTerraformResourceAWSV1):
|
|
1017
1019
|
|
1018
1020
|
|
1019
1021
|
class NamespaceTerraformProviderResourceAWSV1(NamespaceExternalResourceV1):
|
1020
|
-
resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceASGV1,
|
1022
|
+
resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceASGV1, NamespaceTerraformResourceElastiCacheV1, NamespaceTerraformResourceSNSTopicV1, NamespaceTerraformResourceServiceAccountV1, NamespaceTerraformResourceS3SQSV1, NamespaceTerraformResourceCloudWatchV1, NamespaceTerraformResourceRosaAuthenticatorVPCEV1, NamespaceTerraformResourceMskV1, NamespaceTerraformResourceS3CloudFrontV1, NamespaceTerraformResourceKMSV1, NamespaceTerraformResourceElasticSearchV1, NamespaceTerraformResourceACMV1, NamespaceTerraformResourceKinesisV1, NamespaceTerraformResourceRoute53ZoneV1, NamespaceTerraformResourceSQSV1, NamespaceTerraformResourceDynamoDBV1, NamespaceTerraformResourceECRV1, NamespaceTerraformResourceS3CloudFrontPublicKeyV1, NamespaceTerraformResourceSecretsManagerV1, NamespaceTerraformResourceSecretsManagerServiceAccountV1, NamespaceTerraformResourceAWSV1]] = Field(..., alias="resources")
|
1021
1023
|
|
1022
1024
|
|
1023
1025
|
class EnvironmentV1(ConfiguredBaseModel):
|
reconcile/quay_mirror.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import logging
|
2
2
|
import os
|
3
|
-
import re
|
4
3
|
import sys
|
5
4
|
import tempfile
|
6
5
|
import time
|
@@ -29,6 +28,7 @@ from reconcile.utils import (
|
|
29
28
|
metrics,
|
30
29
|
sharding,
|
31
30
|
)
|
31
|
+
from reconcile.utils.helpers import match_patterns
|
32
32
|
from reconcile.utils.instrumented_wrappers import InstrumentedImage as Image
|
33
33
|
from reconcile.utils.instrumented_wrappers import InstrumentedSkopeo as Skopeo
|
34
34
|
from reconcile.utils.secret_reader import SecretReader
|
@@ -205,20 +205,38 @@ class QuayMirror:
|
|
205
205
|
return summary
|
206
206
|
|
207
207
|
@staticmethod
|
208
|
-
def sync_tag(
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
208
|
+
def sync_tag(
|
209
|
+
tags: Iterable[str] | None,
|
210
|
+
tags_exclude: Iterable[str] | None,
|
211
|
+
candidate: str,
|
212
|
+
) -> bool:
|
213
|
+
"""
|
214
|
+
Determine if the candidate tag should sync, tags_exclude check take precedence.
|
215
|
+
:param tags: regex patterns to filter, match means to sync, None means no filter
|
216
|
+
:param tags_exclude: regex patterns to filter, match means not to sync, None means no filter
|
217
|
+
:param candidate: tag to check
|
218
|
+
:return: bool, True means to sync, False means not to sync
|
219
|
+
"""
|
220
|
+
if not tags and not tags_exclude:
|
217
221
|
return True
|
218
222
|
|
219
|
-
|
220
|
-
|
221
|
-
|
223
|
+
if not tags:
|
224
|
+
# only tags_exclude provided
|
225
|
+
assert tags_exclude # mypy can't infer not None
|
226
|
+
return not match_patterns(tags_exclude, candidate)
|
227
|
+
|
228
|
+
if not tags_exclude:
|
229
|
+
# only tags provided
|
230
|
+
return match_patterns(tags, candidate)
|
231
|
+
|
232
|
+
# both tags and tags_exclude provided
|
233
|
+
return not match_patterns(
|
234
|
+
tags_exclude,
|
235
|
+
candidate,
|
236
|
+
) and match_patterns(
|
237
|
+
tags,
|
238
|
+
candidate,
|
239
|
+
)
|
222
240
|
|
223
241
|
def process_sync_tasks(self):
|
224
242
|
if self.is_compare_tags:
|
@@ -96,22 +96,15 @@ class TestIsCompareTags:
|
|
96
96
|
(["^sha256-.+sig$", "^main-.+"], None, "main-755781cc", True),
|
97
97
|
(["^sha256-.+sig$", "^main-.+"], None, "sha256-8b5.sig", True),
|
98
98
|
(["^sha256-.+sig$", "^main-.+"], None, "1.2.3", False),
|
99
|
-
# Tags exclude tests.
|
99
|
+
# # Tags exclude tests.
|
100
100
|
(None, ["^sha256-.+sig$", "^main-.+"], "main-755781cc", False),
|
101
101
|
(None, ["^sha256-.+sig$", "^main-.+"], "sha256-8b5.sig", False),
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
),
|
109
|
-
(
|
110
|
-
["^sha256-.+sig$", "^main-.+"],
|
111
|
-
["^sha256-.+sig$", "^main-.+"],
|
112
|
-
"sha256-8b5.sig",
|
113
|
-
True,
|
114
|
-
),
|
102
|
+
(None, ["^sha256-.+sig$", "^main-.+"], "1.2.3", True),
|
103
|
+
# When both includes and excludes are explicitly given, exclude take precedence.
|
104
|
+
(["^sha256-.+sig$", "^main-.+"], ["main-755781cc"], "main-755781cc", False),
|
105
|
+
(["^sha256-.+sig$", "^main-.+"], ["main-755781cc"], "sha256-8b5.sig", True),
|
106
|
+
# both include and exclude are not set
|
107
|
+
(None, None, "main-755781cc", True),
|
115
108
|
],
|
116
109
|
)
|
117
110
|
def test_sync_tag(tags, tags_exclude, candidate, result):
|
reconcile/utils/helpers.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import logging
|
2
2
|
import random
|
3
|
+
import re
|
3
4
|
import string
|
4
5
|
from collections import Counter
|
5
6
|
from collections.abc import (
|
@@ -52,3 +53,13 @@ def generate_random_password(string_length: int = 20) -> str:
|
|
52
53
|
"""Generate a random string of letters and digits"""
|
53
54
|
letters_and_digits = string.ascii_letters + string.digits
|
54
55
|
return "".join(random.choices(letters_and_digits, k=string_length))
|
56
|
+
|
57
|
+
|
58
|
+
def match_patterns(patterns: Iterable[str], s: str) -> bool:
|
59
|
+
"""
|
60
|
+
Check if any pattern matches the string.
|
61
|
+
:param patterns: patterns to match
|
62
|
+
:param s: string to check
|
63
|
+
:return: True if any pattern matches, False otherwise
|
64
|
+
"""
|
65
|
+
return any(re.match(p, s) for p in patterns)
|
{qontract_reconcile-0.10.1rc1154.dist-info → qontract_reconcile-0.10.1rc1156.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|