qontract-reconcile 0.10.1rc40__py3-none-any.whl → 0.10.1rc42__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.1rc40.dist-info → qontract_reconcile-0.10.1rc42.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc40.dist-info → qontract_reconcile-0.10.1rc42.dist-info}/RECORD +13 -13
- reconcile/aus/advanced_upgrade_service.py +13 -4
- reconcile/aus/base.py +1 -0
- reconcile/cli.py +8 -1
- reconcile/gitlab_owners.py +11 -9
- reconcile/queries.py +2 -1
- reconcile/utils/ocm/clusters.py +19 -3
- reconcile/utils/ocm/subscriptions.py +4 -2
- tools/qontract_cli.py +8 -1
- {qontract_reconcile-0.10.1rc40.dist-info → qontract_reconcile-0.10.1rc42.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc40.dist-info → qontract_reconcile-0.10.1rc42.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc40.dist-info → qontract_reconcile-0.10.1rc42.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc40.dist-info → qontract_reconcile-0.10.1rc42.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.1rc42
|
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
|
@@ -7,7 +7,7 @@ reconcile/aws_iam_password_reset.py,sha256=NwErtrqgBiXr7eGCAHdtGGOx0S7-4JnSc29Ie
|
|
7
7
|
reconcile/aws_support_cases_sos.py,sha256=i6bSWnlH9fh14P14PjVhFLwNl-q3fD733_rXKM_O51c,2992
|
8
8
|
reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=W_VJagnsJR1v5oqjlI3RJJE0_nhtJ0m81RS8zWA5u5c,3538
|
9
9
|
reconcile/checkpoint.py,sha256=figtZRuWUvdpdSnkhAqeGvO5dI02TT6J3heyeFhlwqM,5016
|
10
|
-
reconcile/cli.py,sha256=
|
10
|
+
reconcile/cli.py,sha256=zeNbdiFnF19osDOAoWbnlYHvnVZblcSFGWGiyFKGD-s,70611
|
11
11
|
reconcile/closedbox_endpoint_monitoring_base.py,sha256=0xg_d8dwd36Y8GY1mE-LLO1LQpPEMM77bzAfc_KdgzU,4870
|
12
12
|
reconcile/cluster_deployment_mapper.py,sha256=2Ah-nu-Mdig0pjuiZl_XLrmVAjYzFjORR3dMlCgkmw0,2352
|
13
13
|
reconcile/dashdotdb_base.py,sha256=Ca75-OQiu5HeA8Q6zQpEYuhyCSjeuWe99K4y9ipTORM,4032
|
@@ -31,7 +31,7 @@ reconcile/gitlab_integrations.py,sha256=W-7YzyurVhnCUUDXo7a4LHGXHEkt5RysxAmDY4fe
|
|
31
31
|
reconcile/gitlab_labeler.py,sha256=avNifNROyGhko6WDAaTH3ixA86qzxdBsSk1IisRoxao,4635
|
32
32
|
reconcile/gitlab_members.py,sha256=Sf3sq2ketl0buNKevSF5t8m_i-oImeYnSmT8-n9jUhs,8018
|
33
33
|
reconcile/gitlab_mr_sqs_consumer.py,sha256=O46mdziPgGOndbU-0_UJKJVUaiEoVzJPEgKm4_UvYoI,2571
|
34
|
-
reconcile/gitlab_owners.py,sha256=
|
34
|
+
reconcile/gitlab_owners.py,sha256=3OwGjPsKzKBtp0l2wWfh1RwnWYDeLejykCq5SHof0vk,13922
|
35
35
|
reconcile/gitlab_permissions.py,sha256=ciEKj_wnRbS_vs_ZwcUeD6HkWVe3osAuotFqJSmvd94,1638
|
36
36
|
reconcile/gitlab_projects.py,sha256=K3tFf_aD1W4Ijp5q-9Qek3kwFGEWPcZ1kd7tzFJ4GyQ,1781
|
37
37
|
reconcile/integrations_manager.py,sha256=ed1kFdGG6Z2agbN_agSp-pIyCQMyegF-OzH2EpUTkv8,8878
|
@@ -94,7 +94,7 @@ reconcile/quay_mirror.py,sha256=9pwl1gLzRpsVXF5yPULM4ET_C5F8_xPmH8Mv8AS2AfI,1340
|
|
94
94
|
reconcile/quay_mirror_org.py,sha256=E1OdRe-ppxTkNCwu20iVRhEdG1fPDBroLY02NgiMN7c,10381
|
95
95
|
reconcile/quay_permissions.py,sha256=_3PCWjNWoU7VHlYgHzUevvL_jJmEMsWfXV_nzjeiyhU,4099
|
96
96
|
reconcile/quay_repos.py,sha256=7609RBVQihis96FNOOe-i9tCTYwcTVy4WpKAL6HpnkU,7031
|
97
|
-
reconcile/queries.py,sha256=
|
97
|
+
reconcile/queries.py,sha256=7WKQDOgN4CiUfrYQ9uzS32ILB7WQGB8ZxbfxMf4ad2Y,49151
|
98
98
|
reconcile/query_validator.py,sha256=oLEZIAsQCzxmmZ7b9dSw-OKuEjpI1dbVu4XfCfjpmi8,1503
|
99
99
|
reconcile/requests_sender.py,sha256=914iluuF4UVgG3VyxxtnHOu4yf6YKS2fIy6PViSsFTQ,3875
|
100
100
|
reconcile/resource_scraper.py,sha256=vo1N9vLJCYWvXlTwFRIpEuWjx_39ZV9zxJlpoPq4g3U,2330
|
@@ -119,8 +119,8 @@ reconcile/unleash_watcher.py,sha256=xNLUFpIr66XESEyXUkmHTTmHghVWHiMtnS_k0OC7gd8,
|
|
119
119
|
reconcile/vault_replication.py,sha256=xobxnsOfUcwvdQ-RZ7JH_sZCDh8rpEY7MJ36nkvfFqE,17262
|
120
120
|
reconcile/vpc_peerings_validator.py,sha256=10igLYTQpBMGXO9mTO7sJBzgr4jXQ2hf1OH5r5DKugE,3586
|
121
121
|
reconcile/aus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
122
|
-
reconcile/aus/advanced_upgrade_service.py,sha256=
|
123
|
-
reconcile/aus/base.py,sha256=
|
122
|
+
reconcile/aus/advanced_upgrade_service.py,sha256=R0V-APkx12JOQNySLSM1HvJDJSzKp3QyBO0hBBoVzlM,11316
|
123
|
+
reconcile/aus/base.py,sha256=qnO8kmnesMho6a-EgFdrVejjPtwS_jkdlSPHaXYB1Rs,26259
|
124
124
|
reconcile/aus/models.py,sha256=Qj4hmJr6J3fsH1acOaudqvGnXIuk5pXakckOf3L_qHA,4536
|
125
125
|
reconcile/aus/ocm_addons_upgrade_scheduler_org.py,sha256=b9qGFWwY8aSEzXeTtw89dqQeK_dJGBEfopOOkdjO8V8,6026
|
126
126
|
reconcile/aus/ocm_upgrade_scheduler.py,sha256=Wh2ZbODeOF7_hEbXfsFUGnAJ9CLSy76lNKEmir-GHuM,3447
|
@@ -537,13 +537,13 @@ reconcile/utils/mr/user_maintenance.py,sha256=_4VwAMJsBxD7maM7AZsMl_GjYRgQtZb_rl
|
|
537
537
|
reconcile/utils/ocm/__init__.py,sha256=5Pcf5cyftDWT5XRi1EzvNklOVxGplJi-v12HN3TDarc,57
|
538
538
|
reconcile/utils/ocm/base.py,sha256=8pCZB_V6pZhc-qZQFTuIr1kM5nxrzz9kT86-DW3rgq0,168
|
539
539
|
reconcile/utils/ocm/cluster_groups.py,sha256=TBb3mIzw68BHBcCzacmAN8IsNPo8FfOnTMphuctwuU0,2679
|
540
|
-
reconcile/utils/ocm/clusters.py,sha256=
|
540
|
+
reconcile/utils/ocm/clusters.py,sha256=4Ddc0Ah-s5gmNUK0K_4e2zaHyip50fyCCSFuAirPO2s,7766
|
541
541
|
reconcile/utils/ocm/labels.py,sha256=5Edjk9F3o4AnhzYc-YUiwDkG_pnEPcXrIXT9g1uE3x0,4883
|
542
542
|
reconcile/utils/ocm/ocm.py,sha256=pp-T6cT0RQf91oqrWFm5QSd_LyH8n5gJmPaetDtMioI,64455
|
543
543
|
reconcile/utils/ocm/search_filters.py,sha256=zExZpYBh7_tucG-xKoPHUxz1b_6l9qwbEMpMihQg7nA,15043
|
544
544
|
reconcile/utils/ocm/service_log.py,sha256=6_RNLG6KlnXNmJW6xBrlqGdyyz-fuaSeFmiJFOLN51g,2535
|
545
545
|
reconcile/utils/ocm/sre_capability_labels.py,sha256=HY5v3ndMu1hwbLipX24l1R-dvm0SFKFettnV7detVBI,1530
|
546
|
-
reconcile/utils/ocm/subscriptions.py,sha256=
|
546
|
+
reconcile/utils/ocm/subscriptions.py,sha256=PO5Rp440NEmZxIVVvhQpPzDRcKL1jYoQq5j2N9AkM1c,2344
|
547
547
|
reconcile/utils/runtime/__init__.py,sha256=l9o8APZxyED5Q6ylGoLIESksQF4f3O8cdke3IdMFOTQ,108
|
548
548
|
reconcile/utils/runtime/desired_state_diff.py,sha256=AQhJmq3CP2YOWP-KpmVtYKnhZ46sxERfbk_R6PHO-zc,8272
|
549
549
|
reconcile/utils/runtime/environment.py,sha256=cJgCMRBeschdeKJuk_N6BhDWaOCZbo-41i2a9L9DpBE,1328
|
@@ -570,7 +570,7 @@ tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
570
570
|
tools/app_interface_reporter.py,sha256=M_5C7ySACJG6Hp0UcY-w9ZY0sTVE7oQ48qoijp10jag,21933
|
571
571
|
tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
|
572
572
|
tools/glitchtip_access_revalidation.py,sha256=PXN5wxl6OX8sxddPaakDF3X79nFLvpm-lz0mWLVelw0,2806
|
573
|
-
tools/qontract_cli.py,sha256=
|
573
|
+
tools/qontract_cli.py,sha256=pGBwz3TjvfSDCYlKSISTzCG5ab1ljxJQIfTh3lkljOY,90671
|
574
574
|
tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
575
575
|
tools/cli_commands/gpg_encrypt.py,sha256=JryinrDdvztN931enUY3FuDeLVnfs6y58mnK7itNK6Y,4940
|
576
576
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
@@ -578,8 +578,8 @@ tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y
|
|
578
578
|
tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
579
579
|
tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
|
580
580
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
581
|
-
qontract_reconcile-0.10.
|
582
|
-
qontract_reconcile-0.10.
|
583
|
-
qontract_reconcile-0.10.
|
584
|
-
qontract_reconcile-0.10.
|
585
|
-
qontract_reconcile-0.10.
|
581
|
+
qontract_reconcile-0.10.1rc42.dist-info/METADATA,sha256=GHL6WI4VYINYdxldOjinx2mUmBm0tpnLz9aWAJHxDnk,2288
|
582
|
+
qontract_reconcile-0.10.1rc42.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
583
|
+
qontract_reconcile-0.10.1rc42.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
|
584
|
+
qontract_reconcile-0.10.1rc42.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
585
|
+
qontract_reconcile-0.10.1rc42.dist-info/RECORD,,
|
@@ -75,7 +75,11 @@ class AdvancedUpgradeServiceIntegration(OCMClusterUpgradeSchedulerOrgIntegration
|
|
75
75
|
self, ocm_env: OCMEnvironment, org_ids: Optional[set[str]]
|
76
76
|
) -> dict[str, OrganizationUpgradeSpec]:
|
77
77
|
ocm_api = init_ocm_base_client(ocm_env, self.secret_reader)
|
78
|
-
clusters_by_org =
|
78
|
+
clusters_by_org = discover_clusters(
|
79
|
+
ocm_api=ocm_api,
|
80
|
+
org_ids=org_ids,
|
81
|
+
ignore_sts_clusters=self.params.ignore_sts_clusters,
|
82
|
+
)
|
79
83
|
labels_by_org = _get_org_labels(ocm_api=ocm_api, org_ids=org_ids)
|
80
84
|
|
81
85
|
return _build_org_upgrade_specs_for_ocm_env(
|
@@ -96,8 +100,10 @@ class AdvancedUpgradeServiceIntegration(OCMClusterUpgradeSchedulerOrgIntegration
|
|
96
100
|
)
|
97
101
|
|
98
102
|
|
99
|
-
def
|
100
|
-
ocm_api: OCMBaseClient,
|
103
|
+
def discover_clusters(
|
104
|
+
ocm_api: OCMBaseClient,
|
105
|
+
org_ids: Optional[set[str]] = None,
|
106
|
+
ignore_sts_clusters: bool = False,
|
101
107
|
) -> dict[str, list[ClusterDetails]]:
|
102
108
|
"""
|
103
109
|
Discover all clusters that are part of the AUS service.
|
@@ -111,7 +117,10 @@ def _discover_clusters(
|
|
111
117
|
# group by org and filter if org_id is specified
|
112
118
|
clusters_by_org: dict[str, list[ClusterDetails]] = defaultdict(list)
|
113
119
|
for c in clusters:
|
114
|
-
|
120
|
+
is_sts_cluster = c.ocm_cluster.aws and c.ocm_cluster.aws.sts_enabled
|
121
|
+
passed_sts_filter = not ignore_sts_clusters or not is_sts_cluster
|
122
|
+
passed_ocm_filters = org_ids is None or c.organization_id in org_ids
|
123
|
+
if passed_ocm_filters and passed_sts_filter:
|
115
124
|
clusters_by_org[c.organization_id].append(c)
|
116
125
|
|
117
126
|
return clusters_by_org
|
reconcile/aus/base.py
CHANGED
reconcile/cli.py
CHANGED
@@ -1996,8 +1996,14 @@ def ocm_addons_upgrade_scheduler_org(ctx):
|
|
1996
1996
|
required=False,
|
1997
1997
|
envvar="AUS_OCM_ORG_IDS",
|
1998
1998
|
)
|
1999
|
+
@click.option(
|
2000
|
+
"--ignore-sts-clusters",
|
2001
|
+
is_flag=True,
|
2002
|
+
default=os.environ.get("IGNORE_STS_CLUSTERS", False),
|
2003
|
+
help="Ignore STS clusters",
|
2004
|
+
)
|
1999
2005
|
@click.pass_context
|
2000
|
-
def aus_upgrade_scheduler_org(ctx, ocm_env, ocm_org_ids):
|
2006
|
+
def aus_upgrade_scheduler_org(ctx, ocm_env, ocm_org_ids, ignore_sts_clusters):
|
2001
2007
|
from reconcile.aus.advanced_upgrade_service import AdvancedUpgradeServiceIntegration
|
2002
2008
|
from reconcile.aus.base import AdvancedUpgradeSchedulerBaseIntegrationParams
|
2003
2009
|
|
@@ -2007,6 +2013,7 @@ def aus_upgrade_scheduler_org(ctx, ocm_env, ocm_org_ids):
|
|
2007
2013
|
AdvancedUpgradeSchedulerBaseIntegrationParams(
|
2008
2014
|
ocm_environment=ocm_env,
|
2009
2015
|
ocm_organization_ids=parsed_ocm_org_ids,
|
2016
|
+
ignore_sts_clusters=ignore_sts_clusters,
|
2010
2017
|
)
|
2011
2018
|
),
|
2012
2019
|
ctx=ctx.obj,
|
reconcile/gitlab_owners.py
CHANGED
@@ -31,18 +31,19 @@ class MRApproval:
|
|
31
31
|
between the approval messages the the project owners.
|
32
32
|
"""
|
33
33
|
|
34
|
-
def __init__(self, gitlab_client, merge_request, owners, dry_run):
|
34
|
+
def __init__(self, gitlab_client, merge_request, owners, dry_run, persistent_lgtm):
|
35
35
|
self.gitlab = gitlab_client
|
36
36
|
self.mr = merge_request
|
37
37
|
self.owners = owners
|
38
38
|
self.dry_run = dry_run
|
39
|
+
self.persistent_lgtm = persistent_lgtm
|
39
40
|
|
41
|
+
# Get the date of the most recent commit (top commit) in the MR, but avoid comparing against None
|
42
|
+
self.top_commit_created_at = dateparser.parse("2000-01-01")
|
40
43
|
commits = self.mr.commits()
|
41
44
|
if commits:
|
42
45
|
top_commit = next(commits)
|
43
46
|
self.top_commit_created_at = dateparser.parse(top_commit.created_at)
|
44
|
-
else:
|
45
|
-
self.top_commit_created_at = None
|
46
47
|
|
47
48
|
def get_change_owners_map(self):
|
48
49
|
"""
|
@@ -77,7 +78,6 @@ class MRApproval:
|
|
77
78
|
lgtms = []
|
78
79
|
comments = self.gitlab.get_merge_request_comments(self.mr.iid)
|
79
80
|
for comment in comments:
|
80
|
-
|
81
81
|
# Only interested in '/lgtm' comments
|
82
82
|
if comment["body"] != "/lgtm":
|
83
83
|
continue
|
@@ -85,7 +85,10 @@ class MRApproval:
|
|
85
85
|
# Only interested in comments created after the top commit
|
86
86
|
# creation time
|
87
87
|
comment_created_at = dateparser.parse(comment["created_at"])
|
88
|
-
if
|
88
|
+
if (
|
89
|
+
comment_created_at < self.top_commit_created_at
|
90
|
+
and not self.persistent_lgtm
|
91
|
+
):
|
89
92
|
continue
|
90
93
|
|
91
94
|
lgtms.append(comment["username"])
|
@@ -218,7 +221,6 @@ class MRApproval:
|
|
218
221
|
closest_approvers.append(new_group)
|
219
222
|
|
220
223
|
if closest_approvers:
|
221
|
-
|
222
224
|
if len(closest_approvers) == 1:
|
223
225
|
markdown_report += (
|
224
226
|
f"{COMMENT_PREFIX} You will need a "
|
@@ -263,7 +265,6 @@ class MRApproval:
|
|
263
265
|
continue
|
264
266
|
|
265
267
|
for closest_reviewer in owners["closest_reviewers"]:
|
266
|
-
|
267
268
|
there = False
|
268
269
|
for group in closest_approvers:
|
269
270
|
if closest_reviewer in group:
|
@@ -285,7 +286,6 @@ class MRApproval:
|
|
285
286
|
continue
|
286
287
|
|
287
288
|
for reviewer in owners["reviewers"]:
|
288
|
-
|
289
289
|
there = False
|
290
290
|
for group in closest_approvers:
|
291
291
|
if reviewer in group:
|
@@ -313,7 +313,7 @@ class MRApproval:
|
|
313
313
|
|
314
314
|
@defer
|
315
315
|
def act(repo, dry_run, instance, settings, defer=None):
|
316
|
-
gitlab_cli = GitLabApi(instance, project_url=repo, settings=settings)
|
316
|
+
gitlab_cli = GitLabApi(instance, project_url=repo["url"], settings=settings)
|
317
317
|
defer(gitlab_cli.cleanup)
|
318
318
|
project_owners = RepoOwners(
|
319
319
|
git_cli=gitlab_cli, ref=gitlab_cli.project.default_branch
|
@@ -325,6 +325,8 @@ def act(repo, dry_run, instance, settings, defer=None):
|
|
325
325
|
merge_request=mr,
|
326
326
|
owners=project_owners,
|
327
327
|
dry_run=dry_run,
|
328
|
+
persistent_lgtm=repo.get("gitlabRepoOwners", {}).get("persistentLgtm", None)
|
329
|
+
or False,
|
328
330
|
)
|
329
331
|
|
330
332
|
if mr_approval.top_commit_created_at is None:
|
reconcile/queries.py
CHANGED
@@ -1661,6 +1661,7 @@ APPS_QUERY = """
|
|
1661
1661
|
showInReviewQueue
|
1662
1662
|
gitlabRepoOwners {
|
1663
1663
|
enabled
|
1664
|
+
persistentLgtm
|
1664
1665
|
}
|
1665
1666
|
gitlabHousekeeping {
|
1666
1667
|
enabled
|
@@ -1748,7 +1749,7 @@ def get_repos_gitlab_owner(server=""):
|
|
1748
1749
|
"""
|
1749
1750
|
code_components = get_code_components()
|
1750
1751
|
return [
|
1751
|
-
c["url"]
|
1752
|
+
{"url": c["url"], "gitlabRepoOwners": c["gitlabRepoOwners"]}
|
1752
1753
|
for c in code_components
|
1753
1754
|
if c["url"].startswith(server)
|
1754
1755
|
and c["gitlabRepoOwners"]
|
reconcile/utils/ocm/clusters.py
CHANGED
@@ -24,6 +24,8 @@ from reconcile.utils.ocm.subscriptions import (
|
|
24
24
|
)
|
25
25
|
from reconcile.utils.ocm_base_client import OCMBaseClient
|
26
26
|
|
27
|
+
ACTIVE_SUBSCRIPTION_STATES = {"Active", "Reserved"}
|
28
|
+
|
27
29
|
|
28
30
|
class OCMClusterState(Enum):
|
29
31
|
ERROR = "error"
|
@@ -39,6 +41,19 @@ class OCMClusterState(Enum):
|
|
39
41
|
WAITING = "waiting"
|
40
42
|
|
41
43
|
|
44
|
+
class OCMClusterFlag(BaseModel):
|
45
|
+
|
46
|
+
enabled: bool
|
47
|
+
|
48
|
+
|
49
|
+
class OCMClusterAWSSettings(BaseModel):
|
50
|
+
sts: Optional[OCMClusterFlag]
|
51
|
+
|
52
|
+
@property
|
53
|
+
def sts_enabled(self) -> bool:
|
54
|
+
return self.sts is not None and self.sts.enabled
|
55
|
+
|
56
|
+
|
42
57
|
class OCMCluster(BaseModel):
|
43
58
|
|
44
59
|
kind: str = "Cluster"
|
@@ -52,8 +67,6 @@ class OCMCluster(BaseModel):
|
|
52
67
|
display_name: str
|
53
68
|
|
54
69
|
managed: bool
|
55
|
-
|
56
|
-
openshift_version: str
|
57
70
|
state: OCMClusterState
|
58
71
|
|
59
72
|
subscription: OCMModelLink
|
@@ -61,6 +74,8 @@ class OCMCluster(BaseModel):
|
|
61
74
|
cloud_provider: OCMModelLink
|
62
75
|
product: OCMModelLink
|
63
76
|
|
77
|
+
aws: Optional[OCMClusterAWSSettings]
|
78
|
+
|
64
79
|
|
65
80
|
class ClusterDetails(BaseModel):
|
66
81
|
|
@@ -188,7 +203,8 @@ def get_cluster_details_for_subscriptions(
|
|
188
203
|
# get subscription details
|
189
204
|
subscriptions = get_subscriptions(
|
190
205
|
ocm_api=ocm_api,
|
191
|
-
filter=(subscription_filter or Filter())
|
206
|
+
filter=(subscription_filter or Filter())
|
207
|
+
& build_subscription_filter(states=ACTIVE_SUBSCRIPTION_STATES, managed=True),
|
192
208
|
)
|
193
209
|
if not subscriptions:
|
194
210
|
return
|
@@ -77,9 +77,11 @@ def get_subscriptions(
|
|
77
77
|
return subscriptions
|
78
78
|
|
79
79
|
|
80
|
-
def build_subscription_filter(
|
80
|
+
def build_subscription_filter(
|
81
|
+
states: Optional[set[str]] = None, managed: bool = True
|
82
|
+
) -> Filter:
|
81
83
|
"""
|
82
84
|
Helper function to create a subscription search filer for two very common
|
83
85
|
fields: status and managed.
|
84
86
|
"""
|
85
|
-
return Filter().
|
87
|
+
return Filter().is_in("status", states).eq("managed", str(managed).lower())
|
tools/qontract_cli.py
CHANGED
@@ -630,8 +630,14 @@ def ocm_fleet_upgrade_policies(
|
|
630
630
|
required=False,
|
631
631
|
envvar="AUS_OCM_ORG_IDS",
|
632
632
|
)
|
633
|
+
@click.option(
|
634
|
+
"--ignore-sts-clusters",
|
635
|
+
is_flag=True,
|
636
|
+
default=os.environ.get("IGNORE_STS_CLUSTERS", False),
|
637
|
+
help="Ignore STS clusters",
|
638
|
+
)
|
633
639
|
@click.pass_context
|
634
|
-
def aus_fleet_upgrade_policies(ctx, ocm_env, ocm_org_ids):
|
640
|
+
def aus_fleet_upgrade_policies(ctx, ocm_env, ocm_org_ids, ignore_sts_clusters):
|
635
641
|
from reconcile.aus.advanced_upgrade_service import AdvancedUpgradeServiceIntegration
|
636
642
|
|
637
643
|
parsed_ocm_org_ids = set(ocm_org_ids.split(",")) if ocm_org_ids else None
|
@@ -641,6 +647,7 @@ def aus_fleet_upgrade_policies(ctx, ocm_env, ocm_org_ids):
|
|
641
647
|
AdvancedUpgradeSchedulerBaseIntegrationParams(
|
642
648
|
ocm_environment=ocm_env,
|
643
649
|
ocm_organization_ids=parsed_ocm_org_ids,
|
650
|
+
ignore_sts_clusters=ignore_sts_clusters,
|
644
651
|
)
|
645
652
|
),
|
646
653
|
)
|
File without changes
|
{qontract_reconcile-0.10.1rc40.dist-info → qontract_reconcile-0.10.1rc42.dist-info}/entry_points.txt
RENAMED
File without changes
|
{qontract_reconcile-0.10.1rc40.dist-info → qontract_reconcile-0.10.1rc42.dist-info}/top_level.txt
RENAMED
File without changes
|