qontract-reconcile 0.10.1rc624__py3-none-any.whl → 0.10.1rc626__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.1rc624
3
+ Version: 0.10.1rc626
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
@@ -102,7 +102,7 @@ reconcile/sendgrid_teammates.py,sha256=oO8QbLb4s1o8A6CGiCagN9CmS05BSS_WLztuY0Ym9
102
102
  reconcile/service_dependencies.py,sha256=PMKP9vc6oL-78rzyF_RE8DzLSQMSqN8vCqt9sWpBLAM,4470
103
103
  reconcile/signalfx_endpoint_monitoring.py,sha256=D1m8iq0EAKie0OD59FOcVCtpWWZ7xlo6lwBS9urwMIk,2894
104
104
  reconcile/slack_base.py,sha256=K3fSYx46G1djoPb07_C9j6ChhMCt5LgV5l6v2TFkNZk,3479
105
- reconcile/slack_usergroups.py,sha256=DCMz-dh8Gn4qxBwlZR_IyZd-r0bdm_AjVFfHxPWGpDM,27564
105
+ reconcile/slack_usergroups.py,sha256=XC7bYHP322EFWrEaR4Orw_sOoMFmuV3o08OC0UE4xLQ,27592
106
106
  reconcile/sql_query.py,sha256=qLTUU2Hc0BmJoSl9cCUsIfdEaEaOQp7y__E4KLjjcaA,25732
107
107
  reconcile/status.py,sha256=cY4IJFXemhxptRJqR4qaaOWqei9e4jgLXuVSGajMsjg,544
108
108
  reconcile/status_board.py,sha256=nA74_133jukxVShjPKJpkXOA3vggDTTEhYTegoXbN1M,8632
@@ -120,10 +120,10 @@ reconcile/vpc_peerings_validator.py,sha256=Kv22HJVlTW9l9GB2eXwjPWqdDbr_VuvQBNPtt
120
120
  reconcile/aus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
121
  reconcile/aus/advanced_upgrade_service.py,sha256=PkVcXBMrveW5euvqjEBO4e5-9KDb_6hszLI2GrWpx2w,21378
122
122
  reconcile/aus/aus_label_source.py,sha256=qoP8Fgxuu1tCuhG6ixCWve7Ll-KD6a79E2uLAmC0ifw,4184
123
- reconcile/aus/base.py,sha256=ESycSlsxNGjpy1v2G2NXB7WB6NMYrXCaN4kSVMicRKk,44462
123
+ reconcile/aus/base.py,sha256=N55Ci1XkV-VWnnc2hh0T2aDD95ZUJHM1ZCpWxF0CP6Q,44350
124
124
  reconcile/aus/cluster_version_data.py,sha256=j4UyEBi5mQuvPq5Lo7a_L_0blxvH790wJV07uAiikFU,7126
125
125
  reconcile/aus/metrics.py,sha256=fIew-rzi_kYuI5Gxn3-4bQVIr2oNibiKPyGnhB-xKU4,3538
126
- reconcile/aus/models.py,sha256=muBmbovxYtSNLFrTLVRcJYZ4dx6JLh8n3Q1-DjWJOHM,7098
126
+ reconcile/aus/models.py,sha256=XaRLgNj26E9eanFh-QbsyiKIa4rQSE80EdhC2I2e81o,7286
127
127
  reconcile/aus/ocm_addons_upgrade_scheduler_org.py,sha256=fshslI27hrqT40qrVsVOQaWxD-jkmzcVZryXzX7plhY,8960
128
128
  reconcile/aus/ocm_upgrade_scheduler.py,sha256=7cK2SakCFkl5EdnqUEAYdUo4pUnnf-SsUR10uytAGyE,3058
129
129
  reconcile/aus/ocm_upgrade_scheduler_org.py,sha256=OBgE5mnVdQQV4tMH0AE2V_PDt9Gy6d-LyuPceqjORts,2331
@@ -714,8 +714,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
714
714
  tools/test/test_qontract_cli.py,sha256=OvalpVRfY4pNmpMaWHHYqBjV68b1eGQjX8SCyTAXb1w,3501
715
715
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
716
716
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
717
- qontract_reconcile-0.10.1rc624.dist-info/METADATA,sha256=f2jsNwLW-UW50cmTiXXle1pTBOO105mJ3oQAndWpNDQ,2382
718
- qontract_reconcile-0.10.1rc624.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
719
- qontract_reconcile-0.10.1rc624.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
720
- qontract_reconcile-0.10.1rc624.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
721
- qontract_reconcile-0.10.1rc624.dist-info/RECORD,,
717
+ qontract_reconcile-0.10.1rc626.dist-info/METADATA,sha256=YEElB5dh2AcXSFH2tnKjN1Dk9c7E-9mxD3CzYjXqVLY,2382
718
+ qontract_reconcile-0.10.1rc626.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
719
+ qontract_reconcile-0.10.1rc626.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
720
+ qontract_reconcile-0.10.1rc626.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
721
+ qontract_reconcile-0.10.1rc626.dist-info/RECORD,,
reconcile/aus/base.py CHANGED
@@ -844,7 +844,7 @@ def verify_schedule_should_skip(
844
844
  def verify_lock_should_skip(
845
845
  desired: ClusterUpgradeSpec, locked: dict[str, str]
846
846
  ) -> bool:
847
- mutexes = desired.upgrade_policy.conditions.mutexes or []
847
+ mutexes = desired.effective_mutexes
848
848
  if any(lock in locked for lock in mutexes):
849
849
  locking = {lock: locked[lock] for lock in mutexes if lock in locked}
850
850
  logging.debug(
@@ -919,9 +919,9 @@ def calculate_diff(
919
919
  """
920
920
 
921
921
  def set_mutex(
922
- locked: dict[str, str], cluster_id: str, mutexes: Optional[list[str]] = None
922
+ locked: dict[str, str], cluster_id: str, mutexes: Optional[set[str]] = None
923
923
  ) -> None:
924
- for mutex in mutexes or []:
924
+ for mutex in mutexes or set():
925
925
  locked[mutex] = cluster_id
926
926
 
927
927
  diffs: list[UpgradePolicyHandler] = []
@@ -930,7 +930,7 @@ def calculate_diff(
930
930
  locked: dict[str, str] = {}
931
931
  for spec in desired_state.specs:
932
932
  if spec.cluster.id in [s.cluster.id for s in current_state]:
933
- for mutex in spec.upgrade_policy.conditions.mutexes or []:
933
+ for mutex in spec.effective_mutexes:
934
934
  locked[mutex] = spec.cluster.id
935
935
 
936
936
  now = datetime.utcnow()
@@ -945,9 +945,7 @@ def calculate_diff(
945
945
  node_pool_update = _calculate_node_pool_diffs(ocm_api, spec, now)
946
946
  if node_pool_update: # node pool update policy not yet created
947
947
  diffs.append(node_pool_update)
948
- set_mutex(
949
- locked, spec.cluster.id, spec.upgrade_policy.conditions.mutexes
950
- )
948
+ set_mutex(locked, spec.cluster.id, spec.effective_mutexes)
951
949
  continue
952
950
 
953
951
  # ignore clusters with an existing upgrade policy
@@ -1024,7 +1022,7 @@ def calculate_diff(
1024
1022
  policy=_create_upgrade_policy(next_schedule, spec, version),
1025
1023
  )
1026
1024
  )
1027
- set_mutex(locked, spec.cluster.id, spec.upgrade_policy.conditions.mutexes)
1025
+ set_mutex(locked, spec.cluster.id, spec.effective_mutexes)
1028
1026
 
1029
1027
  return diffs
1030
1028
 
reconcile/aus/models.py CHANGED
@@ -55,6 +55,12 @@ class ClusterUpgradeSpec(BaseModel):
55
55
  def get_available_upgrades(self) -> list[str]:
56
56
  return self.cluster.available_upgrades()
57
57
 
58
+ @property
59
+ def effective_mutexes(self) -> set[str]:
60
+ mutexes = set(self.upgrade_policy.conditions.mutexes or [])
61
+ mutexes.add(self.cluster.id)
62
+ return mutexes
63
+
58
64
 
59
65
  class ClusterAddonUpgradeSpec(ClusterUpgradeSpec):
60
66
  addon: OCMAddonInstallation
@@ -804,7 +804,9 @@ def early_exit_desired_state(*args: Any, **kwargs: Any) -> dict[str, Any]:
804
804
  users = get_users(gqlapi.query)
805
805
  for user in users:
806
806
  user.roles = [
807
- role for role in user.roles or [] if role.tag_on_cluster_updates is False
807
+ role
808
+ for role in user.roles or []
809
+ if role.tag_on_cluster_updates is not False
808
810
  ]
809
811
  return {
810
812
  "permissions": [p.dict() for p in get_permissions(gqlapi.query)],