qontract-reconcile 0.10.2.dev401__py3-none-any.whl → 0.10.2.dev403__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.

Potentially problematic release.


This version of qontract-reconcile might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev401
3
+ Version: 0.10.2.dev403
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
@@ -53,7 +53,7 @@ Requires-Dist: sendgrid<6.5.0,>=6.4.8
53
53
  Requires-Dist: sentry-sdk~=2.0
54
54
  Requires-Dist: setuptools==80.8.0
55
55
  Requires-Dist: slack-sdk<4.0,>=3.10
56
- Requires-Dist: sretoolbox==2.7.0
56
+ Requires-Dist: sretoolbox==3.0.0
57
57
  Requires-Dist: sshtunnel>=0.4.0
58
58
  Requires-Dist: tabulate<0.9.0,>=0.8.6
59
59
  Requires-Dist: terrascript==0.9.0
@@ -192,7 +192,7 @@ reconcile/external_resources/manager.py,sha256=4UxcrJzgIDiVBClIhIbIAZ11yZ5a6YQW7
192
192
  reconcile/external_resources/meta.py,sha256=RM8qGE6UoJR58nLqABReIJrrdmx4Tqt_OcdlT-QygGs,620
193
193
  reconcile/external_resources/metrics.py,sha256=KiBjMUaN_z0cSkF_7Ar_a8RiuiwVqjyMcVdISlxhzXE,3898
194
194
  reconcile/external_resources/model.py,sha256=dDYTlMNL8vy07lquPnj_QXTGDK5punKSmP4fvbz83Uc,15021
195
- reconcile/external_resources/reconciler.py,sha256=wB8cB5pmqDJ1_t5_Aly4mrULGnI3OQaKqUZCB_Z9RWw,9573
195
+ reconcile/external_resources/reconciler.py,sha256=Ip84k-yL4-eHDkdT7BMwmou5jd5berIEkthqJWyWX_Q,9720
196
196
  reconcile/external_resources/secrets_sync.py,sha256=iz5qoyxFCCQ66EwiCy20ZiIurq8FEDHKOPpUhIkkMxk,16177
197
197
  reconcile/external_resources/state.py,sha256=6GTwsmEqDuKz8mSPJtVzGtzgwAWJgBiotH_2hfTYZHo,13451
198
198
  reconcile/fleet_labeler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -700,7 +700,7 @@ reconcile/utils/jinja2/filters.py,sha256=JfO_14APySBPidsMvHXG-8dULNPddZCE15Umjk_
700
700
  reconcile/utils/jinja2/utils.py,sha256=ScFapI-Qh9uUklMYoMSr_AKhzyMuMhF558RSUGBTaxE,9253
701
701
  reconcile/utils/jobcontroller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
702
702
  reconcile/utils/jobcontroller/controller.py,sha256=NBsmH8kKGrGIcQFtJI77kP2yYoYZiCmGY4AhbqBx1Es,15379
703
- reconcile/utils/jobcontroller/models.py,sha256=nfJ-w7DtDC5IZ5YD3YX8ytl61rnZUaa-Sbq3IjWEJwI,6296
703
+ reconcile/utils/jobcontroller/models.py,sha256=okj1zGdharGTJYW-f1XyvmWfp4F2ESTkvhYvrmzSGGE,6936
704
704
  reconcile/utils/membershipsources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
705
705
  reconcile/utils/membershipsources/app_interface_resolver.py,sha256=MqDFvK3aXhmmMuMiIygC-onFVrrIopKHriaYJQ5jnuY,1988
706
706
  reconcile/utils/membershipsources/models.py,sha256=yuEbG4HJ3NOEpSS9EH7OAx1U-uiRW-QmNMAZJe1Rb-U,1898
@@ -800,7 +800,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
800
800
  tools/saas_promotion_state/saas_promotion_state.py,sha256=uQv2QJAmUXP1g2GPIH30WTlvL9soY6m9lefpZEVDM5w,3965
801
801
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
802
802
  tools/sre_checkpoints/util.py,sha256=KcYVfa3UmJHVP_ocgrKe8NkrO5IDB9aWEDydSokPcRk,975
803
- qontract_reconcile-0.10.2.dev401.dist-info/METADATA,sha256=EXQ8eu_vCEO91oaoIE0tezpD2KSCqczZ_9ooJCH2_2E,24946
804
- qontract_reconcile-0.10.2.dev401.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
805
- qontract_reconcile-0.10.2.dev401.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
806
- qontract_reconcile-0.10.2.dev401.dist-info/RECORD,,
803
+ qontract_reconcile-0.10.2.dev403.dist-info/METADATA,sha256=J9syq10cvCdSVu54yWmY5g4xeigFcWBapp8Qlc61bsk,24946
804
+ qontract_reconcile-0.10.2.dev403.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
805
+ qontract_reconcile-0.10.2.dev403.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
806
+ qontract_reconcile-0.10.2.dev403.dist-info/RECORD,,
@@ -70,10 +70,13 @@ class ReconciliationK8sJob(K8sJob, BaseModel, frozen=True):
70
70
  dry_run_suffix: str = ""
71
71
 
72
72
  def name_prefix(self) -> str:
73
+ identifier = (
74
+ f"{self.reconciliation.key.provider}-{self.reconciliation.key.identifier}"
75
+ )
73
76
  if self.is_dry_run:
74
- return f"er-dry-run-mr-{self.dry_run_suffix}"
77
+ return f"er-dry-run-mr-{self.dry_run_suffix}-{identifier}"
75
78
  else:
76
- return "er"
79
+ return f"er-{identifier}"
77
80
 
78
81
  def unit_of_work_identity(self) -> Any:
79
82
  return self.reconciliation.key
@@ -38,6 +38,8 @@ class JobValidationError(Exception):
38
38
 
39
39
 
40
40
  JOB_GENERATION_ANNOTATION = "qontract-reconcile/job.generation"
41
+ MAX_JOB_NAME_LENGTH = 63
42
+ UNIT_OF_WORK_DIGEST_LENGTH = 10
41
43
 
42
44
 
43
45
  class K8sJob(ABC):
@@ -72,7 +74,21 @@ class K8sJob(ABC):
72
74
  """
73
75
 
74
76
  def name(self) -> str:
75
- return f"{self.name_prefix()}-{self.unit_of_work_digest()}"
77
+ """
78
+ Generate the full job name by combining the name prefix with a digest.
79
+
80
+ The name is constructed from the name_prefix (truncated to ensure total
81
+ length compliance) and the unit_of_work_digest. The total length is
82
+ limited to MAX_JOB_NAME_LENGTH (63 characters) to comply with Kubernetes
83
+ naming constraints.
84
+
85
+ Returns:
86
+ A unique job name in the format: {name_prefix}-{digest}
87
+ """
88
+ prefix = self.name_prefix()[
89
+ : MAX_JOB_NAME_LENGTH - UNIT_OF_WORK_DIGEST_LENGTH - 1
90
+ ]
91
+ return f"{prefix}-{self.unit_of_work_digest(UNIT_OF_WORK_DIGEST_LENGTH)}"
76
92
 
77
93
  @abstractmethod
78
94
  def name_prefix(self) -> str: