qontract-reconcile 0.10.2.dev216__py3-none-any.whl → 0.10.2.dev218__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.2.dev216.dist-info → qontract_reconcile-0.10.2.dev218.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.2.dev216.dist-info → qontract_reconcile-0.10.2.dev218.dist-info}/RECORD +17 -17
- reconcile/cli.py +766 -659
- reconcile/gitlab_housekeeping.py +57 -58
- reconcile/gitlab_permissions.py +13 -5
- reconcile/gitlab_projects.py +5 -3
- reconcile/integrations_manager.py +32 -41
- reconcile/jenkins_job_builder.py +1 -1
- reconcile/jenkins_job_builds_cleaner.py +10 -5
- reconcile/jenkins_job_cleaner.py +6 -3
- reconcile/jenkins_roles.py +15 -8
- reconcile/jenkins_webhooks.py +6 -3
- reconcile/jenkins_webhooks_cleaner.py +3 -2
- reconcile/jira_watcher.py +25 -9
- reconcile/utils/jira_client.py +1 -1
- {qontract_reconcile-0.10.2.dev216.dist-info → qontract_reconcile-0.10.2.dev218.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev216.dist-info → qontract_reconcile-0.10.2.dev218.dist-info}/entry_points.txt +0 -0
reconcile/cli.py
CHANGED
@@ -6,9 +6,11 @@ import os
|
|
6
6
|
import re
|
7
7
|
import sys
|
8
8
|
import traceback
|
9
|
-
from collections.abc import Iterable
|
9
|
+
from collections.abc import Callable, Iterable
|
10
|
+
from io import TextIOWrapper
|
10
11
|
from signal import SIGUSR1
|
11
12
|
from types import ModuleType
|
13
|
+
from typing import Any
|
12
14
|
|
13
15
|
import click
|
14
16
|
import sentry_sdk
|
@@ -54,7 +56,7 @@ HELM_VERSIONS = ["3.11.1"]
|
|
54
56
|
HELM_VERSION_REGEX = r"^version.BuildInfo{Version:\"v([\d]+\.[\d]+\.[\d]+)\".*$"
|
55
57
|
|
56
58
|
|
57
|
-
def before_breadcrumb(crumb,
|
59
|
+
def before_breadcrumb(crumb: dict, _: Any) -> dict:
|
58
60
|
# https://docs.sentry.io/platforms/python/configuration/filtering/
|
59
61
|
# Configure breadcrumb to filter error mesage
|
60
62
|
if "category" in crumb and crumb["category"] == "subprocess":
|
@@ -89,7 +91,7 @@ if os.getenv("SENTRY_DSN"):
|
|
89
91
|
)
|
90
92
|
|
91
93
|
|
92
|
-
def config_file(function):
|
94
|
+
def config_file(function: Callable) -> Callable:
|
93
95
|
help_msg = "Path to configuration file in toml format."
|
94
96
|
function = click.option(
|
95
97
|
"--config",
|
@@ -101,7 +103,7 @@ def config_file(function):
|
|
101
103
|
return function
|
102
104
|
|
103
105
|
|
104
|
-
def log_level(function):
|
106
|
+
def log_level(function: Callable) -> Callable:
|
105
107
|
function = click.option(
|
106
108
|
"--log-level",
|
107
109
|
help="log-level of the command. Defaults to INFO.",
|
@@ -110,7 +112,7 @@ def log_level(function):
|
|
110
112
|
return function
|
111
113
|
|
112
114
|
|
113
|
-
def early_exit(function):
|
115
|
+
def early_exit(function: Callable) -> Callable:
|
114
116
|
help_msg = (
|
115
117
|
"Runs integration in early exit mode. If the observed desired state of "
|
116
118
|
"an integration does not change between the provided bundle SHA "
|
@@ -125,7 +127,7 @@ def early_exit(function):
|
|
125
127
|
return function
|
126
128
|
|
127
129
|
|
128
|
-
def check_only_affected_shards(function):
|
130
|
+
def check_only_affected_shards(function: Callable) -> Callable:
|
129
131
|
help_msg = (
|
130
132
|
"Execute a dry-run only for those integration shards where the "
|
131
133
|
"desired state changed. Works only when --early-exit-compare-sha is set"
|
@@ -139,7 +141,7 @@ def check_only_affected_shards(function):
|
|
139
141
|
return function
|
140
142
|
|
141
143
|
|
142
|
-
def dry_run(function):
|
144
|
+
def dry_run(function: Callable) -> Callable:
|
143
145
|
help_msg = (
|
144
146
|
"If `true`, it will only print the planned actions "
|
145
147
|
"that would be performed, without executing them."
|
@@ -151,7 +153,7 @@ def dry_run(function):
|
|
151
153
|
return function
|
152
154
|
|
153
155
|
|
154
|
-
def validate_schemas(function):
|
156
|
+
def validate_schemas(function: Callable) -> Callable:
|
155
157
|
help_msg = "Fail integration if it queries forbidden schemas"
|
156
158
|
|
157
159
|
function = click.option(
|
@@ -160,7 +162,7 @@ def validate_schemas(function):
|
|
160
162
|
return function
|
161
163
|
|
162
164
|
|
163
|
-
def dump_schemas(function):
|
165
|
+
def dump_schemas(function: Callable) -> Callable:
|
164
166
|
help_msg = "Dump schemas to a file"
|
165
167
|
|
166
168
|
function = click.option("--dump-schemas", "dump_schemas_file", help=help_msg)(
|
@@ -169,7 +171,7 @@ def dump_schemas(function):
|
|
169
171
|
return function
|
170
172
|
|
171
173
|
|
172
|
-
def gql_sha_url(function):
|
174
|
+
def gql_sha_url(function: Callable) -> Callable:
|
173
175
|
help_msg = (
|
174
176
|
"If `false`, it will not use the sha_url endpoint "
|
175
177
|
"of graphql (prevent stopping execution on data reload)."
|
@@ -181,7 +183,7 @@ def gql_sha_url(function):
|
|
181
183
|
return function
|
182
184
|
|
183
185
|
|
184
|
-
def gql_url_print(function):
|
186
|
+
def gql_url_print(function: Callable) -> Callable:
|
185
187
|
help_msg = "If `false`, it will not print the url endpoint of graphql."
|
186
188
|
|
187
189
|
function = click.option(
|
@@ -190,20 +192,18 @@ def gql_url_print(function):
|
|
190
192
|
return function
|
191
193
|
|
192
194
|
|
193
|
-
def threaded(
|
194
|
-
def f(function):
|
195
|
+
def threaded(default: int = 10) -> Callable:
|
196
|
+
def f(function: Callable) -> Callable:
|
195
197
|
opt = "--thread-pool-size"
|
196
198
|
msg = "number of threads to run in parallel."
|
197
|
-
function = click.option(opt, default=
|
198
|
-
function
|
199
|
-
)
|
199
|
+
function = click.option(opt, type=int, default=default, help=msg)(function)
|
200
200
|
return function
|
201
201
|
|
202
202
|
return f
|
203
203
|
|
204
204
|
|
205
|
-
def take_over(
|
206
|
-
def f(function):
|
205
|
+
def take_over() -> Callable:
|
206
|
+
def f(function: Callable) -> Callable:
|
207
207
|
help_msg = "manage resources exclusively (take over existing ones)."
|
208
208
|
function = click.option(
|
209
209
|
"--take-over/--no-take-over", help=help_msg, default=True
|
@@ -213,8 +213,8 @@ def take_over(**kwargs):
|
|
213
213
|
return f
|
214
214
|
|
215
215
|
|
216
|
-
def internal(
|
217
|
-
def f(function):
|
216
|
+
def internal() -> Callable:
|
217
|
+
def f(function: Callable) -> Callable:
|
218
218
|
help_msg = "manage resources in internal or external clusters only."
|
219
219
|
function = click.option("--internal/--external", help=help_msg, default=None)(
|
220
220
|
function
|
@@ -224,8 +224,8 @@ def internal(**kwargs):
|
|
224
224
|
return f
|
225
225
|
|
226
226
|
|
227
|
-
def use_jump_host(
|
228
|
-
def f(function):
|
227
|
+
def use_jump_host() -> Callable:
|
228
|
+
def f(function: Callable) -> Callable:
|
229
229
|
help_msg = "use jump host if defined."
|
230
230
|
function = click.option(
|
231
231
|
"--use-jump-host/--no-use-jump-host", help=help_msg, default=False
|
@@ -235,7 +235,7 @@ def use_jump_host(**kwargs):
|
|
235
235
|
return f
|
236
236
|
|
237
237
|
|
238
|
-
def print_only(function):
|
238
|
+
def print_only(function: Callable) -> Callable:
|
239
239
|
function = click.option(
|
240
240
|
"--print-only/--no-print-only",
|
241
241
|
help="only print the config file.",
|
@@ -245,7 +245,7 @@ def print_only(function):
|
|
245
245
|
return function
|
246
246
|
|
247
247
|
|
248
|
-
def print_to_file(function):
|
248
|
+
def print_to_file(function: Callable) -> Callable:
|
249
249
|
function = click.option(
|
250
250
|
"--print-to-file", help="print the config to file.", default=None
|
251
251
|
)(function)
|
@@ -253,7 +253,7 @@ def print_to_file(function):
|
|
253
253
|
return function
|
254
254
|
|
255
255
|
|
256
|
-
def config_name(function):
|
256
|
+
def config_name(function: Callable) -> Callable:
|
257
257
|
function = click.option(
|
258
258
|
"--config-name",
|
259
259
|
help="jenkins config name to print out.must works with --print-only mode",
|
@@ -263,7 +263,7 @@ def config_name(function):
|
|
263
263
|
return function
|
264
264
|
|
265
265
|
|
266
|
-
def job_name(function):
|
266
|
+
def job_name(function: Callable) -> Callable:
|
267
267
|
function = click.option(
|
268
268
|
"--job-name", help="jenkins job name to print out.", default=None
|
269
269
|
)(function)
|
@@ -271,7 +271,7 @@ def job_name(function):
|
|
271
271
|
return function
|
272
272
|
|
273
273
|
|
274
|
-
def instance_name(function):
|
274
|
+
def instance_name(function: Callable) -> Callable:
|
275
275
|
function = click.option(
|
276
276
|
"--instance-name", help="jenkins instance name to act on.", default=None
|
277
277
|
)(function)
|
@@ -279,7 +279,7 @@ def instance_name(function):
|
|
279
279
|
return function
|
280
280
|
|
281
281
|
|
282
|
-
def throughput(function):
|
282
|
+
def throughput(function: Callable) -> Callable:
|
283
283
|
function = click.option(
|
284
284
|
"--io-dir", help="directory of input/output files.", default="throughput/"
|
285
285
|
)(function)
|
@@ -287,7 +287,7 @@ def throughput(function):
|
|
287
287
|
return function
|
288
288
|
|
289
289
|
|
290
|
-
def vault_input_path(function):
|
290
|
+
def vault_input_path(function: Callable) -> Callable:
|
291
291
|
function = click.option(
|
292
292
|
"--vault-input-path", help="path in Vault to find input resources.", default=""
|
293
293
|
)(function)
|
@@ -295,7 +295,7 @@ def vault_input_path(function):
|
|
295
295
|
return function
|
296
296
|
|
297
297
|
|
298
|
-
def vault_output_path(function):
|
298
|
+
def vault_output_path(function: Callable) -> Callable:
|
299
299
|
function = click.option(
|
300
300
|
"--vault-output-path",
|
301
301
|
help="path in Vault to store output resources.",
|
@@ -305,17 +305,7 @@ def vault_output_path(function):
|
|
305
305
|
return function
|
306
306
|
|
307
307
|
|
308
|
-
def
|
309
|
-
function = click.option(
|
310
|
-
"--vault-throughput-path",
|
311
|
-
help="path in Vault to find input resources and store output resources.",
|
312
|
-
default="",
|
313
|
-
)(function)
|
314
|
-
|
315
|
-
return function
|
316
|
-
|
317
|
-
|
318
|
-
def cluster_name(function):
|
308
|
+
def cluster_name(function: Callable) -> Callable:
|
319
309
|
"""This option can be used when more than one cluster needs to be passed as argument"""
|
320
310
|
function = click.option(
|
321
311
|
"--cluster-name",
|
@@ -327,7 +317,7 @@ def cluster_name(function):
|
|
327
317
|
return function
|
328
318
|
|
329
319
|
|
330
|
-
def exclude_cluster(function):
|
320
|
+
def exclude_cluster(function: Callable) -> Callable:
|
331
321
|
function = click.option(
|
332
322
|
"--exclude-cluster",
|
333
323
|
multiple=True,
|
@@ -338,7 +328,7 @@ def exclude_cluster(function):
|
|
338
328
|
return function
|
339
329
|
|
340
330
|
|
341
|
-
def namespace_name(function):
|
331
|
+
def namespace_name(function: Callable) -> Callable:
|
342
332
|
function = click.option(
|
343
333
|
"--namespace-name", help="namespace name to act on.", default=None
|
344
334
|
)(function)
|
@@ -346,7 +336,7 @@ def namespace_name(function):
|
|
346
336
|
return function
|
347
337
|
|
348
338
|
|
349
|
-
def environment_name(function):
|
339
|
+
def environment_name(function: Callable) -> Callable:
|
350
340
|
function = click.option(
|
351
341
|
"--environment-name",
|
352
342
|
help="environment name to act on.",
|
@@ -356,7 +346,7 @@ def environment_name(function):
|
|
356
346
|
return function
|
357
347
|
|
358
348
|
|
359
|
-
def resource_kind(function):
|
349
|
+
def resource_kind(function: Callable) -> Callable:
|
360
350
|
function = click.option("--resource-kind", help="kind to act on.", default=None)(
|
361
351
|
function
|
362
352
|
)
|
@@ -364,7 +354,7 @@ def resource_kind(function):
|
|
364
354
|
return function
|
365
355
|
|
366
356
|
|
367
|
-
def account_name(function):
|
357
|
+
def account_name(function: Callable) -> Callable:
|
368
358
|
function = click.option(
|
369
359
|
"--account-name", help="aws account name to act on.", default=None
|
370
360
|
)(function)
|
@@ -372,13 +362,13 @@ def account_name(function):
|
|
372
362
|
return function
|
373
363
|
|
374
364
|
|
375
|
-
def cloudflare_zone_name(function):
|
365
|
+
def cloudflare_zone_name(function: Callable) -> Callable:
|
376
366
|
function = click.option("--zone-name", default=None)(function)
|
377
367
|
|
378
368
|
return function
|
379
369
|
|
380
370
|
|
381
|
-
def account_name_multiple(function):
|
371
|
+
def account_name_multiple(function: Callable) -> Callable:
|
382
372
|
"""This option can be used when more than one account needs to be passed as argument"""
|
383
373
|
function = click.option(
|
384
374
|
"--account-name",
|
@@ -390,7 +380,7 @@ def account_name_multiple(function):
|
|
390
380
|
return function
|
391
381
|
|
392
382
|
|
393
|
-
def exclude_aws_accounts(function):
|
383
|
+
def exclude_aws_accounts(function: Callable) -> Callable:
|
394
384
|
function = click.option(
|
395
385
|
"--exclude-accounts",
|
396
386
|
multiple=True,
|
@@ -401,11 +391,11 @@ def exclude_aws_accounts(function):
|
|
401
391
|
return function
|
402
392
|
|
403
393
|
|
404
|
-
def org_id_multiple(function):
|
394
|
+
def org_id_multiple(function: Callable) -> Callable:
|
405
395
|
"""This option can be used when more than one OCM organization ID needs to be passed as argument"""
|
406
396
|
function = click.option(
|
407
397
|
"--org-id",
|
408
|
-
default=
|
398
|
+
default=[],
|
409
399
|
multiple=True,
|
410
400
|
help="OCM organization IDs to act on",
|
411
401
|
)(function)
|
@@ -413,7 +403,7 @@ def org_id_multiple(function):
|
|
413
403
|
return function
|
414
404
|
|
415
405
|
|
416
|
-
def exclude_org_id(function):
|
406
|
+
def exclude_org_id(function: Callable) -> Callable:
|
417
407
|
function = click.option(
|
418
408
|
"--exclude-org-id",
|
419
409
|
multiple=True,
|
@@ -424,7 +414,7 @@ def exclude_org_id(function):
|
|
424
414
|
return function
|
425
415
|
|
426
416
|
|
427
|
-
def workspace_name(function):
|
417
|
+
def workspace_name(function: Callable) -> Callable:
|
428
418
|
function = click.option(
|
429
419
|
"--workspace-name", help="slack workspace name to act on.", default=None
|
430
420
|
)(function)
|
@@ -432,7 +422,7 @@ def workspace_name(function):
|
|
432
422
|
return function
|
433
423
|
|
434
424
|
|
435
|
-
def usergroup_name(function):
|
425
|
+
def usergroup_name(function: Callable) -> Callable:
|
436
426
|
function = click.option(
|
437
427
|
"--usergroup-name", help="slack usergroup name to act on.", default=None
|
438
428
|
)(function)
|
@@ -440,7 +430,7 @@ def usergroup_name(function):
|
|
440
430
|
return function
|
441
431
|
|
442
432
|
|
443
|
-
def gitlab_project_id(function):
|
433
|
+
def gitlab_project_id(function: Callable) -> Callable:
|
444
434
|
function = click.option(
|
445
435
|
"--gitlab-project-id",
|
446
436
|
help="gitlab project id to submit PRs to. "
|
@@ -452,7 +442,7 @@ def gitlab_project_id(function):
|
|
452
442
|
return function
|
453
443
|
|
454
444
|
|
455
|
-
def saas_file_name(function):
|
445
|
+
def saas_file_name(function: Callable) -> Callable:
|
456
446
|
function = click.option(
|
457
447
|
"--saas-file-name", help="saas-file to act on.", default=None
|
458
448
|
)(function)
|
@@ -460,43 +450,27 @@ def saas_file_name(function):
|
|
460
450
|
return function
|
461
451
|
|
462
452
|
|
463
|
-
def enable_deletion(
|
464
|
-
def f(function):
|
453
|
+
def enable_deletion(default: bool = True) -> Callable:
|
454
|
+
def f(function: Callable) -> Callable:
|
465
455
|
opt = "--enable-deletion/--no-enable-deletion"
|
466
456
|
msg = "enable destroy/replace action."
|
467
|
-
function = click.option(opt, default=
|
468
|
-
function
|
469
|
-
)
|
457
|
+
function = click.option(opt, default=default, help=msg)(function)
|
470
458
|
return function
|
471
459
|
|
472
460
|
return f
|
473
461
|
|
474
462
|
|
475
|
-
def send_mails(
|
476
|
-
def f(function):
|
463
|
+
def send_mails(default: bool = False) -> Callable:
|
464
|
+
def f(function: Callable) -> Callable:
|
477
465
|
opt = "--send-mails/--no-send-mails"
|
478
466
|
msg = "send email notification to users."
|
479
|
-
function = click.option(opt, default=
|
480
|
-
function
|
481
|
-
)
|
467
|
+
function = click.option(opt, default=default, help=msg)(function)
|
482
468
|
return function
|
483
469
|
|
484
470
|
return f
|
485
471
|
|
486
472
|
|
487
|
-
def
|
488
|
-
def f(function):
|
489
|
-
opt = "--enable-rebase/--no-enable-rebase"
|
490
|
-
msg = "enable the merge request rebase action."
|
491
|
-
function = click.option(opt, default=kwargs.get("default", True), help=msg)(
|
492
|
-
function
|
493
|
-
)
|
494
|
-
return function
|
495
|
-
|
496
|
-
return f
|
497
|
-
|
498
|
-
|
499
|
-
def include_trigger_trace(function):
|
473
|
+
def include_trigger_trace(function: Callable) -> Callable:
|
500
474
|
help_msg = "If `true`, include traces of the triggering integration and reason."
|
501
475
|
|
502
476
|
function = click.option(
|
@@ -507,7 +481,7 @@ def include_trigger_trace(function):
|
|
507
481
|
return function
|
508
482
|
|
509
483
|
|
510
|
-
def trigger_reason(function):
|
484
|
+
def trigger_reason(function: Callable) -> Callable:
|
511
485
|
function = click.option(
|
512
486
|
"--trigger-reason",
|
513
487
|
help="reason deployment was triggered.",
|
@@ -517,7 +491,7 @@ def trigger_reason(function):
|
|
517
491
|
return function
|
518
492
|
|
519
493
|
|
520
|
-
def trigger_integration(function):
|
494
|
+
def trigger_integration(function: Callable) -> Callable:
|
521
495
|
function = click.option(
|
522
496
|
"--trigger-integration",
|
523
497
|
help="integration deployment was triggered.",
|
@@ -527,7 +501,7 @@ def trigger_integration(function):
|
|
527
501
|
return function
|
528
502
|
|
529
503
|
|
530
|
-
def enable_extended_early_exit(function):
|
504
|
+
def enable_extended_early_exit(function: Callable) -> Callable:
|
531
505
|
return click.option(
|
532
506
|
"--enable-extended-early-exit/--no-enable-extended-early-exit",
|
533
507
|
default=False,
|
@@ -535,7 +509,7 @@ def enable_extended_early_exit(function):
|
|
535
509
|
)(function)
|
536
510
|
|
537
511
|
|
538
|
-
def extended_early_exit_cache_ttl_seconds(function):
|
512
|
+
def extended_early_exit_cache_ttl_seconds(function: Callable) -> Callable:
|
539
513
|
return click.option(
|
540
514
|
"--extended-early-exit-cache-ttl-seconds",
|
541
515
|
default=3600,
|
@@ -543,7 +517,7 @@ def extended_early_exit_cache_ttl_seconds(function):
|
|
543
517
|
)(function)
|
544
518
|
|
545
519
|
|
546
|
-
def log_cached_log_output(function):
|
520
|
+
def log_cached_log_output(function: Callable) -> Callable:
|
547
521
|
return click.option(
|
548
522
|
"--log-cached-log-output/--no-log-cached-log-output",
|
549
523
|
default=False,
|
@@ -551,7 +525,7 @@ def log_cached_log_output(function):
|
|
551
525
|
)(function)
|
552
526
|
|
553
527
|
|
554
|
-
def register_faulthandler(fileobj=sys.__stderr__):
|
528
|
+
def register_faulthandler(fileobj: TextIOWrapper | None = sys.__stderr__) -> None:
|
555
529
|
if fileobj:
|
556
530
|
if not faulthandler.is_enabled():
|
557
531
|
try:
|
@@ -575,10 +549,10 @@ class UnknownIntegrationTypeError(Exception):
|
|
575
549
|
|
576
550
|
def run_integration(
|
577
551
|
func_container: ModuleType,
|
578
|
-
ctx,
|
579
|
-
*args,
|
580
|
-
**kwargs,
|
581
|
-
):
|
552
|
+
ctx: click.Context,
|
553
|
+
*args: Any,
|
554
|
+
**kwargs: Any,
|
555
|
+
) -> None:
|
582
556
|
run_class_integration(
|
583
557
|
integration=ModuleBasedQontractReconcileIntegration(
|
584
558
|
ModuleArgsKwargsRunParams(func_container, *args, **kwargs)
|
@@ -589,10 +563,10 @@ def run_integration(
|
|
589
563
|
|
590
564
|
def run_class_integration(
|
591
565
|
integration: QontractReconcileIntegration,
|
592
|
-
ctx,
|
593
|
-
):
|
566
|
+
ctx: click.Context,
|
567
|
+
) -> None:
|
594
568
|
register_faulthandler()
|
595
|
-
dump_schemas_file = ctx.
|
569
|
+
dump_schemas_file = ctx.obj["dump_schemas_file"]
|
596
570
|
try:
|
597
571
|
running_state = RunningState()
|
598
572
|
running_state.integration = integration.name # type: ignore[attr-defined]
|
@@ -603,18 +577,18 @@ def run_class_integration(
|
|
603
577
|
sys.exit(ExitCodes.SUCCESS)
|
604
578
|
|
605
579
|
check_only_affected_shards = (
|
606
|
-
ctx.
|
580
|
+
ctx.obj["check_only_affected_shards"]
|
607
581
|
or os.environ.get("CHECK_ONLY_AFFECTED_SHARDS", "false") == "true"
|
608
582
|
)
|
609
583
|
run_integration_cfg(
|
610
584
|
IntegrationRunConfiguration(
|
611
585
|
integration=integration,
|
612
|
-
valdiate_schemas=ctx["validate_schemas"],
|
613
|
-
dry_run=ctx.
|
614
|
-
early_exit_compare_sha=ctx.
|
586
|
+
valdiate_schemas=ctx.obj["validate_schemas"],
|
587
|
+
dry_run=ctx.obj["dry_run"],
|
588
|
+
early_exit_compare_sha=ctx.obj["early_exit_compare_sha"],
|
615
589
|
check_only_affected_shards=check_only_affected_shards,
|
616
|
-
gql_sha_url=ctx["gql_sha_url"],
|
617
|
-
print_url=ctx["gql_url_print"],
|
590
|
+
gql_sha_url=ctx.obj["gql_sha_url"],
|
591
|
+
print_url=ctx.obj["gql_url_print"],
|
618
592
|
)
|
619
593
|
)
|
620
594
|
except gql.GqlApiIntegrationNotFound as e:
|
@@ -648,18 +622,19 @@ def run_class_integration(
|
|
648
622
|
@log_level
|
649
623
|
@click.pass_context
|
650
624
|
def integration(
|
651
|
-
ctx,
|
652
|
-
configfile,
|
653
|
-
dry_run,
|
654
|
-
early_exit_compare_sha,
|
655
|
-
check_only_affected_shards,
|
656
|
-
validate_schemas,
|
657
|
-
dump_schemas_file,
|
658
|
-
log_level,
|
659
|
-
gql_sha_url,
|
660
|
-
gql_url_print,
|
661
|
-
):
|
625
|
+
ctx: click.Context,
|
626
|
+
configfile: str,
|
627
|
+
dry_run: bool,
|
628
|
+
early_exit_compare_sha: str,
|
629
|
+
check_only_affected_shards: bool,
|
630
|
+
validate_schemas: bool,
|
631
|
+
dump_schemas_file: str | None,
|
632
|
+
log_level: str | None,
|
633
|
+
gql_sha_url: bool,
|
634
|
+
gql_url_print: bool,
|
635
|
+
) -> None:
|
662
636
|
ctx.ensure_object(dict)
|
637
|
+
ctx.obj["gql_url_print"] = not dry_run and gql_url_print
|
663
638
|
|
664
639
|
init_env(
|
665
640
|
log_level=log_level,
|
@@ -667,7 +642,7 @@ def integration(
|
|
667
642
|
dry_run=dry_run,
|
668
643
|
# don't print gql url in dry-run mode - less noisy PR check logs and
|
669
644
|
# the actual SHA is not that important during PR checks
|
670
|
-
print_gql_url=
|
645
|
+
print_gql_url=ctx.obj["gql_url_print"],
|
671
646
|
)
|
672
647
|
|
673
648
|
ctx.obj["dry_run"] = dry_run
|
@@ -675,23 +650,11 @@ def integration(
|
|
675
650
|
ctx.obj["check_only_affected_shards"] = check_only_affected_shards
|
676
651
|
ctx.obj["validate_schemas"] = validate_schemas
|
677
652
|
ctx.obj["gql_sha_url"] = gql_sha_url
|
678
|
-
ctx.obj["gql_url_print"] = not dry_run and bool(gql_url_print)
|
679
653
|
ctx.obj["dump_schemas_file"] = dump_schemas_file
|
680
654
|
|
681
655
|
|
682
656
|
@integration.result_callback()
|
683
|
-
def exit_integration(
|
684
|
-
ctx,
|
685
|
-
configfile,
|
686
|
-
dry_run,
|
687
|
-
early_exit_compare_sha,
|
688
|
-
check_only_affected_shards,
|
689
|
-
validate_schemas,
|
690
|
-
dump_schemas_file,
|
691
|
-
log_level,
|
692
|
-
gql_sha_url,
|
693
|
-
gql_url_print,
|
694
|
-
):
|
657
|
+
def exit_integration(*args: Any, **kwargs: Any) -> None:
|
695
658
|
GqlApiSingleton.close()
|
696
659
|
|
697
660
|
|
@@ -704,13 +667,17 @@ def exit_integration(
|
|
704
667
|
@account_name
|
705
668
|
@click.pass_context
|
706
669
|
def terraform_aws_route53(
|
707
|
-
ctx
|
708
|
-
|
670
|
+
ctx: click.Context,
|
671
|
+
print_to_file: str | None,
|
672
|
+
enable_deletion: bool,
|
673
|
+
thread_pool_size: int,
|
674
|
+
account_name: str | None,
|
675
|
+
) -> None:
|
709
676
|
import reconcile.terraform_aws_route53
|
710
677
|
|
711
678
|
run_integration(
|
712
679
|
reconcile.terraform_aws_route53,
|
713
|
-
ctx
|
680
|
+
ctx,
|
714
681
|
print_to_file,
|
715
682
|
enable_deletion,
|
716
683
|
thread_pool_size,
|
@@ -742,17 +709,17 @@ def terraform_aws_route53(
|
|
742
709
|
@log_cached_log_output
|
743
710
|
@click.pass_context
|
744
711
|
def aws_saml_idp(
|
745
|
-
ctx,
|
746
|
-
print_to_file,
|
747
|
-
enable_deletion,
|
748
|
-
thread_pool_size,
|
749
|
-
account_name,
|
750
|
-
saml_idp_name,
|
751
|
-
saml_metadata_url,
|
752
|
-
enable_extended_early_exit,
|
753
|
-
extended_early_exit_cache_ttl_seconds,
|
754
|
-
log_cached_log_output,
|
755
|
-
):
|
712
|
+
ctx: click.Context,
|
713
|
+
print_to_file: str | None,
|
714
|
+
enable_deletion: bool,
|
715
|
+
thread_pool_size: int,
|
716
|
+
account_name: str | None,
|
717
|
+
saml_idp_name: str,
|
718
|
+
saml_metadata_url: str,
|
719
|
+
enable_extended_early_exit: bool,
|
720
|
+
extended_early_exit_cache_ttl_seconds: int,
|
721
|
+
log_cached_log_output: bool,
|
722
|
+
) -> None:
|
756
723
|
from reconcile.aws_saml_idp.integration import (
|
757
724
|
AwsSamlIdpIntegration,
|
758
725
|
AwsSamlIdpIntegrationParams,
|
@@ -772,24 +739,24 @@ def aws_saml_idp(
|
|
772
739
|
log_cached_log_output=log_cached_log_output,
|
773
740
|
)
|
774
741
|
),
|
775
|
-
ctx=ctx
|
742
|
+
ctx=ctx,
|
776
743
|
)
|
777
744
|
|
778
745
|
|
779
746
|
@integration.command(short_help="Configures the teams and members in a GitHub org.")
|
780
747
|
@click.pass_context
|
781
|
-
def github(ctx):
|
748
|
+
def github(ctx: click.Context) -> None:
|
782
749
|
import reconcile.github_org
|
783
750
|
|
784
|
-
run_integration(reconcile.github_org, ctx
|
751
|
+
run_integration(reconcile.github_org, ctx)
|
785
752
|
|
786
753
|
|
787
754
|
@integration.command(short_help="Configures owners in a GitHub org.")
|
788
755
|
@click.pass_context
|
789
|
-
def github_owners(ctx):
|
756
|
+
def github_owners(ctx: click.Context) -> None:
|
790
757
|
import reconcile.github_owners
|
791
758
|
|
792
|
-
run_integration(reconcile.github_owners, ctx
|
759
|
+
run_integration(reconcile.github_owners, ctx)
|
793
760
|
|
794
761
|
|
795
762
|
@integration.command(short_help="Validate compliance of GitHub user profiles.")
|
@@ -798,12 +765,18 @@ def github_owners(ctx):
|
|
798
765
|
@enable_deletion(default=False)
|
799
766
|
@send_mails(default=False)
|
800
767
|
@click.pass_context
|
801
|
-
def github_users(
|
768
|
+
def github_users(
|
769
|
+
ctx: click.Context,
|
770
|
+
gitlab_project_id: str | None,
|
771
|
+
thread_pool_size: int,
|
772
|
+
enable_deletion: bool,
|
773
|
+
send_mails: bool,
|
774
|
+
) -> None:
|
802
775
|
import reconcile.github_users
|
803
776
|
|
804
777
|
run_integration(
|
805
778
|
reconcile.github_users,
|
806
|
-
ctx
|
779
|
+
ctx,
|
807
780
|
gitlab_project_id,
|
808
781
|
thread_pool_size,
|
809
782
|
enable_deletion,
|
@@ -813,10 +786,10 @@ def github_users(ctx, gitlab_project_id, thread_pool_size, enable_deletion, send
|
|
813
786
|
|
814
787
|
@integration.command(short_help="Validates GitHub organization settings.")
|
815
788
|
@click.pass_context
|
816
|
-
def github_validator(ctx):
|
789
|
+
def github_validator(ctx: click.Context) -> None:
|
817
790
|
import reconcile.github_validator
|
818
791
|
|
819
|
-
run_integration(reconcile.github_validator, ctx
|
792
|
+
run_integration(reconcile.github_validator, ctx)
|
820
793
|
|
821
794
|
|
822
795
|
@integration.command(short_help="Configures ClusterRolebindings in OpenShift clusters.")
|
@@ -826,12 +799,14 @@ def github_validator(ctx):
|
|
826
799
|
@internal()
|
827
800
|
@use_jump_host()
|
828
801
|
@click.pass_context
|
829
|
-
def openshift_clusterrolebindings(
|
802
|
+
def openshift_clusterrolebindings(
|
803
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
804
|
+
) -> None:
|
830
805
|
import reconcile.openshift_clusterrolebindings
|
831
806
|
|
832
807
|
run_integration(
|
833
808
|
reconcile.openshift_clusterrolebindings,
|
834
|
-
ctx
|
809
|
+
ctx,
|
835
810
|
thread_pool_size,
|
836
811
|
internal,
|
837
812
|
use_jump_host,
|
@@ -845,12 +820,14 @@ def openshift_clusterrolebindings(ctx, thread_pool_size, internal, use_jump_host
|
|
845
820
|
@internal()
|
846
821
|
@use_jump_host()
|
847
822
|
@click.pass_context
|
848
|
-
def openshift_rolebindings(
|
823
|
+
def openshift_rolebindings(
|
824
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
825
|
+
) -> None:
|
849
826
|
import reconcile.openshift_rolebindings
|
850
827
|
|
851
828
|
run_integration(
|
852
829
|
reconcile.openshift_rolebindings,
|
853
|
-
ctx
|
830
|
+
ctx,
|
854
831
|
thread_pool_size,
|
855
832
|
internal,
|
856
833
|
use_jump_host,
|
@@ -864,11 +841,13 @@ def openshift_rolebindings(ctx, thread_pool_size, internal, use_jump_host):
|
|
864
841
|
@internal()
|
865
842
|
@use_jump_host()
|
866
843
|
@click.pass_context
|
867
|
-
def openshift_groups(
|
844
|
+
def openshift_groups(
|
845
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
846
|
+
) -> None:
|
868
847
|
import reconcile.openshift_groups
|
869
848
|
|
870
849
|
run_integration(
|
871
|
-
reconcile.openshift_groups, ctx
|
850
|
+
reconcile.openshift_groups, ctx, thread_pool_size, internal, use_jump_host
|
872
851
|
)
|
873
852
|
|
874
853
|
|
@@ -879,11 +858,13 @@ def openshift_groups(ctx, thread_pool_size, internal, use_jump_host):
|
|
879
858
|
@internal()
|
880
859
|
@use_jump_host()
|
881
860
|
@click.pass_context
|
882
|
-
def openshift_users(
|
861
|
+
def openshift_users(
|
862
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
863
|
+
) -> None:
|
883
864
|
import reconcile.openshift_users
|
884
865
|
|
885
866
|
run_integration(
|
886
|
-
reconcile.openshift_users, ctx
|
867
|
+
reconcile.openshift_users, ctx, thread_pool_size, internal, use_jump_host
|
887
868
|
)
|
888
869
|
|
889
870
|
|
@@ -898,13 +879,17 @@ def openshift_users(ctx, thread_pool_size, internal, use_jump_host):
|
|
898
879
|
@vault_output_path
|
899
880
|
@click.pass_context
|
900
881
|
def openshift_serviceaccount_tokens(
|
901
|
-
ctx
|
902
|
-
|
882
|
+
ctx: click.Context,
|
883
|
+
thread_pool_size: int,
|
884
|
+
internal: bool,
|
885
|
+
use_jump_host: bool,
|
886
|
+
vault_output_path: str,
|
887
|
+
) -> None:
|
903
888
|
import reconcile.openshift_serviceaccount_tokens
|
904
889
|
|
905
890
|
run_integration(
|
906
891
|
reconcile.openshift_serviceaccount_tokens,
|
907
|
-
ctx
|
892
|
+
ctx,
|
908
893
|
thread_pool_size,
|
909
894
|
internal,
|
910
895
|
use_jump_host,
|
@@ -938,17 +923,17 @@ def openshift_serviceaccount_tokens(
|
|
938
923
|
@log_cached_log_output
|
939
924
|
@click.pass_context
|
940
925
|
def aws_saml_roles(
|
941
|
-
ctx,
|
942
|
-
print_to_file,
|
943
|
-
enable_deletion,
|
944
|
-
thread_pool_size,
|
945
|
-
account_name,
|
946
|
-
saml_idp_name,
|
947
|
-
max_session_duration_hours,
|
948
|
-
enable_extended_early_exit,
|
949
|
-
extended_early_exit_cache_ttl_seconds,
|
950
|
-
log_cached_log_output,
|
951
|
-
):
|
926
|
+
ctx: click.Context,
|
927
|
+
print_to_file: str | None,
|
928
|
+
enable_deletion: bool,
|
929
|
+
thread_pool_size: int,
|
930
|
+
account_name: str | None,
|
931
|
+
saml_idp_name: str,
|
932
|
+
max_session_duration_hours: int,
|
933
|
+
enable_extended_early_exit: bool,
|
934
|
+
extended_early_exit_cache_ttl_seconds: int,
|
935
|
+
log_cached_log_output: bool,
|
936
|
+
) -> None:
|
952
937
|
from reconcile.aws_saml_roles.integration import (
|
953
938
|
AwsSamlRolesIntegration,
|
954
939
|
AwsSamlRolesIntegrationParams,
|
@@ -968,7 +953,7 @@ def aws_saml_roles(
|
|
968
953
|
log_cached_log_output=log_cached_log_output,
|
969
954
|
)
|
970
955
|
),
|
971
|
-
ctx=ctx
|
956
|
+
ctx=ctx,
|
972
957
|
)
|
973
958
|
|
974
959
|
|
@@ -1019,16 +1004,16 @@ def aws_saml_roles(
|
|
1019
1004
|
)
|
1020
1005
|
@click.pass_context
|
1021
1006
|
def aws_account_manager(
|
1022
|
-
ctx,
|
1023
|
-
account_name,
|
1024
|
-
flavor,
|
1025
|
-
tag,
|
1026
|
-
initial_user_name,
|
1027
|
-
initial_user_policy_arn,
|
1028
|
-
initial_user_secret_vault_path,
|
1029
|
-
account_tmpl_resource,
|
1030
|
-
template_collection_root_path,
|
1031
|
-
):
|
1007
|
+
ctx: click.Context,
|
1008
|
+
account_name: str | None,
|
1009
|
+
flavor: str,
|
1010
|
+
tag: Iterable[tuple[str, str]],
|
1011
|
+
initial_user_name: str,
|
1012
|
+
initial_user_policy_arn: str,
|
1013
|
+
initial_user_secret_vault_path: str,
|
1014
|
+
account_tmpl_resource: str,
|
1015
|
+
template_collection_root_path: str,
|
1016
|
+
) -> None:
|
1032
1017
|
from reconcile.aws_account_manager.integration import (
|
1033
1018
|
AwsAccountMgmtIntegration,
|
1034
1019
|
AwsAccountMgmtIntegrationParams,
|
@@ -1047,7 +1032,7 @@ def aws_account_manager(
|
|
1047
1032
|
template_collection_root_path=template_collection_root_path,
|
1048
1033
|
)
|
1049
1034
|
),
|
1050
|
-
ctx=ctx
|
1035
|
+
ctx=ctx,
|
1051
1036
|
)
|
1052
1037
|
|
1053
1038
|
|
@@ -1067,8 +1052,11 @@ def aws_account_manager(
|
|
1067
1052
|
)
|
1068
1053
|
@click.pass_context
|
1069
1054
|
def terraform_init(
|
1070
|
-
ctx
|
1071
|
-
|
1055
|
+
ctx: click.Context,
|
1056
|
+
account_name: str | None,
|
1057
|
+
state_tmpl_resource: str,
|
1058
|
+
template_collection_root_path: str,
|
1059
|
+
) -> None:
|
1072
1060
|
from reconcile.terraform_init.integration import (
|
1073
1061
|
TerraformInitIntegration,
|
1074
1062
|
TerraformInitIntegrationParams,
|
@@ -1082,24 +1070,24 @@ def terraform_init(
|
|
1082
1070
|
template_collection_root_path=template_collection_root_path,
|
1083
1071
|
)
|
1084
1072
|
),
|
1085
|
-
ctx=ctx
|
1073
|
+
ctx=ctx,
|
1086
1074
|
)
|
1087
1075
|
|
1088
1076
|
|
1089
1077
|
@integration.command(short_help="Manage Jenkins roles association via REST API.")
|
1090
1078
|
@click.pass_context
|
1091
|
-
def jenkins_roles(ctx):
|
1079
|
+
def jenkins_roles(ctx: click.Context) -> None:
|
1092
1080
|
import reconcile.jenkins_roles
|
1093
1081
|
|
1094
|
-
run_integration(reconcile.jenkins_roles, ctx
|
1082
|
+
run_integration(reconcile.jenkins_roles, ctx)
|
1095
1083
|
|
1096
1084
|
|
1097
1085
|
@integration.command(short_help="Manage Jenkins worker fleets via JCasC.")
|
1098
1086
|
@click.pass_context
|
1099
|
-
def jenkins_worker_fleets(ctx):
|
1087
|
+
def jenkins_worker_fleets(ctx: click.Context) -> None:
|
1100
1088
|
import reconcile.jenkins_worker_fleets
|
1101
1089
|
|
1102
|
-
run_integration(reconcile.jenkins_worker_fleets, ctx
|
1090
|
+
run_integration(reconcile.jenkins_worker_fleets, ctx)
|
1103
1091
|
|
1104
1092
|
|
1105
1093
|
@integration.command(
|
@@ -1111,12 +1099,19 @@ def jenkins_worker_fleets(ctx):
|
|
1111
1099
|
@instance_name
|
1112
1100
|
@throughput
|
1113
1101
|
@click.pass_context
|
1114
|
-
def jenkins_job_builder(
|
1102
|
+
def jenkins_job_builder(
|
1103
|
+
ctx: click.Context,
|
1104
|
+
io_dir: str,
|
1105
|
+
print_only: bool,
|
1106
|
+
config_name: str | None,
|
1107
|
+
job_name: str | None,
|
1108
|
+
instance_name: str | None,
|
1109
|
+
) -> None:
|
1115
1110
|
import reconcile.jenkins_job_builder
|
1116
1111
|
|
1117
1112
|
run_integration(
|
1118
1113
|
reconcile.jenkins_job_builder,
|
1119
|
-
ctx
|
1114
|
+
ctx,
|
1120
1115
|
io_dir,
|
1121
1116
|
print_only,
|
1122
1117
|
config_name,
|
@@ -1127,34 +1122,34 @@ def jenkins_job_builder(ctx, io_dir, print_only, config_name, job_name, instance
|
|
1127
1122
|
|
1128
1123
|
@integration.command(short_help="Clean up jenkins job history.")
|
1129
1124
|
@click.pass_context
|
1130
|
-
def jenkins_job_builds_cleaner(ctx):
|
1125
|
+
def jenkins_job_builds_cleaner(ctx: click.Context) -> None:
|
1131
1126
|
import reconcile.jenkins_job_builds_cleaner
|
1132
1127
|
|
1133
|
-
run_integration(reconcile.jenkins_job_builds_cleaner, ctx
|
1128
|
+
run_integration(reconcile.jenkins_job_builds_cleaner, ctx)
|
1134
1129
|
|
1135
1130
|
|
1136
1131
|
@integration.command(short_help="Delete Jenkins jobs in multiple tenant instances.")
|
1137
1132
|
@click.pass_context
|
1138
|
-
def jenkins_job_cleaner(ctx):
|
1133
|
+
def jenkins_job_cleaner(ctx: click.Context) -> None:
|
1139
1134
|
import reconcile.jenkins_job_cleaner
|
1140
1135
|
|
1141
|
-
run_integration(reconcile.jenkins_job_cleaner, ctx
|
1136
|
+
run_integration(reconcile.jenkins_job_cleaner, ctx)
|
1142
1137
|
|
1143
1138
|
|
1144
1139
|
@integration.command(short_help="Manage web hooks to Jenkins jobs.")
|
1145
1140
|
@click.pass_context
|
1146
|
-
def jenkins_webhooks(ctx):
|
1141
|
+
def jenkins_webhooks(ctx: click.Context) -> None:
|
1147
1142
|
import reconcile.jenkins_webhooks
|
1148
1143
|
|
1149
|
-
run_integration(reconcile.jenkins_webhooks, ctx
|
1144
|
+
run_integration(reconcile.jenkins_webhooks, ctx)
|
1150
1145
|
|
1151
1146
|
|
1152
1147
|
@integration.command(short_help="Remove webhooks to previous Jenkins instances.")
|
1153
1148
|
@click.pass_context
|
1154
|
-
def jenkins_webhooks_cleaner(ctx):
|
1149
|
+
def jenkins_webhooks_cleaner(ctx: click.Context) -> None:
|
1155
1150
|
import reconcile.jenkins_webhooks_cleaner
|
1156
1151
|
|
1157
|
-
run_integration(reconcile.jenkins_webhooks_cleaner, ctx
|
1152
|
+
run_integration(reconcile.jenkins_webhooks_cleaner, ctx)
|
1158
1153
|
|
1159
1154
|
|
1160
1155
|
@integration.command(short_help="Validate permissions in Jira.")
|
@@ -1163,12 +1158,14 @@ def jenkins_webhooks_cleaner(ctx):
|
|
1163
1158
|
)
|
1164
1159
|
@click.option("--board-check-interval", help="Check interval in minutes", default=120)
|
1165
1160
|
@click.pass_context
|
1166
|
-
def jira_permissions_validator(
|
1161
|
+
def jira_permissions_validator(
|
1162
|
+
ctx: click.Context, jira_board_name: Iterable[str] | None, board_check_interval: int
|
1163
|
+
) -> None:
|
1167
1164
|
import reconcile.jira_permissions_validator
|
1168
1165
|
|
1169
1166
|
run_integration(
|
1170
1167
|
reconcile.jira_permissions_validator,
|
1171
|
-
ctx
|
1168
|
+
ctx,
|
1172
1169
|
jira_board_name=jira_board_name,
|
1173
1170
|
board_check_interval_sec=board_check_interval * 60,
|
1174
1171
|
)
|
@@ -1176,10 +1173,10 @@ def jira_permissions_validator(ctx, jira_board_name, board_check_interval):
|
|
1176
1173
|
|
1177
1174
|
@integration.command(short_help="Watch for changes in Jira boards and notify on Slack.")
|
1178
1175
|
@click.pass_context
|
1179
|
-
def jira_watcher(ctx):
|
1176
|
+
def jira_watcher(ctx: click.Context) -> None:
|
1180
1177
|
import reconcile.jira_watcher
|
1181
1178
|
|
1182
|
-
run_integration(reconcile.jira_watcher, ctx
|
1179
|
+
run_integration(reconcile.jira_watcher, ctx)
|
1183
1180
|
|
1184
1181
|
|
1185
1182
|
@integration.command(
|
@@ -1191,12 +1188,14 @@ def jira_watcher(ctx):
|
|
1191
1188
|
@internal()
|
1192
1189
|
@use_jump_host()
|
1193
1190
|
@click.pass_context
|
1194
|
-
def openshift_upgrade_watcher(
|
1191
|
+
def openshift_upgrade_watcher(
|
1192
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
1193
|
+
) -> None:
|
1195
1194
|
import reconcile.openshift_upgrade_watcher
|
1196
1195
|
|
1197
1196
|
run_integration(
|
1198
1197
|
reconcile.openshift_upgrade_watcher,
|
1199
|
-
ctx
|
1198
|
+
ctx,
|
1200
1199
|
thread_pool_size,
|
1201
1200
|
internal,
|
1202
1201
|
use_jump_host,
|
@@ -1211,18 +1210,18 @@ def openshift_upgrade_watcher(ctx, thread_pool_size, internal, use_jump_host):
|
|
1211
1210
|
@log_cached_log_output
|
1212
1211
|
@click.pass_context
|
1213
1212
|
def slack_usergroups(
|
1214
|
-
ctx,
|
1215
|
-
workspace_name,
|
1216
|
-
usergroup_name,
|
1217
|
-
enable_extended_early_exit,
|
1218
|
-
extended_early_exit_cache_ttl_seconds,
|
1219
|
-
log_cached_log_output,
|
1220
|
-
):
|
1213
|
+
ctx: click.Context,
|
1214
|
+
workspace_name: str | None,
|
1215
|
+
usergroup_name: str | None,
|
1216
|
+
enable_extended_early_exit: bool,
|
1217
|
+
extended_early_exit_cache_ttl_seconds: int,
|
1218
|
+
log_cached_log_output: bool,
|
1219
|
+
) -> None:
|
1221
1220
|
import reconcile.slack_usergroups
|
1222
1221
|
|
1223
1222
|
run_integration(
|
1224
1223
|
reconcile.slack_usergroups,
|
1225
|
-
ctx
|
1224
|
+
ctx,
|
1226
1225
|
workspace_name,
|
1227
1226
|
usergroup_name,
|
1228
1227
|
enable_extended_early_exit,
|
@@ -1234,10 +1233,10 @@ def slack_usergroups(
|
|
1234
1233
|
@integration.command(short_help="Manage permissions on GitLab projects.")
|
1235
1234
|
@threaded()
|
1236
1235
|
@click.pass_context
|
1237
|
-
def gitlab_permissions(ctx, thread_pool_size):
|
1236
|
+
def gitlab_permissions(ctx: click.Context, thread_pool_size: int) -> None:
|
1238
1237
|
import reconcile.gitlab_permissions
|
1239
1238
|
|
1240
|
-
run_integration(reconcile.gitlab_permissions, ctx
|
1239
|
+
run_integration(reconcile.gitlab_permissions, ctx, thread_pool_size)
|
1241
1240
|
|
1242
1241
|
|
1243
1242
|
@integration.command(short_help="Manage issues and merge requests on GitLab projects.")
|
@@ -1247,75 +1246,77 @@ def gitlab_permissions(ctx, thread_pool_size):
|
|
1247
1246
|
help="wait for pending/running pipelines before acting.",
|
1248
1247
|
)
|
1249
1248
|
@click.pass_context
|
1250
|
-
def gitlab_housekeeping(ctx, wait_for_pipeline):
|
1249
|
+
def gitlab_housekeeping(ctx: click.Context, wait_for_pipeline: bool) -> None:
|
1251
1250
|
import reconcile.gitlab_housekeeping
|
1252
1251
|
|
1253
|
-
run_integration(reconcile.gitlab_housekeeping, ctx
|
1252
|
+
run_integration(reconcile.gitlab_housekeeping, ctx, wait_for_pipeline)
|
1254
1253
|
|
1255
1254
|
|
1256
1255
|
@integration.command(short_help="Listen to SQS and creates MRs out of the messages.")
|
1257
1256
|
@click.argument("gitlab-project-id")
|
1258
1257
|
@click.pass_context
|
1259
|
-
def gitlab_mr_sqs_consumer(ctx, gitlab_project_id):
|
1258
|
+
def gitlab_mr_sqs_consumer(ctx: click.Context, gitlab_project_id: str) -> None:
|
1260
1259
|
import reconcile.gitlab_mr_sqs_consumer
|
1261
1260
|
|
1262
|
-
run_integration(reconcile.gitlab_mr_sqs_consumer, ctx
|
1261
|
+
run_integration(reconcile.gitlab_mr_sqs_consumer, ctx, gitlab_project_id)
|
1263
1262
|
|
1264
1263
|
|
1265
1264
|
@integration.command(short_help="Delete orphan AWS resources.")
|
1266
1265
|
@threaded()
|
1267
1266
|
@click.pass_context
|
1268
|
-
def aws_garbage_collector(ctx, thread_pool_size):
|
1267
|
+
def aws_garbage_collector(ctx: click.Context, thread_pool_size: int) -> None:
|
1269
1268
|
import reconcile.aws_garbage_collector
|
1270
1269
|
|
1271
|
-
run_integration(reconcile.aws_garbage_collector, ctx
|
1270
|
+
run_integration(reconcile.aws_garbage_collector, ctx, thread_pool_size)
|
1272
1271
|
|
1273
1272
|
|
1274
1273
|
@integration.command(short_help="Delete IAM access keys by access key ID.")
|
1275
1274
|
@threaded()
|
1276
1275
|
@account_name
|
1277
1276
|
@click.pass_context
|
1278
|
-
def aws_iam_keys(
|
1277
|
+
def aws_iam_keys(
|
1278
|
+
ctx: click.Context, thread_pool_size: int, account_name: str | None
|
1279
|
+
) -> None:
|
1279
1280
|
import reconcile.aws_iam_keys
|
1280
1281
|
|
1281
1282
|
run_integration(
|
1282
|
-
reconcile.aws_iam_keys, ctx
|
1283
|
+
reconcile.aws_iam_keys, ctx, thread_pool_size, account_name=account_name
|
1283
1284
|
)
|
1284
1285
|
|
1285
1286
|
|
1286
1287
|
@integration.command(short_help="Reset IAM user password by user reference.")
|
1287
1288
|
@click.pass_context
|
1288
|
-
def aws_iam_password_reset(ctx):
|
1289
|
+
def aws_iam_password_reset(ctx: click.Context) -> None:
|
1289
1290
|
import reconcile.aws_iam_password_reset
|
1290
1291
|
|
1291
|
-
run_integration(reconcile.aws_iam_password_reset, ctx
|
1292
|
+
run_integration(reconcile.aws_iam_password_reset, ctx)
|
1292
1293
|
|
1293
1294
|
|
1294
1295
|
@integration.command(short_help="Share AMI and AMI tags between accounts.")
|
1295
1296
|
@click.pass_context
|
1296
|
-
def aws_ami_share(ctx):
|
1297
|
+
def aws_ami_share(ctx: click.Context) -> None:
|
1297
1298
|
import reconcile.aws_ami_share
|
1298
1299
|
|
1299
|
-
run_integration(reconcile.aws_ami_share, ctx
|
1300
|
+
run_integration(reconcile.aws_ami_share, ctx)
|
1300
1301
|
|
1301
1302
|
|
1302
1303
|
@integration.command(short_help="Cleanup old and unused AMIs.")
|
1303
1304
|
@threaded()
|
1304
1305
|
@click.pass_context
|
1305
|
-
def aws_ami_cleanup(ctx, thread_pool_size):
|
1306
|
+
def aws_ami_cleanup(ctx: click.Context, thread_pool_size: int) -> None:
|
1306
1307
|
import reconcile.aws_ami_cleanup.integration
|
1307
1308
|
|
1308
|
-
run_integration(reconcile.aws_ami_cleanup.integration, ctx
|
1309
|
+
run_integration(reconcile.aws_ami_cleanup.integration, ctx, thread_pool_size)
|
1309
1310
|
|
1310
1311
|
|
1311
1312
|
@integration.command(short_help="Set up retention period for Cloudwatch logs.")
|
1312
1313
|
@threaded()
|
1313
1314
|
@click.pass_context
|
1314
|
-
def aws_cloudwatch_log_retention(ctx, thread_pool_size):
|
1315
|
+
def aws_cloudwatch_log_retention(ctx: click.Context, thread_pool_size: int) -> None:
|
1315
1316
|
import reconcile.aws_cloudwatch_log_retention.integration
|
1316
1317
|
|
1317
1318
|
run_integration(
|
1318
|
-
reconcile.aws_cloudwatch_log_retention.integration, ctx
|
1319
|
+
reconcile.aws_cloudwatch_log_retention.integration, ctx, thread_pool_size
|
1319
1320
|
)
|
1320
1321
|
|
1321
1322
|
|
@@ -1324,10 +1325,10 @@ def aws_cloudwatch_log_retention(ctx, thread_pool_size):
|
|
1324
1325
|
)
|
1325
1326
|
@vault_output_path
|
1326
1327
|
@click.pass_context
|
1327
|
-
def aws_ecr_image_pull_secrets(ctx, vault_output_path):
|
1328
|
+
def aws_ecr_image_pull_secrets(ctx: click.Context, vault_output_path: str) -> None:
|
1328
1329
|
import reconcile.aws_ecr_image_pull_secrets
|
1329
1330
|
|
1330
|
-
run_integration(reconcile.aws_ecr_image_pull_secrets, ctx
|
1331
|
+
run_integration(reconcile.aws_ecr_image_pull_secrets, ctx, vault_output_path)
|
1331
1332
|
|
1332
1333
|
|
1333
1334
|
@integration.command(
|
@@ -1337,11 +1338,13 @@ def aws_ecr_image_pull_secrets(ctx, vault_output_path):
|
|
1337
1338
|
@gitlab_project_id
|
1338
1339
|
@threaded()
|
1339
1340
|
@click.pass_context
|
1340
|
-
def aws_support_cases_sos(
|
1341
|
+
def aws_support_cases_sos(
|
1342
|
+
ctx: click.Context, gitlab_project_id: str | None, thread_pool_size: int
|
1343
|
+
) -> None:
|
1341
1344
|
import reconcile.aws_support_cases_sos
|
1342
1345
|
|
1343
1346
|
run_integration(
|
1344
|
-
reconcile.aws_support_cases_sos, ctx
|
1347
|
+
reconcile.aws_support_cases_sos, ctx, gitlab_project_id, thread_pool_size
|
1345
1348
|
)
|
1346
1349
|
|
1347
1350
|
|
@@ -1357,19 +1360,19 @@ def aws_support_cases_sos(ctx, gitlab_project_id, thread_pool_size):
|
|
1357
1360
|
@namespace_name
|
1358
1361
|
@click.pass_context
|
1359
1362
|
def openshift_resources(
|
1360
|
-
ctx,
|
1361
|
-
thread_pool_size,
|
1362
|
-
internal,
|
1363
|
-
use_jump_host,
|
1364
|
-
cluster_name,
|
1365
|
-
exclude_cluster,
|
1366
|
-
namespace_name,
|
1367
|
-
):
|
1363
|
+
ctx: click.Context,
|
1364
|
+
thread_pool_size: int,
|
1365
|
+
internal: bool,
|
1366
|
+
use_jump_host: bool,
|
1367
|
+
cluster_name: Iterable[str] | None,
|
1368
|
+
exclude_cluster: Iterable[str],
|
1369
|
+
namespace_name: str | None,
|
1370
|
+
) -> None:
|
1368
1371
|
import reconcile.openshift_resources
|
1369
1372
|
|
1370
1373
|
run_integration(
|
1371
1374
|
reconcile.openshift_resources,
|
1372
|
-
ctx
|
1375
|
+
ctx,
|
1373
1376
|
thread_pool_size,
|
1374
1377
|
internal,
|
1375
1378
|
use_jump_host,
|
@@ -1392,20 +1395,20 @@ def openshift_resources(
|
|
1392
1395
|
@trigger_reason
|
1393
1396
|
@click.pass_context
|
1394
1397
|
def openshift_saas_deploy(
|
1395
|
-
ctx,
|
1396
|
-
thread_pool_size,
|
1397
|
-
io_dir,
|
1398
|
-
use_jump_host,
|
1399
|
-
saas_file_name,
|
1400
|
-
env_name,
|
1401
|
-
trigger_integration,
|
1402
|
-
trigger_reason,
|
1403
|
-
):
|
1398
|
+
ctx: click.Context,
|
1399
|
+
thread_pool_size: int,
|
1400
|
+
io_dir: str,
|
1401
|
+
use_jump_host: bool,
|
1402
|
+
saas_file_name: str | None,
|
1403
|
+
env_name: str | None,
|
1404
|
+
trigger_integration: str | None,
|
1405
|
+
trigger_reason: str | None,
|
1406
|
+
) -> None:
|
1404
1407
|
import reconcile.openshift_saas_deploy
|
1405
1408
|
|
1406
1409
|
run_integration(
|
1407
1410
|
reconcile.openshift_saas_deploy,
|
1408
|
-
ctx
|
1411
|
+
ctx,
|
1409
1412
|
thread_pool_size=thread_pool_size,
|
1410
1413
|
io_dir=io_dir,
|
1411
1414
|
use_jump_host=use_jump_host,
|
@@ -1431,18 +1434,18 @@ def openshift_saas_deploy(
|
|
1431
1434
|
@use_jump_host()
|
1432
1435
|
@click.pass_context
|
1433
1436
|
def openshift_saas_deploy_change_tester(
|
1434
|
-
ctx,
|
1435
|
-
gitlab_project_id,
|
1436
|
-
gitlab_merge_request_id,
|
1437
|
-
thread_pool_size,
|
1438
|
-
comparison_sha,
|
1439
|
-
use_jump_host,
|
1440
|
-
):
|
1437
|
+
ctx: click.Context,
|
1438
|
+
gitlab_project_id: str,
|
1439
|
+
gitlab_merge_request_id: str,
|
1440
|
+
thread_pool_size: int,
|
1441
|
+
comparison_sha: str | None,
|
1442
|
+
use_jump_host: bool,
|
1443
|
+
) -> None:
|
1441
1444
|
import reconcile.openshift_saas_deploy_change_tester
|
1442
1445
|
|
1443
1446
|
run_integration(
|
1444
1447
|
reconcile.openshift_saas_deploy_change_tester,
|
1445
|
-
ctx
|
1448
|
+
ctx,
|
1446
1449
|
gitlab_project_id,
|
1447
1450
|
gitlab_merge_request_id,
|
1448
1451
|
thread_pool_size,
|
@@ -1453,10 +1456,10 @@ def openshift_saas_deploy_change_tester(
|
|
1453
1456
|
|
1454
1457
|
@integration.command(short_help="Validates Saas files.")
|
1455
1458
|
@click.pass_context
|
1456
|
-
def saas_file_validator(ctx):
|
1459
|
+
def saas_file_validator(ctx: click.Context) -> None:
|
1457
1460
|
import reconcile.saas_file_validator
|
1458
1461
|
|
1459
|
-
run_integration(reconcile.saas_file_validator, ctx
|
1462
|
+
run_integration(reconcile.saas_file_validator, ctx)
|
1460
1463
|
|
1461
1464
|
|
1462
1465
|
@integration.command(short_help="Trigger deployments when a commit changed for a ref.")
|
@@ -1468,13 +1471,17 @@ def saas_file_validator(ctx):
|
|
1468
1471
|
@include_trigger_trace
|
1469
1472
|
@click.pass_context
|
1470
1473
|
def openshift_saas_deploy_trigger_moving_commits(
|
1471
|
-
ctx
|
1472
|
-
|
1474
|
+
ctx: click.Context,
|
1475
|
+
thread_pool_size: int,
|
1476
|
+
internal: bool,
|
1477
|
+
use_jump_host: bool,
|
1478
|
+
include_trigger_trace: bool,
|
1479
|
+
) -> None:
|
1473
1480
|
import reconcile.openshift_saas_deploy_trigger_moving_commits
|
1474
1481
|
|
1475
1482
|
run_integration(
|
1476
1483
|
reconcile.openshift_saas_deploy_trigger_moving_commits,
|
1477
|
-
ctx
|
1484
|
+
ctx,
|
1478
1485
|
thread_pool_size,
|
1479
1486
|
internal,
|
1480
1487
|
use_jump_host,
|
@@ -1491,13 +1498,17 @@ def openshift_saas_deploy_trigger_moving_commits(
|
|
1491
1498
|
@include_trigger_trace
|
1492
1499
|
@click.pass_context
|
1493
1500
|
def openshift_saas_deploy_trigger_upstream_jobs(
|
1494
|
-
ctx
|
1495
|
-
|
1501
|
+
ctx: click.Context,
|
1502
|
+
thread_pool_size: int,
|
1503
|
+
internal: bool,
|
1504
|
+
use_jump_host: bool,
|
1505
|
+
include_trigger_trace: bool,
|
1506
|
+
) -> None:
|
1496
1507
|
import reconcile.openshift_saas_deploy_trigger_upstream_jobs
|
1497
1508
|
|
1498
1509
|
run_integration(
|
1499
1510
|
reconcile.openshift_saas_deploy_trigger_upstream_jobs,
|
1500
|
-
ctx
|
1511
|
+
ctx,
|
1501
1512
|
thread_pool_size,
|
1502
1513
|
internal,
|
1503
1514
|
use_jump_host,
|
@@ -1514,13 +1525,17 @@ def openshift_saas_deploy_trigger_upstream_jobs(
|
|
1514
1525
|
@include_trigger_trace
|
1515
1526
|
@click.pass_context
|
1516
1527
|
def openshift_saas_deploy_trigger_images(
|
1517
|
-
ctx
|
1518
|
-
|
1528
|
+
ctx: click.Context,
|
1529
|
+
thread_pool_size: int,
|
1530
|
+
internal: bool,
|
1531
|
+
use_jump_host: bool,
|
1532
|
+
include_trigger_trace: bool,
|
1533
|
+
) -> None:
|
1519
1534
|
import reconcile.openshift_saas_deploy_trigger_images
|
1520
1535
|
|
1521
1536
|
run_integration(
|
1522
1537
|
reconcile.openshift_saas_deploy_trigger_images,
|
1523
|
-
ctx
|
1538
|
+
ctx,
|
1524
1539
|
thread_pool_size,
|
1525
1540
|
internal,
|
1526
1541
|
use_jump_host,
|
@@ -1537,13 +1552,17 @@ def openshift_saas_deploy_trigger_images(
|
|
1537
1552
|
@include_trigger_trace
|
1538
1553
|
@click.pass_context
|
1539
1554
|
def openshift_saas_deploy_trigger_configs(
|
1540
|
-
ctx
|
1541
|
-
|
1555
|
+
ctx: click.Context,
|
1556
|
+
thread_pool_size: int,
|
1557
|
+
internal: bool,
|
1558
|
+
use_jump_host: bool,
|
1559
|
+
include_trigger_trace: bool,
|
1560
|
+
) -> None:
|
1542
1561
|
import reconcile.openshift_saas_deploy_trigger_configs
|
1543
1562
|
|
1544
1563
|
run_integration(
|
1545
1564
|
reconcile.openshift_saas_deploy_trigger_configs,
|
1546
|
-
ctx
|
1565
|
+
ctx,
|
1547
1566
|
thread_pool_size,
|
1548
1567
|
internal,
|
1549
1568
|
use_jump_host,
|
@@ -1559,13 +1578,13 @@ def openshift_saas_deploy_trigger_configs(
|
|
1559
1578
|
@use_jump_host()
|
1560
1579
|
@click.pass_context
|
1561
1580
|
def openshift_saas_deploy_trigger_cleaner(
|
1562
|
-
ctx, thread_pool_size, internal, use_jump_host
|
1563
|
-
):
|
1581
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
1582
|
+
) -> None:
|
1564
1583
|
import reconcile.openshift_saas_deploy_trigger_cleaner
|
1565
1584
|
|
1566
1585
|
run_integration(
|
1567
1586
|
reconcile.openshift_saas_deploy_trigger_cleaner,
|
1568
|
-
ctx
|
1587
|
+
ctx,
|
1569
1588
|
thread_pool_size,
|
1570
1589
|
internal,
|
1571
1590
|
use_jump_host,
|
@@ -1581,13 +1600,17 @@ def openshift_saas_deploy_trigger_cleaner(
|
|
1581
1600
|
@saas_file_name
|
1582
1601
|
@click.pass_context
|
1583
1602
|
def openshift_tekton_resources(
|
1584
|
-
ctx
|
1585
|
-
|
1603
|
+
ctx: click.Context,
|
1604
|
+
thread_pool_size: int,
|
1605
|
+
internal: bool,
|
1606
|
+
use_jump_host: bool,
|
1607
|
+
saas_file_name: str | None,
|
1608
|
+
) -> None:
|
1586
1609
|
import reconcile.openshift_tekton_resources
|
1587
1610
|
|
1588
1611
|
run_integration(
|
1589
1612
|
reconcile.openshift_tekton_resources,
|
1590
|
-
ctx
|
1613
|
+
ctx,
|
1591
1614
|
thread_pool_size,
|
1592
1615
|
internal,
|
1593
1616
|
use_jump_host,
|
@@ -1601,11 +1624,13 @@ def openshift_tekton_resources(
|
|
1601
1624
|
@click.argument("gitlab-project-id")
|
1602
1625
|
@click.argument("gitlab-merge-request-id")
|
1603
1626
|
@click.pass_context
|
1604
|
-
def gitlab_labeler(
|
1627
|
+
def gitlab_labeler(
|
1628
|
+
ctx: click.Context, gitlab_project_id: str, gitlab_merge_request_id: str
|
1629
|
+
) -> None:
|
1605
1630
|
import reconcile.gitlab_labeler
|
1606
1631
|
|
1607
1632
|
run_integration(
|
1608
|
-
reconcile.gitlab_labeler, ctx
|
1633
|
+
reconcile.gitlab_labeler, ctx, gitlab_project_id, gitlab_merge_request_id
|
1609
1634
|
)
|
1610
1635
|
|
1611
1636
|
|
@@ -1616,12 +1641,14 @@ def gitlab_labeler(ctx, gitlab_project_id, gitlab_merge_request_id):
|
|
1616
1641
|
@internal()
|
1617
1642
|
@use_jump_host()
|
1618
1643
|
@click.pass_context
|
1619
|
-
def openshift_namespace_labels(
|
1644
|
+
def openshift_namespace_labels(
|
1645
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
1646
|
+
) -> None:
|
1620
1647
|
import reconcile.openshift_namespace_labels
|
1621
1648
|
|
1622
1649
|
run_integration(
|
1623
1650
|
reconcile.openshift_namespace_labels,
|
1624
|
-
ctx
|
1651
|
+
ctx,
|
1625
1652
|
thread_pool_size,
|
1626
1653
|
internal,
|
1627
1654
|
use_jump_host,
|
@@ -1638,13 +1665,18 @@ def openshift_namespace_labels(ctx, thread_pool_size, internal, use_jump_host):
|
|
1638
1665
|
@namespace_name
|
1639
1666
|
@click.pass_context
|
1640
1667
|
def openshift_namespaces(
|
1641
|
-
ctx
|
1642
|
-
|
1668
|
+
ctx: click.Context,
|
1669
|
+
thread_pool_size: int,
|
1670
|
+
internal: bool,
|
1671
|
+
use_jump_host: bool,
|
1672
|
+
cluster_name: Iterable[str] | None,
|
1673
|
+
namespace_name: str | None,
|
1674
|
+
) -> None:
|
1643
1675
|
import reconcile.openshift_namespaces
|
1644
1676
|
|
1645
1677
|
run_integration(
|
1646
1678
|
reconcile.openshift_namespaces,
|
1647
|
-
ctx
|
1679
|
+
ctx,
|
1648
1680
|
thread_pool_size,
|
1649
1681
|
internal,
|
1650
1682
|
use_jump_host,
|
@@ -1660,12 +1692,14 @@ def openshift_namespaces(
|
|
1660
1692
|
@internal()
|
1661
1693
|
@use_jump_host()
|
1662
1694
|
@click.pass_context
|
1663
|
-
def openshift_network_policies(
|
1695
|
+
def openshift_network_policies(
|
1696
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
1697
|
+
) -> None:
|
1664
1698
|
import reconcile.openshift_network_policies
|
1665
1699
|
|
1666
1700
|
run_integration(
|
1667
1701
|
reconcile.openshift_network_policies,
|
1668
|
-
ctx
|
1702
|
+
ctx,
|
1669
1703
|
thread_pool_size,
|
1670
1704
|
internal,
|
1671
1705
|
use_jump_host,
|
@@ -1680,12 +1714,18 @@ def openshift_network_policies(ctx, thread_pool_size, internal, use_jump_host):
|
|
1680
1714
|
@internal()
|
1681
1715
|
@use_jump_host()
|
1682
1716
|
@click.pass_context
|
1683
|
-
def openshift_limitranges(
|
1717
|
+
def openshift_limitranges(
|
1718
|
+
ctx: click.Context,
|
1719
|
+
thread_pool_size: int,
|
1720
|
+
internal: bool,
|
1721
|
+
use_jump_host: bool,
|
1722
|
+
take_over: bool,
|
1723
|
+
) -> None:
|
1684
1724
|
import reconcile.openshift_limitranges
|
1685
1725
|
|
1686
1726
|
run_integration(
|
1687
1727
|
reconcile.openshift_limitranges,
|
1688
|
-
ctx
|
1728
|
+
ctx,
|
1689
1729
|
thread_pool_size,
|
1690
1730
|
internal,
|
1691
1731
|
use_jump_host,
|
@@ -1701,12 +1741,18 @@ def openshift_limitranges(ctx, thread_pool_size, internal, use_jump_host, take_o
|
|
1701
1741
|
@internal()
|
1702
1742
|
@use_jump_host()
|
1703
1743
|
@click.pass_context
|
1704
|
-
def openshift_resourcequotas(
|
1744
|
+
def openshift_resourcequotas(
|
1745
|
+
ctx: click.Context,
|
1746
|
+
thread_pool_size: int,
|
1747
|
+
internal: bool,
|
1748
|
+
use_jump_host: bool,
|
1749
|
+
take_over: bool,
|
1750
|
+
) -> None:
|
1705
1751
|
import reconcile.openshift_resourcequotas
|
1706
1752
|
|
1707
1753
|
run_integration(
|
1708
1754
|
reconcile.openshift_resourcequotas,
|
1709
|
-
ctx
|
1755
|
+
ctx,
|
1710
1756
|
thread_pool_size,
|
1711
1757
|
internal,
|
1712
1758
|
use_jump_host,
|
@@ -1724,13 +1770,18 @@ def openshift_resourcequotas(ctx, thread_pool_size, internal, use_jump_host, tak
|
|
1724
1770
|
@namespace_name
|
1725
1771
|
@click.pass_context
|
1726
1772
|
def openshift_vault_secrets(
|
1727
|
-
ctx
|
1728
|
-
|
1773
|
+
ctx: click.Context,
|
1774
|
+
thread_pool_size: int,
|
1775
|
+
internal: bool,
|
1776
|
+
use_jump_host: bool,
|
1777
|
+
cluster_name: Iterable[str] | None,
|
1778
|
+
namespace_name: str | None,
|
1779
|
+
) -> None:
|
1729
1780
|
import reconcile.openshift_vault_secrets
|
1730
1781
|
|
1731
1782
|
run_integration(
|
1732
1783
|
reconcile.openshift_vault_secrets,
|
1733
|
-
ctx
|
1784
|
+
ctx,
|
1734
1785
|
thread_pool_size,
|
1735
1786
|
internal,
|
1736
1787
|
use_jump_host,
|
@@ -1747,12 +1798,18 @@ def openshift_vault_secrets(
|
|
1747
1798
|
@use_jump_host()
|
1748
1799
|
@cluster_name
|
1749
1800
|
@click.pass_context
|
1750
|
-
def openshift_rhcs_certs(
|
1801
|
+
def openshift_rhcs_certs(
|
1802
|
+
ctx: click.Context,
|
1803
|
+
thread_pool_size: int,
|
1804
|
+
internal: bool,
|
1805
|
+
use_jump_host: bool,
|
1806
|
+
cluster_name: Iterable[str] | None,
|
1807
|
+
) -> None:
|
1751
1808
|
import reconcile.openshift_rhcs_certs
|
1752
1809
|
|
1753
1810
|
run_integration(
|
1754
1811
|
reconcile.openshift_rhcs_certs,
|
1755
|
-
ctx
|
1812
|
+
ctx,
|
1756
1813
|
thread_pool_size,
|
1757
1814
|
internal,
|
1758
1815
|
use_jump_host,
|
@@ -1770,13 +1827,18 @@ def openshift_rhcs_certs(ctx, thread_pool_size, internal, use_jump_host, cluster
|
|
1770
1827
|
@namespace_name
|
1771
1828
|
@click.pass_context
|
1772
1829
|
def openshift_routes(
|
1773
|
-
ctx
|
1774
|
-
|
1830
|
+
ctx: click.Context,
|
1831
|
+
thread_pool_size: int,
|
1832
|
+
internal: bool,
|
1833
|
+
use_jump_host: bool,
|
1834
|
+
cluster_name: Iterable[str] | None,
|
1835
|
+
namespace_name: str | None,
|
1836
|
+
) -> None:
|
1775
1837
|
import reconcile.openshift_routes
|
1776
1838
|
|
1777
1839
|
run_integration(
|
1778
1840
|
reconcile.openshift_routes,
|
1779
|
-
ctx
|
1841
|
+
ctx,
|
1780
1842
|
thread_pool_size,
|
1781
1843
|
internal,
|
1782
1844
|
use_jump_host,
|
@@ -1795,13 +1857,18 @@ def openshift_routes(
|
|
1795
1857
|
@namespace_name
|
1796
1858
|
@click.pass_context
|
1797
1859
|
def openshift_prometheus_rules(
|
1798
|
-
ctx
|
1799
|
-
|
1860
|
+
ctx: click.Context,
|
1861
|
+
thread_pool_size: int,
|
1862
|
+
internal: bool,
|
1863
|
+
use_jump_host: bool,
|
1864
|
+
cluster_name: Iterable[str] | None,
|
1865
|
+
namespace_name: str | None,
|
1866
|
+
) -> None:
|
1800
1867
|
import reconcile.openshift_prometheus_rules
|
1801
1868
|
|
1802
1869
|
run_integration(
|
1803
1870
|
reconcile.openshift_prometheus_rules,
|
1804
|
-
ctx
|
1871
|
+
ctx,
|
1805
1872
|
thread_pool_size,
|
1806
1873
|
internal,
|
1807
1874
|
use_jump_host,
|
@@ -1828,17 +1895,17 @@ def openshift_prometheus_rules(
|
|
1828
1895
|
)
|
1829
1896
|
@click.pass_context
|
1830
1897
|
def endpoints_discovery(
|
1831
|
-
ctx,
|
1832
|
-
thread_pool_size,
|
1833
|
-
internal,
|
1834
|
-
use_jump_host,
|
1835
|
-
cluster_name,
|
1836
|
-
enable_extended_early_exit,
|
1837
|
-
extended_early_exit_cache_ttl_seconds,
|
1838
|
-
log_cached_log_output,
|
1839
|
-
app_name,
|
1840
|
-
endpoint_tmpl_resource,
|
1841
|
-
):
|
1898
|
+
ctx: click.Context,
|
1899
|
+
thread_pool_size: int,
|
1900
|
+
internal: bool,
|
1901
|
+
use_jump_host: bool,
|
1902
|
+
cluster_name: Iterable[str] | None,
|
1903
|
+
enable_extended_early_exit: bool,
|
1904
|
+
extended_early_exit_cache_ttl_seconds: int,
|
1905
|
+
log_cached_log_output: bool,
|
1906
|
+
app_name: str | None,
|
1907
|
+
endpoint_tmpl_resource: str | None,
|
1908
|
+
) -> None:
|
1842
1909
|
from reconcile.endpoints_discovery.integration import (
|
1843
1910
|
EndpointsDiscoveryIntegration,
|
1844
1911
|
EndpointsDiscoveryIntegrationParams,
|
@@ -1858,25 +1925,25 @@ def endpoints_discovery(
|
|
1858
1925
|
params.endpoint_tmpl_resource = endpoint_tmpl_resource
|
1859
1926
|
run_class_integration(
|
1860
1927
|
integration=EndpointsDiscoveryIntegration(params),
|
1861
|
-
ctx=ctx
|
1928
|
+
ctx=ctx,
|
1862
1929
|
)
|
1863
1930
|
|
1864
1931
|
|
1865
1932
|
@integration.command(short_help="Configures the teams and members in Quay.")
|
1866
1933
|
@click.pass_context
|
1867
|
-
def quay_membership(ctx):
|
1934
|
+
def quay_membership(ctx: click.Context) -> None:
|
1868
1935
|
import reconcile.quay_membership
|
1869
1936
|
|
1870
|
-
run_integration(reconcile.quay_membership, ctx
|
1937
|
+
run_integration(reconcile.quay_membership, ctx)
|
1871
1938
|
|
1872
1939
|
|
1873
1940
|
@integration.command(short_help="Mirrors external images into GCP Artifact Registry.")
|
1874
1941
|
@click.pass_context
|
1875
1942
|
@binary(["skopeo"])
|
1876
|
-
def gcp_image_mirror(ctx):
|
1943
|
+
def gcp_image_mirror(ctx: click.Context) -> None:
|
1877
1944
|
import reconcile.gcp_image_mirror
|
1878
1945
|
|
1879
|
-
run_integration(reconcile.gcp_image_mirror, ctx
|
1946
|
+
run_integration(reconcile.gcp_image_mirror, ctx)
|
1880
1947
|
|
1881
1948
|
|
1882
1949
|
@integration.command(short_help="Mirrors external images into Quay.")
|
@@ -1916,18 +1983,18 @@ def gcp_image_mirror(ctx):
|
|
1916
1983
|
@click.pass_context
|
1917
1984
|
@binary(["skopeo"])
|
1918
1985
|
def quay_mirror(
|
1919
|
-
ctx,
|
1920
|
-
control_file_dir,
|
1921
|
-
compare_tags,
|
1922
|
-
compare_tags_interval,
|
1923
|
-
repository_url,
|
1924
|
-
exclude_repository_url,
|
1925
|
-
):
|
1986
|
+
ctx: click.Context,
|
1987
|
+
control_file_dir: str | None,
|
1988
|
+
compare_tags: bool | None,
|
1989
|
+
compare_tags_interval: int,
|
1990
|
+
repository_url: Iterable[str] | None,
|
1991
|
+
exclude_repository_url: Iterable[str] | None,
|
1992
|
+
) -> None:
|
1926
1993
|
import reconcile.quay_mirror
|
1927
1994
|
|
1928
1995
|
run_integration(
|
1929
1996
|
reconcile.quay_mirror,
|
1930
|
-
ctx
|
1997
|
+
ctx,
|
1931
1998
|
control_file_dir,
|
1932
1999
|
compare_tags,
|
1933
2000
|
compare_tags_interval,
|
@@ -1975,13 +2042,18 @@ def quay_mirror(
|
|
1975
2042
|
@click.pass_context
|
1976
2043
|
@binary(["skopeo"])
|
1977
2044
|
def quay_mirror_org(
|
1978
|
-
ctx
|
1979
|
-
|
2045
|
+
ctx: click.Context,
|
2046
|
+
control_file_dir: str | None,
|
2047
|
+
compare_tags: bool | None,
|
2048
|
+
compare_tags_interval: int,
|
2049
|
+
org: Iterable[str] | None,
|
2050
|
+
repository: Iterable[str] | None,
|
2051
|
+
) -> None:
|
1980
2052
|
import reconcile.quay_mirror_org
|
1981
2053
|
|
1982
2054
|
run_integration(
|
1983
2055
|
reconcile.quay_mirror_org,
|
1984
|
-
ctx
|
2056
|
+
ctx,
|
1985
2057
|
control_file_dir,
|
1986
2058
|
compare_tags,
|
1987
2059
|
compare_tags_interval,
|
@@ -1992,29 +2064,31 @@ def quay_mirror_org(
|
|
1992
2064
|
|
1993
2065
|
@integration.command(short_help="Creates and Manages Quay Repos.")
|
1994
2066
|
@click.pass_context
|
1995
|
-
def quay_repos(ctx):
|
2067
|
+
def quay_repos(ctx: click.Context) -> None:
|
1996
2068
|
import reconcile.quay_repos
|
1997
2069
|
|
1998
|
-
run_integration(reconcile.quay_repos, ctx
|
2070
|
+
run_integration(reconcile.quay_repos, ctx)
|
1999
2071
|
|
2000
2072
|
|
2001
2073
|
@integration.command(short_help="Manage permissions for Quay Repositories.")
|
2002
2074
|
@click.pass_context
|
2003
|
-
def quay_permissions(ctx):
|
2075
|
+
def quay_permissions(ctx: click.Context) -> None:
|
2004
2076
|
import reconcile.quay_permissions
|
2005
2077
|
|
2006
|
-
run_integration(reconcile.quay_permissions, ctx
|
2078
|
+
run_integration(reconcile.quay_permissions, ctx)
|
2007
2079
|
|
2008
2080
|
|
2009
2081
|
@integration.command(short_help="Removes users which are not found in LDAP search.")
|
2010
2082
|
@click.argument("app-interface-project-id")
|
2011
2083
|
@click.argument("infra-project-id")
|
2012
2084
|
@click.pass_context
|
2013
|
-
def ldap_users(
|
2085
|
+
def ldap_users(
|
2086
|
+
ctx: click.Context, infra_project_id: str, app_interface_project_id: str
|
2087
|
+
) -> None:
|
2014
2088
|
import reconcile.ldap_users
|
2015
2089
|
|
2016
2090
|
run_integration(
|
2017
|
-
reconcile.ldap_users, ctx
|
2091
|
+
reconcile.ldap_users, ctx, app_interface_project_id, infra_project_id
|
2018
2092
|
)
|
2019
2093
|
|
2020
2094
|
|
@@ -2026,7 +2100,7 @@ def ldap_users(ctx, infra_project_id, app_interface_project_id):
|
|
2026
2100
|
default="it-cloud-aws",
|
2027
2101
|
)
|
2028
2102
|
@click.pass_context
|
2029
|
-
def ldap_groups(ctx, aws_sso_namespace):
|
2103
|
+
def ldap_groups(ctx: click.Context, aws_sso_namespace: str) -> None:
|
2030
2104
|
from reconcile.ldap_groups.integration import (
|
2031
2105
|
LdapGroupsIntegration,
|
2032
2106
|
LdapGroupsIntegrationParams,
|
@@ -2036,7 +2110,7 @@ def ldap_groups(ctx, aws_sso_namespace):
|
|
2036
2110
|
integration=LdapGroupsIntegration(
|
2037
2111
|
LdapGroupsIntegrationParams(aws_sso_namespace=aws_sso_namespace)
|
2038
2112
|
),
|
2039
|
-
ctx=ctx
|
2113
|
+
ctx=ctx,
|
2040
2114
|
)
|
2041
2115
|
|
2042
2116
|
|
@@ -2067,12 +2141,12 @@ def ldap_groups(ctx, aws_sso_namespace):
|
|
2067
2141
|
)
|
2068
2142
|
@click.pass_context
|
2069
2143
|
def aws_version_sync(
|
2070
|
-
ctx,
|
2071
|
-
aws_resource_exporter_clusters,
|
2072
|
-
clusters,
|
2073
|
-
supported_providers,
|
2074
|
-
prometheus_timeout,
|
2075
|
-
):
|
2144
|
+
ctx: click.Context,
|
2145
|
+
aws_resource_exporter_clusters: str,
|
2146
|
+
clusters: str | None,
|
2147
|
+
supported_providers: str | None,
|
2148
|
+
prometheus_timeout: str | None,
|
2149
|
+
) -> None:
|
2076
2150
|
from reconcile.aws_version_sync.integration import (
|
2077
2151
|
AVSIntegration,
|
2078
2152
|
AVSIntegrationParams,
|
@@ -2093,7 +2167,7 @@ def aws_version_sync(
|
|
2093
2167
|
else 10,
|
2094
2168
|
)
|
2095
2169
|
),
|
2096
|
-
ctx=ctx
|
2170
|
+
ctx=ctx,
|
2097
2171
|
)
|
2098
2172
|
|
2099
2173
|
|
@@ -2106,7 +2180,12 @@ def aws_version_sync(
|
|
2106
2180
|
@click.argument("gitlab-project-id", required=False)
|
2107
2181
|
@click.argument("gitlab-merge-request-id", required=False)
|
2108
2182
|
@click.pass_context
|
2109
|
-
def terraform_repo(
|
2183
|
+
def terraform_repo(
|
2184
|
+
ctx: click.Context,
|
2185
|
+
output_file: str | None,
|
2186
|
+
gitlab_project_id: str | None,
|
2187
|
+
gitlab_merge_request_id: str | None,
|
2188
|
+
) -> None:
|
2110
2189
|
from reconcile import terraform_repo
|
2111
2190
|
|
2112
2191
|
run_class_integration(
|
@@ -2118,18 +2197,18 @@ def terraform_repo(ctx, output_file, gitlab_project_id, gitlab_merge_request_id)
|
|
2118
2197
|
gitlab_merge_request_id=gitlab_merge_request_id,
|
2119
2198
|
)
|
2120
2199
|
),
|
2121
|
-
ctx=ctx
|
2200
|
+
ctx=ctx,
|
2122
2201
|
)
|
2123
2202
|
|
2124
2203
|
|
2125
2204
|
@integration.command(short_help="Test app-interface templates.")
|
2126
2205
|
@click.pass_context
|
2127
|
-
def template_validator(ctx):
|
2206
|
+
def template_validator(ctx: click.Context) -> None:
|
2128
2207
|
from reconcile.templating import validator
|
2129
2208
|
|
2130
2209
|
run_class_integration(
|
2131
2210
|
integration=validator.TemplateValidatorIntegration(PydanticRunParams()),
|
2132
|
-
ctx=ctx
|
2211
|
+
ctx=ctx,
|
2133
2212
|
)
|
2134
2213
|
|
2135
2214
|
|
@@ -2153,8 +2232,11 @@ def template_validator(ctx):
|
|
2153
2232
|
)
|
2154
2233
|
@click.pass_context
|
2155
2234
|
def template_renderer(
|
2156
|
-
ctx
|
2157
|
-
|
2235
|
+
ctx: click.Context,
|
2236
|
+
app_interface_data_path: str | None,
|
2237
|
+
clone_repo: bool,
|
2238
|
+
template_collection_name: str | None,
|
2239
|
+
) -> None:
|
2158
2240
|
from reconcile.templating.renderer import (
|
2159
2241
|
TemplateRendererIntegration,
|
2160
2242
|
TemplateRendererIntegrationParams,
|
@@ -2168,7 +2250,7 @@ def template_renderer(
|
|
2168
2250
|
template_collection_name=template_collection_name,
|
2169
2251
|
)
|
2170
2252
|
),
|
2171
|
-
ctx=ctx
|
2253
|
+
ctx=ctx,
|
2172
2254
|
)
|
2173
2255
|
|
2174
2256
|
|
@@ -2194,27 +2276,27 @@ def template_renderer(
|
|
2194
2276
|
)
|
2195
2277
|
@click.pass_context
|
2196
2278
|
def terraform_resources(
|
2197
|
-
ctx,
|
2198
|
-
print_to_file,
|
2199
|
-
enable_deletion,
|
2200
|
-
thread_pool_size,
|
2201
|
-
internal,
|
2202
|
-
use_jump_host,
|
2203
|
-
light,
|
2204
|
-
vault_output_path,
|
2205
|
-
account_name,
|
2206
|
-
exclude_accounts,
|
2207
|
-
enable_extended_early_exit,
|
2208
|
-
extended_early_exit_cache_ttl_seconds,
|
2209
|
-
log_cached_log_output,
|
2210
|
-
):
|
2279
|
+
ctx: click.Context,
|
2280
|
+
print_to_file: str | None,
|
2281
|
+
enable_deletion: bool,
|
2282
|
+
thread_pool_size: int,
|
2283
|
+
internal: bool,
|
2284
|
+
use_jump_host: bool,
|
2285
|
+
light: bool,
|
2286
|
+
vault_output_path: str,
|
2287
|
+
account_name: Iterable[str] | None,
|
2288
|
+
exclude_accounts: Iterable[str],
|
2289
|
+
enable_extended_early_exit: bool,
|
2290
|
+
extended_early_exit_cache_ttl_seconds: int,
|
2291
|
+
log_cached_log_output: bool,
|
2292
|
+
) -> None:
|
2211
2293
|
import reconcile.terraform_resources
|
2212
2294
|
|
2213
2295
|
if print_to_file and is_file_in_git_repo(print_to_file):
|
2214
2296
|
raise PrintToFileInGitRepositoryError(print_to_file)
|
2215
2297
|
run_integration(
|
2216
2298
|
reconcile.terraform_resources,
|
2217
|
-
ctx
|
2299
|
+
ctx,
|
2218
2300
|
print_to_file,
|
2219
2301
|
enable_deletion,
|
2220
2302
|
thread_pool_size,
|
@@ -2242,20 +2324,20 @@ def terraform_resources(
|
|
2242
2324
|
@internal()
|
2243
2325
|
@click.pass_context
|
2244
2326
|
def terraform_cloudflare_resources(
|
2245
|
-
ctx,
|
2246
|
-
print_to_file,
|
2247
|
-
enable_deletion,
|
2248
|
-
thread_pool_size,
|
2249
|
-
account_name,
|
2250
|
-
vault_output_path,
|
2251
|
-
internal,
|
2252
|
-
use_jump_host,
|
2253
|
-
):
|
2327
|
+
ctx: click.Context,
|
2328
|
+
print_to_file: str | None,
|
2329
|
+
enable_deletion: bool,
|
2330
|
+
thread_pool_size: int,
|
2331
|
+
account_name: str | None,
|
2332
|
+
vault_output_path: str,
|
2333
|
+
internal: bool,
|
2334
|
+
use_jump_host: bool,
|
2335
|
+
) -> None:
|
2254
2336
|
import reconcile.terraform_cloudflare_resources
|
2255
2337
|
|
2256
2338
|
run_integration(
|
2257
2339
|
reconcile.terraform_cloudflare_resources,
|
2258
|
-
ctx
|
2340
|
+
ctx,
|
2259
2341
|
print_to_file,
|
2260
2342
|
enable_deletion,
|
2261
2343
|
thread_pool_size,
|
@@ -2276,8 +2358,13 @@ def terraform_cloudflare_resources(
|
|
2276
2358
|
@cloudflare_zone_name
|
2277
2359
|
@click.pass_context
|
2278
2360
|
def terraform_cloudflare_dns(
|
2279
|
-
ctx
|
2280
|
-
|
2361
|
+
ctx: click.Context,
|
2362
|
+
print_to_file: str | None,
|
2363
|
+
enable_deletion: bool,
|
2364
|
+
thread_pool_size: int,
|
2365
|
+
account_name: str | None,
|
2366
|
+
zone_name: str | None,
|
2367
|
+
) -> None:
|
2281
2368
|
from reconcile import terraform_cloudflare_dns
|
2282
2369
|
|
2283
2370
|
run_class_integration(
|
@@ -2290,7 +2377,7 @@ def terraform_cloudflare_dns(
|
|
2290
2377
|
selected_zone=zone_name,
|
2291
2378
|
)
|
2292
2379
|
),
|
2293
|
-
ctx=ctx
|
2380
|
+
ctx=ctx,
|
2294
2381
|
)
|
2295
2382
|
|
2296
2383
|
|
@@ -2303,8 +2390,12 @@ def terraform_cloudflare_dns(
|
|
2303
2390
|
@enable_deletion(default=True)
|
2304
2391
|
@click.pass_context
|
2305
2392
|
def terraform_cloudflare_users(
|
2306
|
-
ctx
|
2307
|
-
|
2393
|
+
ctx: click.Context,
|
2394
|
+
print_to_file: str | None,
|
2395
|
+
account_name: str | None,
|
2396
|
+
thread_pool_size: int,
|
2397
|
+
enable_deletion: bool,
|
2398
|
+
) -> None:
|
2308
2399
|
from reconcile.terraform_cloudflare_users import (
|
2309
2400
|
TerraformCloudflareUsers,
|
2310
2401
|
TerraformCloudflareUsersParams,
|
@@ -2319,7 +2410,7 @@ def terraform_cloudflare_users(
|
|
2319
2410
|
enable_deletion=enable_deletion,
|
2320
2411
|
)
|
2321
2412
|
),
|
2322
|
-
ctx
|
2413
|
+
ctx,
|
2323
2414
|
)
|
2324
2415
|
|
2325
2416
|
|
@@ -2330,15 +2421,15 @@ def terraform_cloudflare_users(
|
|
2330
2421
|
@threaded()
|
2331
2422
|
@click.pass_context
|
2332
2423
|
def cna_resources(
|
2333
|
-
ctx,
|
2334
|
-
enable_deletion,
|
2335
|
-
thread_pool_size,
|
2336
|
-
):
|
2424
|
+
ctx: click.Context,
|
2425
|
+
enable_deletion: bool,
|
2426
|
+
thread_pool_size: int,
|
2427
|
+
) -> None:
|
2337
2428
|
import reconcile.cna.integration
|
2338
2429
|
|
2339
2430
|
run_integration(
|
2340
2431
|
reconcile.cna.integration,
|
2341
|
-
ctx
|
2432
|
+
ctx,
|
2342
2433
|
enable_deletion,
|
2343
2434
|
thread_pool_size,
|
2344
2435
|
)
|
@@ -2350,16 +2441,16 @@ def cna_resources(
|
|
2350
2441
|
@click.option("--app-name", default=None, help="app to filter saas files by.")
|
2351
2442
|
@click.pass_context
|
2352
2443
|
def saas_auto_promotions_manager(
|
2353
|
-
ctx,
|
2354
|
-
thread_pool_size,
|
2355
|
-
env_name,
|
2356
|
-
app_name,
|
2357
|
-
):
|
2444
|
+
ctx: click.Context,
|
2445
|
+
thread_pool_size: int,
|
2446
|
+
env_name: str | None,
|
2447
|
+
app_name: str | None,
|
2448
|
+
) -> None:
|
2358
2449
|
import reconcile.saas_auto_promotions_manager.integration
|
2359
2450
|
|
2360
2451
|
run_integration(
|
2361
2452
|
reconcile.saas_auto_promotions_manager.integration,
|
2362
|
-
ctx
|
2453
|
+
ctx,
|
2363
2454
|
thread_pool_size,
|
2364
2455
|
env_name=env_name,
|
2365
2456
|
app_name=app_name,
|
@@ -2376,20 +2467,20 @@ def saas_auto_promotions_manager(
|
|
2376
2467
|
@account_name
|
2377
2468
|
@click.pass_context
|
2378
2469
|
def terraform_users(
|
2379
|
-
ctx,
|
2380
|
-
print_to_file,
|
2381
|
-
enable_deletion,
|
2382
|
-
thread_pool_size,
|
2383
|
-
send_mails,
|
2384
|
-
account_name,
|
2385
|
-
):
|
2470
|
+
ctx: click.Context,
|
2471
|
+
print_to_file: str | None,
|
2472
|
+
enable_deletion: bool,
|
2473
|
+
thread_pool_size: int,
|
2474
|
+
send_mails: bool,
|
2475
|
+
account_name: str | None,
|
2476
|
+
) -> None:
|
2386
2477
|
import reconcile.terraform_users
|
2387
2478
|
|
2388
2479
|
if print_to_file and is_file_in_git_repo(print_to_file):
|
2389
2480
|
raise PrintToFileInGitRepositoryError(print_to_file)
|
2390
2481
|
run_integration(
|
2391
2482
|
reconcile.terraform_users,
|
2392
|
-
ctx
|
2483
|
+
ctx,
|
2393
2484
|
print_to_file,
|
2394
2485
|
enable_deletion,
|
2395
2486
|
thread_pool_size,
|
@@ -2407,8 +2498,12 @@ def terraform_users(
|
|
2407
2498
|
@enable_deletion(default=False)
|
2408
2499
|
@click.pass_context
|
2409
2500
|
def terraform_vpc_resources(
|
2410
|
-
ctx
|
2411
|
-
|
2501
|
+
ctx: click.Context,
|
2502
|
+
account_name: str | None,
|
2503
|
+
print_to_file: str | None,
|
2504
|
+
thread_pool_size: int,
|
2505
|
+
enable_deletion: bool,
|
2506
|
+
) -> None:
|
2412
2507
|
from reconcile.terraform_vpc_resources.integration import (
|
2413
2508
|
TerraformVpcResources,
|
2414
2509
|
TerraformVpcResourcesParams,
|
@@ -2423,7 +2518,7 @@ def terraform_vpc_resources(
|
|
2423
2518
|
enable_deletion=enable_deletion,
|
2424
2519
|
)
|
2425
2520
|
),
|
2426
|
-
ctx
|
2521
|
+
ctx,
|
2427
2522
|
)
|
2428
2523
|
|
2429
2524
|
|
@@ -2441,22 +2536,22 @@ def terraform_vpc_resources(
|
|
2441
2536
|
@log_cached_log_output
|
2442
2537
|
@click.pass_context
|
2443
2538
|
def terraform_vpc_peerings(
|
2444
|
-
ctx,
|
2445
|
-
print_to_file,
|
2446
|
-
enable_deletion,
|
2447
|
-
thread_pool_size,
|
2448
|
-
account_name,
|
2449
|
-
enable_extended_early_exit,
|
2450
|
-
extended_early_exit_cache_ttl_seconds,
|
2451
|
-
log_cached_log_output,
|
2452
|
-
):
|
2539
|
+
ctx: click.Context,
|
2540
|
+
print_to_file: str | None,
|
2541
|
+
enable_deletion: bool,
|
2542
|
+
thread_pool_size: int,
|
2543
|
+
account_name: str | None,
|
2544
|
+
enable_extended_early_exit: bool,
|
2545
|
+
extended_early_exit_cache_ttl_seconds: int,
|
2546
|
+
log_cached_log_output: bool,
|
2547
|
+
) -> None:
|
2453
2548
|
import reconcile.terraform_vpc_peerings
|
2454
2549
|
|
2455
2550
|
if print_to_file and is_file_in_git_repo(print_to_file):
|
2456
2551
|
raise PrintToFileInGitRepositoryError(print_to_file)
|
2457
2552
|
run_integration(
|
2458
2553
|
reconcile.terraform_vpc_peerings,
|
2459
|
-
ctx
|
2554
|
+
ctx,
|
2460
2555
|
print_to_file,
|
2461
2556
|
enable_deletion,
|
2462
2557
|
thread_pool_size,
|
@@ -2471,12 +2566,12 @@ def terraform_vpc_peerings(
|
|
2471
2566
|
short_help="Validates that VPC peerings do not exist between public and internal clusters."
|
2472
2567
|
)
|
2473
2568
|
@click.pass_context
|
2474
|
-
def vpc_peerings_validator(ctx):
|
2569
|
+
def vpc_peerings_validator(ctx: click.Context) -> None:
|
2475
2570
|
import reconcile.vpc_peerings_validator
|
2476
2571
|
|
2477
2572
|
run_integration(
|
2478
2573
|
reconcile.vpc_peerings_validator,
|
2479
|
-
ctx
|
2574
|
+
ctx,
|
2480
2575
|
)
|
2481
2576
|
|
2482
2577
|
|
@@ -2492,22 +2587,22 @@ def vpc_peerings_validator(ctx):
|
|
2492
2587
|
@account_name
|
2493
2588
|
@click.pass_context
|
2494
2589
|
def terraform_tgw_attachments(
|
2495
|
-
ctx,
|
2496
|
-
print_to_file,
|
2497
|
-
enable_deletion,
|
2498
|
-
thread_pool_size,
|
2499
|
-
account_name,
|
2500
|
-
enable_extended_early_exit,
|
2501
|
-
extended_early_exit_cache_ttl_seconds,
|
2502
|
-
log_cached_log_output,
|
2503
|
-
):
|
2590
|
+
ctx: click.Context,
|
2591
|
+
print_to_file: str | None,
|
2592
|
+
enable_deletion: bool,
|
2593
|
+
thread_pool_size: int,
|
2594
|
+
account_name: str | None,
|
2595
|
+
enable_extended_early_exit: bool,
|
2596
|
+
extended_early_exit_cache_ttl_seconds: int,
|
2597
|
+
log_cached_log_output: bool,
|
2598
|
+
) -> None:
|
2504
2599
|
import reconcile.terraform_tgw_attachments
|
2505
2600
|
|
2506
2601
|
if print_to_file and is_file_in_git_repo(print_to_file):
|
2507
2602
|
raise PrintToFileInGitRepositoryError(print_to_file)
|
2508
2603
|
run_integration(
|
2509
2604
|
reconcile.terraform_tgw_attachments,
|
2510
|
-
ctx
|
2605
|
+
ctx,
|
2511
2606
|
print_to_file,
|
2512
2607
|
enable_deletion,
|
2513
2608
|
thread_pool_size,
|
@@ -2522,44 +2617,44 @@ def terraform_tgw_attachments(
|
|
2522
2617
|
short_help="Accept GitHub repository invitations for known repositories."
|
2523
2618
|
)
|
2524
2619
|
@click.pass_context
|
2525
|
-
def github_repo_invites(ctx):
|
2620
|
+
def github_repo_invites(ctx: click.Context) -> None:
|
2526
2621
|
import reconcile.github_repo_invites
|
2527
2622
|
|
2528
|
-
run_integration(reconcile.github_repo_invites, ctx
|
2623
|
+
run_integration(reconcile.github_repo_invites, ctx)
|
2529
2624
|
|
2530
2625
|
|
2531
2626
|
@integration.command(short_help="Validates permissions in github repositories.")
|
2532
2627
|
@click.argument("instance-name")
|
2533
2628
|
@click.pass_context
|
2534
|
-
def github_repo_permissions_validator(ctx, instance_name):
|
2629
|
+
def github_repo_permissions_validator(ctx: click.Context, instance_name: str) -> None:
|
2535
2630
|
import reconcile.github_repo_permissions_validator
|
2536
2631
|
|
2537
|
-
run_integration(reconcile.github_repo_permissions_validator, ctx
|
2632
|
+
run_integration(reconcile.github_repo_permissions_validator, ctx, instance_name)
|
2538
2633
|
|
2539
2634
|
|
2540
2635
|
@integration.command(short_help="Manage GitLab group members.")
|
2541
2636
|
@click.pass_context
|
2542
|
-
def gitlab_members(ctx):
|
2637
|
+
def gitlab_members(ctx: click.Context) -> None:
|
2543
2638
|
import reconcile.gitlab_members
|
2544
2639
|
|
2545
|
-
run_integration(reconcile.gitlab_members, ctx
|
2640
|
+
run_integration(reconcile.gitlab_members, ctx)
|
2546
2641
|
|
2547
2642
|
|
2548
2643
|
@integration.command(short_help="Create GitLab projects.")
|
2549
2644
|
@click.pass_context
|
2550
|
-
def gitlab_projects(ctx):
|
2645
|
+
def gitlab_projects(ctx: click.Context) -> None:
|
2551
2646
|
import reconcile.gitlab_projects
|
2552
2647
|
|
2553
|
-
run_integration(reconcile.gitlab_projects, ctx
|
2648
|
+
run_integration(reconcile.gitlab_projects, ctx)
|
2554
2649
|
|
2555
2650
|
|
2556
2651
|
@integration.command(short_help="Manage membership in OpenShift groups via OCM.")
|
2557
2652
|
@threaded()
|
2558
2653
|
@click.pass_context
|
2559
|
-
def ocm_groups(ctx, thread_pool_size):
|
2654
|
+
def ocm_groups(ctx: click.Context, thread_pool_size: int) -> None:
|
2560
2655
|
import reconcile.ocm_groups
|
2561
2656
|
|
2562
|
-
run_integration(reconcile.ocm_groups, ctx
|
2657
|
+
run_integration(reconcile.ocm_groups, ctx, thread_pool_size)
|
2563
2658
|
|
2564
2659
|
|
2565
2660
|
@integration.command(short_help="Manages clusters via OCM.")
|
@@ -2597,7 +2692,7 @@ def ocm_groups(ctx, thread_pool_size):
|
|
2597
2692
|
)
|
2598
2693
|
@click.pass_context
|
2599
2694
|
def ocm_clusters(
|
2600
|
-
ctx,
|
2695
|
+
ctx: click.Context,
|
2601
2696
|
gitlab_project_id: str | None,
|
2602
2697
|
thread_pool_size: int,
|
2603
2698
|
job_controller_cluster: str | None,
|
@@ -2605,7 +2700,7 @@ def ocm_clusters(
|
|
2605
2700
|
rosa_job_service_account: str | None,
|
2606
2701
|
rosa_role: str | None,
|
2607
2702
|
rosa_job_image: str | None,
|
2608
|
-
):
|
2703
|
+
) -> None:
|
2609
2704
|
from reconcile.ocm_clusters import (
|
2610
2705
|
OcmClusters,
|
2611
2706
|
OcmClustersParams,
|
@@ -2623,78 +2718,52 @@ def ocm_clusters(
|
|
2623
2718
|
rosa_role=rosa_role,
|
2624
2719
|
)
|
2625
2720
|
),
|
2626
|
-
ctx=ctx
|
2721
|
+
ctx=ctx,
|
2627
2722
|
)
|
2628
2723
|
|
2629
2724
|
|
2630
|
-
def vault_creds_path(function):
|
2631
|
-
function = click.option(
|
2632
|
-
"--vault-creds-path",
|
2633
|
-
help="path in Vault to store creds.",
|
2634
|
-
default="app-sre/creds/kube-configs",
|
2635
|
-
)(function)
|
2636
|
-
|
2637
|
-
return function
|
2638
|
-
|
2639
|
-
|
2640
|
-
def dedicated_admin_namespace(function):
|
2641
|
-
function = click.option(
|
2642
|
-
"--dedicated-admin-namespace",
|
2643
|
-
default="dedicated-admin",
|
2644
|
-
help="namespace for the dedicated-admin bot",
|
2645
|
-
)(function)
|
2646
|
-
return function
|
2647
|
-
|
2648
|
-
|
2649
|
-
def dedicated_admin_service_account(function):
|
2650
|
-
function = click.option(
|
2651
|
-
"--dedicated-admin-service-account",
|
2652
|
-
default="app-sre",
|
2653
|
-
help="service account name for the dedicated-admin bot",
|
2654
|
-
)(function)
|
2655
|
-
return function
|
2656
|
-
|
2657
|
-
|
2658
|
-
def cluster_admin_namespace(function):
|
2659
|
-
function = click.option(
|
2660
|
-
"--cluster-admin-namespace",
|
2661
|
-
default="app-sre",
|
2662
|
-
help="namespace for the cluster-admin bot",
|
2663
|
-
)(function)
|
2664
|
-
return function
|
2665
|
-
|
2666
|
-
|
2667
|
-
def cluster_admin_service_account(function):
|
2668
|
-
function = click.option(
|
2669
|
-
"--cluster-admin-service-account",
|
2670
|
-
default="app-sre-cluster-admin-bot",
|
2671
|
-
help="service account name for the cluster-admin bot",
|
2672
|
-
)(function)
|
2673
|
-
return function
|
2674
|
-
|
2675
|
-
|
2676
2725
|
@integration.command(short_help="Manages dedicated-admin and cluster-admin creds.")
|
2677
2726
|
@gitlab_project_id
|
2678
|
-
@
|
2679
|
-
|
2680
|
-
|
2681
|
-
|
2682
|
-
|
2727
|
+
@click.option(
|
2728
|
+
"--vault-creds-path",
|
2729
|
+
help="path in Vault to store creds.",
|
2730
|
+
default="app-sre/creds/kube-configs",
|
2731
|
+
)
|
2732
|
+
@click.option(
|
2733
|
+
"--dedicated-admin-namespace",
|
2734
|
+
default="dedicated-admin",
|
2735
|
+
help="namespace for the dedicated-admin bot",
|
2736
|
+
)
|
2737
|
+
@click.option(
|
2738
|
+
"--dedicated-admin-service-account",
|
2739
|
+
default="app-sre",
|
2740
|
+
help="service account name for the dedicated-admin bot",
|
2741
|
+
)
|
2742
|
+
@click.option(
|
2743
|
+
"--cluster-admin-namespace",
|
2744
|
+
default="app-sre",
|
2745
|
+
help="namespace for the cluster-admin bot",
|
2746
|
+
)
|
2747
|
+
@click.option(
|
2748
|
+
"--cluster-admin-service-account",
|
2749
|
+
default="app-sre-cluster-admin-bot",
|
2750
|
+
help="service account name for the cluster-admin bot",
|
2751
|
+
)
|
2683
2752
|
@click.pass_context
|
2684
2753
|
def openshift_cluster_bots(
|
2685
|
-
ctx,
|
2686
|
-
gitlab_project_id,
|
2687
|
-
vault_creds_path,
|
2688
|
-
dedicated_admin_namespace,
|
2689
|
-
dedicated_admin_service_account,
|
2690
|
-
cluster_admin_namespace,
|
2691
|
-
cluster_admin_service_account,
|
2692
|
-
):
|
2754
|
+
ctx: click.Context,
|
2755
|
+
gitlab_project_id: str | None,
|
2756
|
+
vault_creds_path: str,
|
2757
|
+
dedicated_admin_namespace: str,
|
2758
|
+
dedicated_admin_service_account: str,
|
2759
|
+
cluster_admin_namespace: str,
|
2760
|
+
cluster_admin_service_account: str,
|
2761
|
+
) -> None:
|
2693
2762
|
import reconcile.openshift_cluster_bots
|
2694
2763
|
|
2695
2764
|
run_integration(
|
2696
2765
|
reconcile.openshift_cluster_bots,
|
2697
|
-
ctx
|
2766
|
+
ctx,
|
2698
2767
|
gitlab_project_id,
|
2699
2768
|
vault_creds_path,
|
2700
2769
|
dedicated_admin_ns=dedicated_admin_namespace,
|
@@ -2707,28 +2776,28 @@ def openshift_cluster_bots(
|
|
2707
2776
|
@integration.command(short_help="Manage External Configuration labels in OCM.")
|
2708
2777
|
@threaded()
|
2709
2778
|
@click.pass_context
|
2710
|
-
def ocm_external_configuration_labels(
|
2779
|
+
def ocm_external_configuration_labels(
|
2780
|
+
ctx: click.Context, thread_pool_size: int
|
2781
|
+
) -> None:
|
2711
2782
|
import reconcile.ocm_external_configuration_labels
|
2712
2783
|
|
2713
|
-
run_integration(
|
2714
|
-
reconcile.ocm_external_configuration_labels, ctx.obj, thread_pool_size
|
2715
|
-
)
|
2784
|
+
run_integration(reconcile.ocm_external_configuration_labels, ctx, thread_pool_size)
|
2716
2785
|
|
2717
2786
|
|
2718
2787
|
@integration.command(short_help="Trigger jenkins jobs following Addon upgrades.")
|
2719
2788
|
@click.pass_context
|
2720
|
-
def ocm_addons_upgrade_tests_trigger(ctx):
|
2789
|
+
def ocm_addons_upgrade_tests_trigger(ctx: click.Context) -> None:
|
2721
2790
|
import reconcile.ocm_addons_upgrade_tests_trigger
|
2722
2791
|
|
2723
|
-
run_integration(reconcile.ocm_addons_upgrade_tests_trigger, ctx
|
2792
|
+
run_integration(reconcile.ocm_addons_upgrade_tests_trigger, ctx)
|
2724
2793
|
|
2725
2794
|
|
2726
2795
|
@integration.command(short_help="Manage Machine Pools in OCM.")
|
2727
2796
|
@click.pass_context
|
2728
|
-
def ocm_machine_pools(ctx):
|
2797
|
+
def ocm_machine_pools(ctx: click.Context) -> None:
|
2729
2798
|
import reconcile.ocm_machine_pools
|
2730
2799
|
|
2731
|
-
run_integration(reconcile.ocm_machine_pools, ctx
|
2800
|
+
run_integration(reconcile.ocm_machine_pools, ctx)
|
2732
2801
|
|
2733
2802
|
|
2734
2803
|
@integration.command(short_help="Manage Upgrade Policy schedules in OCM organizations.")
|
@@ -2736,7 +2805,7 @@ def ocm_machine_pools(ctx):
|
|
2736
2805
|
@exclude_org_id
|
2737
2806
|
@click.pass_context
|
2738
2807
|
def ocm_upgrade_scheduler_org(
|
2739
|
-
ctx, org_id: Iterable[str], exclude_org_id: Iterable[str]
|
2808
|
+
ctx: click.Context, org_id: Iterable[str], exclude_org_id: Iterable[str]
|
2740
2809
|
) -> None:
|
2741
2810
|
from reconcile.aus.base import AdvancedUpgradeSchedulerBaseIntegrationParams
|
2742
2811
|
from reconcile.aus.ocm_upgrade_scheduler_org import (
|
@@ -2750,19 +2819,19 @@ def ocm_upgrade_scheduler_org(
|
|
2750
2819
|
excluded_ocm_organization_ids=set(exclude_org_id),
|
2751
2820
|
)
|
2752
2821
|
),
|
2753
|
-
ctx=ctx
|
2822
|
+
ctx=ctx,
|
2754
2823
|
)
|
2755
2824
|
|
2756
2825
|
|
2757
2826
|
@integration.command(short_help="Update Upgrade Policy schedules in OCM organizations.")
|
2758
2827
|
@gitlab_project_id
|
2759
2828
|
@click.pass_context
|
2760
|
-
def ocm_upgrade_scheduler_org_updater(
|
2829
|
+
def ocm_upgrade_scheduler_org_updater(
|
2830
|
+
ctx: click.Context, gitlab_project_id: str | None
|
2831
|
+
) -> None:
|
2761
2832
|
import reconcile.ocm_upgrade_scheduler_org_updater
|
2762
2833
|
|
2763
|
-
run_integration(
|
2764
|
-
reconcile.ocm_upgrade_scheduler_org_updater, ctx.obj, gitlab_project_id
|
2765
|
-
)
|
2834
|
+
run_integration(reconcile.ocm_upgrade_scheduler_org_updater, ctx, gitlab_project_id)
|
2766
2835
|
|
2767
2836
|
|
2768
2837
|
@integration.command(
|
@@ -2778,7 +2847,7 @@ def ocm_upgrade_scheduler_org_updater(ctx, gitlab_project_id):
|
|
2778
2847
|
@exclude_org_id
|
2779
2848
|
@click.pass_context
|
2780
2849
|
def ocm_addons_upgrade_scheduler_org(
|
2781
|
-
ctx,
|
2850
|
+
ctx: click.Context,
|
2782
2851
|
ocm_env: str,
|
2783
2852
|
org_id: Iterable[str],
|
2784
2853
|
exclude_org_id: Iterable[str],
|
@@ -2796,7 +2865,7 @@ def ocm_addons_upgrade_scheduler_org(
|
|
2796
2865
|
excluded_ocm_organization_ids=set(exclude_org_id),
|
2797
2866
|
)
|
2798
2867
|
),
|
2799
|
-
ctx=ctx
|
2868
|
+
ctx=ctx,
|
2800
2869
|
)
|
2801
2870
|
|
2802
2871
|
|
@@ -2819,7 +2888,7 @@ def ocm_addons_upgrade_scheduler_org(
|
|
2819
2888
|
)
|
2820
2889
|
@click.pass_context
|
2821
2890
|
def advanced_upgrade_scheduler(
|
2822
|
-
ctx,
|
2891
|
+
ctx: click.Context,
|
2823
2892
|
ocm_env: str,
|
2824
2893
|
org_id: Iterable[str],
|
2825
2894
|
exclude_org_id: Iterable[str],
|
@@ -2837,7 +2906,7 @@ def advanced_upgrade_scheduler(
|
|
2837
2906
|
ignore_sts_clusters=ignore_sts_clusters,
|
2838
2907
|
)
|
2839
2908
|
),
|
2840
|
-
ctx=ctx
|
2909
|
+
ctx=ctx,
|
2841
2910
|
)
|
2842
2911
|
|
2843
2912
|
|
@@ -2874,7 +2943,7 @@ def advanced_upgrade_scheduler(
|
|
2874
2943
|
)
|
2875
2944
|
@click.pass_context
|
2876
2945
|
def version_gate_approver(
|
2877
|
-
ctx,
|
2946
|
+
ctx: click.Context,
|
2878
2947
|
job_controller_cluster: str,
|
2879
2948
|
job_controller_namespace: str,
|
2880
2949
|
rosa_job_service_account: str,
|
@@ -2896,14 +2965,14 @@ def version_gate_approver(
|
|
2896
2965
|
rosa_role=rosa_role,
|
2897
2966
|
)
|
2898
2967
|
),
|
2899
|
-
ctx=ctx
|
2968
|
+
ctx=ctx,
|
2900
2969
|
)
|
2901
2970
|
|
2902
2971
|
|
2903
2972
|
@integration.command(short_help="Manage Databases and Database Users.")
|
2904
2973
|
@vault_output_path
|
2905
2974
|
@click.pass_context
|
2906
|
-
def database_access_manager(ctx, vault_output_path: str):
|
2975
|
+
def database_access_manager(ctx: click.Context, vault_output_path: str) -> None:
|
2907
2976
|
from reconcile.database_access_manager import (
|
2908
2977
|
DatabaseAccessManagerIntegration,
|
2909
2978
|
DBAMIntegrationParams,
|
@@ -2913,7 +2982,7 @@ def database_access_manager(ctx, vault_output_path: str):
|
|
2913
2982
|
integration=DatabaseAccessManagerIntegration(
|
2914
2983
|
DBAMIntegrationParams(vault_output_path=vault_output_path)
|
2915
2984
|
),
|
2916
|
-
ctx=ctx
|
2985
|
+
ctx=ctx,
|
2917
2986
|
)
|
2918
2987
|
|
2919
2988
|
|
@@ -2921,52 +2990,52 @@ def database_access_manager(ctx, vault_output_path: str):
|
|
2921
2990
|
short_help="Export Product and Application informnation to Status Board."
|
2922
2991
|
)
|
2923
2992
|
@click.pass_context
|
2924
|
-
def status_board_exporter(ctx):
|
2993
|
+
def status_board_exporter(ctx: click.Context) -> None:
|
2925
2994
|
from reconcile.status_board import StatusBoardExporterIntegration
|
2926
2995
|
|
2927
2996
|
run_class_integration(
|
2928
2997
|
integration=StatusBoardExporterIntegration(PydanticRunParams()),
|
2929
|
-
ctx=ctx
|
2998
|
+
ctx=ctx,
|
2930
2999
|
)
|
2931
3000
|
|
2932
3001
|
|
2933
3002
|
@integration.command(short_help="Update recommended version for OCM orgs")
|
2934
3003
|
@gitlab_project_id
|
2935
3004
|
@click.pass_context
|
2936
|
-
def ocm_update_recommended_version(
|
3005
|
+
def ocm_update_recommended_version(
|
3006
|
+
ctx: click.Context, gitlab_project_id: str | None
|
3007
|
+
) -> None:
|
2937
3008
|
import reconcile.ocm_update_recommended_version
|
2938
3009
|
|
2939
|
-
run_integration(
|
2940
|
-
reconcile.ocm_update_recommended_version, ctx.obj, gitlab_project_id
|
2941
|
-
)
|
3010
|
+
run_integration(reconcile.ocm_update_recommended_version, ctx, gitlab_project_id)
|
2942
3011
|
|
2943
3012
|
|
2944
3013
|
@integration.command(short_help="Manages cluster Addons in OCM.")
|
2945
3014
|
@threaded()
|
2946
3015
|
@click.pass_context
|
2947
|
-
def ocm_addons(ctx, thread_pool_size):
|
3016
|
+
def ocm_addons(ctx: click.Context, thread_pool_size: int) -> None:
|
2948
3017
|
import reconcile.ocm_addons
|
2949
3018
|
|
2950
|
-
run_integration(reconcile.ocm_addons, ctx
|
3019
|
+
run_integration(reconcile.ocm_addons, ctx, thread_pool_size)
|
2951
3020
|
|
2952
3021
|
|
2953
3022
|
@integration.command(
|
2954
3023
|
short_help="Grants AWS infrastructure access to members in AWS groups via OCM."
|
2955
3024
|
)
|
2956
3025
|
@click.pass_context
|
2957
|
-
def ocm_aws_infrastructure_access(ctx):
|
3026
|
+
def ocm_aws_infrastructure_access(ctx: click.Context) -> None:
|
2958
3027
|
import reconcile.ocm_aws_infrastructure_access
|
2959
3028
|
|
2960
|
-
run_integration(reconcile.ocm_aws_infrastructure_access, ctx
|
3029
|
+
run_integration(reconcile.ocm_aws_infrastructure_access, ctx)
|
2961
3030
|
|
2962
3031
|
|
2963
3032
|
@integration.command(short_help="Manage GitHub Identity Providers in OCM.")
|
2964
3033
|
@vault_input_path
|
2965
3034
|
@click.pass_context
|
2966
|
-
def ocm_github_idp(ctx, vault_input_path):
|
3035
|
+
def ocm_github_idp(ctx: click.Context, vault_input_path: str) -> None:
|
2967
3036
|
import reconcile.ocm_github_idp
|
2968
3037
|
|
2969
|
-
run_integration(reconcile.ocm_github_idp, ctx
|
3038
|
+
run_integration(reconcile.ocm_github_idp, ctx, vault_input_path)
|
2970
3039
|
|
2971
3040
|
|
2972
3041
|
@integration.command(
|
@@ -2999,12 +3068,12 @@ def ocm_github_idp(ctx, vault_input_path):
|
|
2999
3068
|
)
|
3000
3069
|
@click.pass_context
|
3001
3070
|
def ocm_oidc_idp(
|
3002
|
-
ctx,
|
3003
|
-
ocm_env,
|
3004
|
-
default_auth_name,
|
3005
|
-
default_auth_issuer_url,
|
3006
|
-
vault_input_path,
|
3007
|
-
):
|
3071
|
+
ctx: click.Context,
|
3072
|
+
ocm_env: str | None,
|
3073
|
+
default_auth_name: str,
|
3074
|
+
default_auth_issuer_url: str,
|
3075
|
+
vault_input_path: str,
|
3076
|
+
) -> None:
|
3008
3077
|
from reconcile.rhidp.ocm_oidc_idp.integration import (
|
3009
3078
|
OCMOidcIdp,
|
3010
3079
|
OCMOidcIdpParams,
|
@@ -3019,7 +3088,7 @@ def ocm_oidc_idp(
|
|
3019
3088
|
default_auth_issuer_url=default_auth_issuer_url,
|
3020
3089
|
)
|
3021
3090
|
),
|
3022
|
-
ctx=ctx
|
3091
|
+
ctx=ctx,
|
3023
3092
|
)
|
3024
3093
|
|
3025
3094
|
|
@@ -3064,14 +3133,14 @@ def ocm_oidc_idp(
|
|
3064
3133
|
)
|
3065
3134
|
@click.pass_context
|
3066
3135
|
def rhidp_sso_client(
|
3067
|
-
ctx,
|
3068
|
-
keycloak_instance_vault_paths,
|
3069
|
-
contact_emails,
|
3070
|
-
vault_input_path,
|
3071
|
-
ocm_env,
|
3072
|
-
default_auth_name,
|
3073
|
-
default_auth_issuer_url,
|
3074
|
-
):
|
3136
|
+
ctx: click.Context,
|
3137
|
+
keycloak_instance_vault_paths: str,
|
3138
|
+
contact_emails: str,
|
3139
|
+
vault_input_path: str,
|
3140
|
+
ocm_env: str | None,
|
3141
|
+
default_auth_name: str,
|
3142
|
+
default_auth_issuer_url: str,
|
3143
|
+
) -> None:
|
3075
3144
|
from reconcile.rhidp.sso_client.integration import (
|
3076
3145
|
SSOClient,
|
3077
3146
|
SSOClientParams,
|
@@ -3090,7 +3159,7 @@ def rhidp_sso_client(
|
|
3090
3159
|
contacts=list(set(contact_emails.split(","))),
|
3091
3160
|
)
|
3092
3161
|
),
|
3093
|
-
ctx=ctx
|
3162
|
+
ctx=ctx,
|
3094
3163
|
)
|
3095
3164
|
|
3096
3165
|
|
@@ -3098,7 +3167,7 @@ def rhidp_sso_client(
|
|
3098
3167
|
short_help="Manages the OCM subscription labels for clusters with RHIDP authentication. Part of RHIDP."
|
3099
3168
|
)
|
3100
3169
|
@click.pass_context
|
3101
|
-
def cluster_auth_rhidp(ctx):
|
3170
|
+
def cluster_auth_rhidp(ctx: click.Context) -> None:
|
3102
3171
|
from reconcile.cluster_auth_rhidp.integration import (
|
3103
3172
|
ClusterAuthRhidpIntegration,
|
3104
3173
|
ClusterAuthRhidpIntegrationParams,
|
@@ -3106,7 +3175,7 @@ def cluster_auth_rhidp(ctx):
|
|
3106
3175
|
|
3107
3176
|
run_class_integration(
|
3108
3177
|
integration=ClusterAuthRhidpIntegration(ClusterAuthRhidpIntegrationParams()),
|
3109
|
-
ctx=ctx
|
3178
|
+
ctx=ctx,
|
3110
3179
|
)
|
3111
3180
|
|
3112
3181
|
|
@@ -3114,71 +3183,71 @@ def cluster_auth_rhidp(ctx):
|
|
3114
3183
|
short_help="Automatically provide dedicated Dynatrace tokens to management clusters"
|
3115
3184
|
)
|
3116
3185
|
@click.pass_context
|
3117
|
-
def dynatrace_token_provider(ctx):
|
3186
|
+
def dynatrace_token_provider(ctx: click.Context) -> None:
|
3118
3187
|
from reconcile.dynatrace_token_provider.integration import (
|
3119
3188
|
DynatraceTokenProviderIntegration,
|
3120
3189
|
)
|
3121
3190
|
|
3122
3191
|
run_class_integration(
|
3123
3192
|
integration=DynatraceTokenProviderIntegration(),
|
3124
|
-
ctx=ctx
|
3193
|
+
ctx=ctx,
|
3125
3194
|
)
|
3126
3195
|
|
3127
3196
|
|
3128
3197
|
@integration.command(short_help="Manage labels across cluster fleets in OCM")
|
3129
3198
|
@click.pass_context
|
3130
|
-
def fleet_labeler(ctx):
|
3199
|
+
def fleet_labeler(ctx: click.Context) -> None:
|
3131
3200
|
from reconcile.fleet_labeler.integration import (
|
3132
3201
|
FleetLabelerIntegration,
|
3133
3202
|
)
|
3134
3203
|
|
3135
3204
|
run_class_integration(
|
3136
3205
|
integration=FleetLabelerIntegration(),
|
3137
|
-
ctx=ctx
|
3206
|
+
ctx=ctx,
|
3138
3207
|
)
|
3139
3208
|
|
3140
3209
|
|
3141
3210
|
@integration.command(short_help="Manage additional routers in OCM.")
|
3142
3211
|
@click.pass_context
|
3143
|
-
def ocm_additional_routers(ctx):
|
3212
|
+
def ocm_additional_routers(ctx: click.Context) -> None:
|
3144
3213
|
import reconcile.ocm_additional_routers
|
3145
3214
|
|
3146
|
-
run_integration(reconcile.ocm_additional_routers, ctx
|
3215
|
+
run_integration(reconcile.ocm_additional_routers, ctx)
|
3147
3216
|
|
3148
3217
|
|
3149
3218
|
@integration.command(short_help="Send email notifications to app-interface audience.")
|
3150
3219
|
@click.pass_context
|
3151
|
-
def email_sender(ctx):
|
3220
|
+
def email_sender(ctx: click.Context) -> None:
|
3152
3221
|
import reconcile.email_sender
|
3153
3222
|
|
3154
|
-
run_integration(reconcile.email_sender, ctx
|
3223
|
+
run_integration(reconcile.email_sender, ctx)
|
3155
3224
|
|
3156
3225
|
|
3157
3226
|
@integration.command(
|
3158
3227
|
short_help="Send emails to users based on requests submitted to app-interface."
|
3159
3228
|
)
|
3160
3229
|
@click.pass_context
|
3161
|
-
def requests_sender(ctx):
|
3230
|
+
def requests_sender(ctx: click.Context) -> None:
|
3162
3231
|
import reconcile.requests_sender
|
3163
3232
|
|
3164
|
-
run_integration(reconcile.requests_sender, ctx
|
3233
|
+
run_integration(reconcile.requests_sender, ctx)
|
3165
3234
|
|
3166
3235
|
|
3167
3236
|
@integration.command(short_help="Validate dependencies are defined for each service.")
|
3168
3237
|
@click.pass_context
|
3169
|
-
def service_dependencies(ctx):
|
3238
|
+
def service_dependencies(ctx: click.Context) -> None:
|
3170
3239
|
import reconcile.service_dependencies
|
3171
3240
|
|
3172
|
-
run_integration(reconcile.service_dependencies, ctx
|
3241
|
+
run_integration(reconcile.service_dependencies, ctx)
|
3173
3242
|
|
3174
3243
|
|
3175
3244
|
@integration.command(short_help="Runs SQL Queries against app-interface RDS resources.")
|
3176
3245
|
@enable_deletion(default=False)
|
3177
3246
|
@click.pass_context
|
3178
|
-
def sql_query(ctx, enable_deletion):
|
3247
|
+
def sql_query(ctx: click.Context, enable_deletion: bool) -> None:
|
3179
3248
|
import reconcile.sql_query
|
3180
3249
|
|
3181
|
-
run_integration(reconcile.sql_query, ctx
|
3250
|
+
run_integration(reconcile.sql_query, ctx, enable_deletion)
|
3182
3251
|
|
3183
3252
|
|
3184
3253
|
@integration.command(
|
@@ -3186,10 +3255,10 @@ def sql_query(ctx, enable_deletion):
|
|
3186
3255
|
)
|
3187
3256
|
@threaded()
|
3188
3257
|
@click.pass_context
|
3189
|
-
def gitlab_owners(ctx, thread_pool_size):
|
3258
|
+
def gitlab_owners(ctx: click.Context, thread_pool_size: int) -> None:
|
3190
3259
|
import reconcile.gitlab_owners
|
3191
3260
|
|
3192
|
-
run_integration(reconcile.gitlab_owners, ctx
|
3261
|
+
run_integration(reconcile.gitlab_owners, ctx, thread_pool_size)
|
3193
3262
|
|
3194
3263
|
|
3195
3264
|
@integration.command(short_help="Ensures that forks of App Interface are compliant.")
|
@@ -3198,13 +3267,16 @@ def gitlab_owners(ctx, thread_pool_size):
|
|
3198
3267
|
@click.argument("gitlab-maintainers-group", required=False)
|
3199
3268
|
@click.pass_context
|
3200
3269
|
def gitlab_fork_compliance(
|
3201
|
-
ctx
|
3202
|
-
|
3270
|
+
ctx: click.Context,
|
3271
|
+
gitlab_project_id: str,
|
3272
|
+
gitlab_merge_request_id: str,
|
3273
|
+
gitlab_maintainers_group: str | None,
|
3274
|
+
) -> None:
|
3203
3275
|
import reconcile.gitlab_fork_compliance
|
3204
3276
|
|
3205
3277
|
run_integration(
|
3206
3278
|
reconcile.gitlab_fork_compliance,
|
3207
|
-
ctx
|
3279
|
+
ctx,
|
3208
3280
|
gitlab_project_id,
|
3209
3281
|
gitlab_merge_request_id,
|
3210
3282
|
gitlab_maintainers_group,
|
@@ -3217,10 +3289,10 @@ def gitlab_fork_compliance(
|
|
3217
3289
|
)
|
3218
3290
|
@threaded(default=2)
|
3219
3291
|
@click.pass_context
|
3220
|
-
def dashdotdb_cso(ctx, thread_pool_size):
|
3292
|
+
def dashdotdb_cso(ctx: click.Context, thread_pool_size: int) -> None:
|
3221
3293
|
import reconcile.dashdotdb_cso
|
3222
3294
|
|
3223
|
-
run_integration(reconcile.dashdotdb_cso, ctx
|
3295
|
+
run_integration(reconcile.dashdotdb_cso, ctx, thread_pool_size)
|
3224
3296
|
|
3225
3297
|
|
3226
3298
|
@integration.command(
|
@@ -3230,10 +3302,12 @@ def dashdotdb_cso(ctx, thread_pool_size):
|
|
3230
3302
|
@threaded(default=2)
|
3231
3303
|
@click.pass_context
|
3232
3304
|
@cluster_name
|
3233
|
-
def dashdotdb_dvo(
|
3305
|
+
def dashdotdb_dvo(
|
3306
|
+
ctx: click.Context, thread_pool_size: int, cluster_name: Iterable[str] | None
|
3307
|
+
) -> None:
|
3234
3308
|
import reconcile.dashdotdb_dvo
|
3235
3309
|
|
3236
|
-
run_integration(reconcile.dashdotdb_dvo, ctx
|
3310
|
+
run_integration(reconcile.dashdotdb_dvo, ctx, thread_pool_size, cluster_name)
|
3237
3311
|
|
3238
3312
|
|
3239
3313
|
@integration.command(
|
@@ -3242,22 +3316,22 @@ def dashdotdb_dvo(ctx, thread_pool_size, cluster_name):
|
|
3242
3316
|
)
|
3243
3317
|
@threaded(default=2)
|
3244
3318
|
@click.pass_context
|
3245
|
-
def dashdotdb_slo(ctx, thread_pool_size):
|
3319
|
+
def dashdotdb_slo(ctx: click.Context, thread_pool_size: int) -> None:
|
3246
3320
|
import reconcile.dashdotdb_slo
|
3247
3321
|
|
3248
|
-
run_integration(reconcile.dashdotdb_slo, ctx
|
3322
|
+
run_integration(reconcile.dashdotdb_slo, ctx, thread_pool_size)
|
3249
3323
|
|
3250
3324
|
|
3251
3325
|
@integration.command(short_help="Collects dora metrics.")
|
3252
3326
|
@gitlab_project_id
|
3253
3327
|
@threaded(default=5)
|
3254
3328
|
@click.pass_context
|
3255
|
-
def dashdotdb_dora(
|
3329
|
+
def dashdotdb_dora(
|
3330
|
+
ctx: click.Context, gitlab_project_id: str | None, thread_pool_size: int
|
3331
|
+
) -> None:
|
3256
3332
|
import reconcile.dashdotdb_dora
|
3257
3333
|
|
3258
|
-
run_integration(
|
3259
|
-
reconcile.dashdotdb_dora, ctx.obj, gitlab_project_id, thread_pool_size
|
3260
|
-
)
|
3334
|
+
run_integration(reconcile.dashdotdb_dora, ctx, gitlab_project_id, thread_pool_size)
|
3261
3335
|
|
3262
3336
|
|
3263
3337
|
@integration.command(short_help="Tests prometheus rules using promtool.")
|
@@ -3266,12 +3340,14 @@ def dashdotdb_dora(ctx, gitlab_project_id, thread_pool_size):
|
|
3266
3340
|
@binary_version("promtool", ["--version"], PROMTOOL_VERSION_REGEX, PROMTOOL_VERSION)
|
3267
3341
|
@cluster_name
|
3268
3342
|
@click.pass_context
|
3269
|
-
def prometheus_rules_tester(
|
3343
|
+
def prometheus_rules_tester(
|
3344
|
+
ctx: click.Context, thread_pool_size: int, cluster_name: Iterable[str] | None
|
3345
|
+
) -> None:
|
3270
3346
|
import reconcile.prometheus_rules_tester.integration
|
3271
3347
|
|
3272
3348
|
run_integration(
|
3273
3349
|
reconcile.prometheus_rules_tester.integration,
|
3274
|
-
ctx
|
3350
|
+
ctx,
|
3275
3351
|
thread_pool_size,
|
3276
3352
|
cluster_names=cluster_name,
|
3277
3353
|
)
|
@@ -3279,37 +3355,37 @@ def prometheus_rules_tester(ctx, thread_pool_size, cluster_name):
|
|
3279
3355
|
|
3280
3356
|
@integration.command(short_help="Tests templating of resources.")
|
3281
3357
|
@click.pass_context
|
3282
|
-
def resource_template_tester(ctx):
|
3358
|
+
def resource_template_tester(ctx: click.Context) -> None:
|
3283
3359
|
import reconcile.resource_template_tester
|
3284
3360
|
|
3285
|
-
run_integration(reconcile.resource_template_tester, ctx
|
3361
|
+
run_integration(reconcile.resource_template_tester, ctx)
|
3286
3362
|
|
3287
3363
|
|
3288
3364
|
@integration.command(
|
3289
3365
|
short_help="Validate queries to maintain consumer schema compatibility."
|
3290
3366
|
)
|
3291
3367
|
@click.pass_context
|
3292
|
-
def query_validator(ctx):
|
3368
|
+
def query_validator(ctx: click.Context) -> None:
|
3293
3369
|
import reconcile.query_validator
|
3294
3370
|
|
3295
|
-
run_integration(reconcile.query_validator, ctx
|
3371
|
+
run_integration(reconcile.query_validator, ctx)
|
3296
3372
|
|
3297
3373
|
|
3298
3374
|
@integration.command(short_help="Manages SendGrid teammates for a given account.")
|
3299
3375
|
@click.pass_context
|
3300
|
-
def sendgrid_teammates(ctx):
|
3376
|
+
def sendgrid_teammates(ctx: click.Context) -> None:
|
3301
3377
|
import reconcile.sendgrid_teammates
|
3302
3378
|
|
3303
|
-
run_integration(reconcile.sendgrid_teammates, ctx
|
3379
|
+
run_integration(reconcile.sendgrid_teammates, ctx)
|
3304
3380
|
|
3305
3381
|
|
3306
3382
|
@integration.command(short_help="Maps ClusterDeployment resources to Cluster IDs.")
|
3307
3383
|
@vault_output_path
|
3308
3384
|
@click.pass_context
|
3309
|
-
def cluster_deployment_mapper(ctx, vault_output_path):
|
3385
|
+
def cluster_deployment_mapper(ctx: click.Context, vault_output_path: str) -> None:
|
3310
3386
|
import reconcile.cluster_deployment_mapper
|
3311
3387
|
|
3312
|
-
run_integration(reconcile.cluster_deployment_mapper, ctx
|
3388
|
+
run_integration(reconcile.cluster_deployment_mapper, ctx, vault_output_path)
|
3313
3389
|
|
3314
3390
|
|
3315
3391
|
@integration.command(short_help="Get resources from clusters and store in Vault.")
|
@@ -3317,12 +3393,17 @@ def cluster_deployment_mapper(ctx, vault_output_path):
|
|
3317
3393
|
@resource_kind
|
3318
3394
|
@vault_output_path
|
3319
3395
|
@click.pass_context
|
3320
|
-
def resource_scraper(
|
3396
|
+
def resource_scraper(
|
3397
|
+
ctx: click.Context,
|
3398
|
+
namespace_name: str | None,
|
3399
|
+
resource_kind: str | None,
|
3400
|
+
vault_output_path: str,
|
3401
|
+
) -> None:
|
3321
3402
|
import reconcile.resource_scraper
|
3322
3403
|
|
3323
3404
|
run_integration(
|
3324
3405
|
reconcile.resource_scraper,
|
3325
|
-
ctx
|
3406
|
+
ctx,
|
3326
3407
|
namespace_name,
|
3327
3408
|
resource_kind,
|
3328
3409
|
vault_output_path,
|
@@ -3336,12 +3417,14 @@ def resource_scraper(ctx, namespace_name, resource_kind, vault_output_path):
|
|
3336
3417
|
@internal()
|
3337
3418
|
@use_jump_host()
|
3338
3419
|
@click.pass_context
|
3339
|
-
def gabi_authorized_users(
|
3420
|
+
def gabi_authorized_users(
|
3421
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
3422
|
+
) -> None:
|
3340
3423
|
import reconcile.gabi_authorized_users
|
3341
3424
|
|
3342
3425
|
run_integration(
|
3343
3426
|
reconcile.gabi_authorized_users,
|
3344
|
-
ctx
|
3427
|
+
ctx,
|
3345
3428
|
thread_pool_size,
|
3346
3429
|
internal,
|
3347
3430
|
use_jump_host,
|
@@ -3352,24 +3435,24 @@ def gabi_authorized_users(ctx, thread_pool_size, internal, use_jump_host):
|
|
3352
3435
|
short_help="Manages components on statuspage.io hosted status pages."
|
3353
3436
|
)
|
3354
3437
|
@click.pass_context
|
3355
|
-
def status_page_components(ctx):
|
3438
|
+
def status_page_components(ctx: click.Context) -> None:
|
3356
3439
|
from reconcile.statuspage.integrations.components import (
|
3357
3440
|
StatusPageComponentsIntegration,
|
3358
3441
|
)
|
3359
3442
|
|
3360
|
-
run_class_integration(StatusPageComponentsIntegration(), ctx
|
3443
|
+
run_class_integration(StatusPageComponentsIntegration(), ctx)
|
3361
3444
|
|
3362
3445
|
|
3363
3446
|
@integration.command(
|
3364
3447
|
short_help="Manages maintenances on statuspage.io hosted status pages."
|
3365
3448
|
)
|
3366
3449
|
@click.pass_context
|
3367
|
-
def status_page_maintenances(ctx):
|
3450
|
+
def status_page_maintenances(ctx: click.Context) -> None:
|
3368
3451
|
from reconcile.statuspage.integrations.maintenances import (
|
3369
3452
|
StatusPageMaintenancesIntegration,
|
3370
3453
|
)
|
3371
3454
|
|
3372
|
-
run_class_integration(StatusPageMaintenancesIntegration(NoParams()), ctx
|
3455
|
+
run_class_integration(StatusPageMaintenancesIntegration(NoParams()), ctx)
|
3373
3456
|
|
3374
3457
|
|
3375
3458
|
@integration.command(
|
@@ -3394,7 +3477,12 @@ def status_page_maintenances(ctx):
|
|
3394
3477
|
multiple=True,
|
3395
3478
|
)
|
3396
3479
|
@click.pass_context
|
3397
|
-
def ocm_standalone_user_management(
|
3480
|
+
def ocm_standalone_user_management(
|
3481
|
+
ctx: click.Context,
|
3482
|
+
ocm_env: str | None,
|
3483
|
+
ocm_org_ids: str | None,
|
3484
|
+
group_provider: Iterable[str] | None,
|
3485
|
+
) -> None:
|
3398
3486
|
from reconcile.oum.base import OCMUserManagementIntegrationParams
|
3399
3487
|
from reconcile.oum.standalone import OCMStandaloneUserManagementIntegration
|
3400
3488
|
|
@@ -3407,7 +3495,7 @@ def ocm_standalone_user_management(ctx, ocm_env, ocm_org_ids, group_provider):
|
|
3407
3495
|
group_provider_specs=group_provider,
|
3408
3496
|
),
|
3409
3497
|
),
|
3410
|
-
ctx
|
3498
|
+
ctx,
|
3411
3499
|
)
|
3412
3500
|
|
3413
3501
|
|
@@ -3419,13 +3507,13 @@ def ocm_standalone_user_management(ctx, ocm_env, ocm_org_ids, group_provider):
|
|
3419
3507
|
@use_jump_host()
|
3420
3508
|
@click.pass_context
|
3421
3509
|
def blackbox_exporter_endpoint_monitoring(
|
3422
|
-
ctx, thread_pool_size, internal, use_jump_host
|
3423
|
-
):
|
3510
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
3511
|
+
) -> None:
|
3424
3512
|
import reconcile.blackbox_exporter_endpoint_monitoring
|
3425
3513
|
|
3426
3514
|
run_integration(
|
3427
3515
|
reconcile.blackbox_exporter_endpoint_monitoring,
|
3428
|
-
ctx
|
3516
|
+
ctx,
|
3429
3517
|
thread_pool_size,
|
3430
3518
|
internal,
|
3431
3519
|
use_jump_host,
|
@@ -3440,20 +3528,22 @@ def blackbox_exporter_endpoint_monitoring(
|
|
3440
3528
|
@use_jump_host()
|
3441
3529
|
@click.pass_context
|
3442
3530
|
def signalfx_prometheus_endpoint_monitoring(
|
3443
|
-
ctx, thread_pool_size, internal, use_jump_host
|
3444
|
-
):
|
3531
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
3532
|
+
) -> None:
|
3445
3533
|
import reconcile.signalfx_endpoint_monitoring
|
3446
3534
|
|
3447
3535
|
run_integration(
|
3448
3536
|
reconcile.signalfx_endpoint_monitoring,
|
3449
|
-
ctx
|
3537
|
+
ctx,
|
3450
3538
|
thread_pool_size,
|
3451
3539
|
internal,
|
3452
3540
|
use_jump_host,
|
3453
3541
|
)
|
3454
3542
|
|
3455
3543
|
|
3456
|
-
def parse_image_tag_from_ref(
|
3544
|
+
def parse_image_tag_from_ref(
|
3545
|
+
ctx: click.Context | None, param: Any, value: Iterable[str]
|
3546
|
+
) -> dict[str, str] | None:
|
3457
3547
|
if value:
|
3458
3548
|
result = {}
|
3459
3549
|
for v in value:
|
@@ -3470,10 +3560,10 @@ def parse_image_tag_from_ref(ctx, param, value) -> dict[str, str] | None:
|
|
3470
3560
|
|
3471
3561
|
@integration.command(short_help="Allow vault to replicate secrets to other instances.")
|
3472
3562
|
@click.pass_context
|
3473
|
-
def vault_replication(ctx):
|
3563
|
+
def vault_replication(ctx: click.Context) -> None:
|
3474
3564
|
import reconcile.vault_replication
|
3475
3565
|
|
3476
|
-
run_integration(reconcile.vault_replication, ctx
|
3566
|
+
run_integration(reconcile.vault_replication, ctx)
|
3477
3567
|
|
3478
3568
|
|
3479
3569
|
@integration.command(short_help="Manages Qontract Reconcile integrations.")
|
@@ -3507,20 +3597,20 @@ def vault_replication(ctx):
|
|
3507
3597
|
)
|
3508
3598
|
@click.pass_context
|
3509
3599
|
def integrations_manager(
|
3510
|
-
ctx,
|
3511
|
-
environment_name,
|
3512
|
-
thread_pool_size,
|
3513
|
-
internal,
|
3514
|
-
use_jump_host,
|
3515
|
-
image_tag_from_ref,
|
3516
|
-
upstream,
|
3517
|
-
image,
|
3518
|
-
):
|
3600
|
+
ctx: click.Context,
|
3601
|
+
environment_name: str | None,
|
3602
|
+
thread_pool_size: int,
|
3603
|
+
internal: bool,
|
3604
|
+
use_jump_host: bool,
|
3605
|
+
image_tag_from_ref: dict[str, str] | None,
|
3606
|
+
upstream: str | None,
|
3607
|
+
image: str | None,
|
3608
|
+
) -> None:
|
3519
3609
|
import reconcile.integrations_manager
|
3520
3610
|
|
3521
3611
|
run_integration(
|
3522
3612
|
reconcile.integrations_manager,
|
3523
|
-
ctx
|
3613
|
+
ctx,
|
3524
3614
|
environment_name,
|
3525
3615
|
get_integration_cli_meta(),
|
3526
3616
|
thread_pool_size,
|
@@ -3555,18 +3645,18 @@ def integrations_manager(
|
|
3555
3645
|
)
|
3556
3646
|
@click.pass_context
|
3557
3647
|
def change_owners(
|
3558
|
-
ctx,
|
3559
|
-
gitlab_project_id,
|
3560
|
-
gitlab_merge_request_id,
|
3561
|
-
comparison_sha,
|
3562
|
-
change_type_processing_mode,
|
3563
|
-
mr_management,
|
3564
|
-
):
|
3648
|
+
ctx: click.Context,
|
3649
|
+
gitlab_project_id: str,
|
3650
|
+
gitlab_merge_request_id: str,
|
3651
|
+
comparison_sha: str | None,
|
3652
|
+
change_type_processing_mode: str,
|
3653
|
+
mr_management: bool,
|
3654
|
+
) -> None:
|
3565
3655
|
import reconcile.change_owners.change_owners
|
3566
3656
|
|
3567
3657
|
run_integration(
|
3568
3658
|
reconcile.change_owners.change_owners,
|
3569
|
-
ctx
|
3659
|
+
ctx,
|
3570
3660
|
gitlab_project_id,
|
3571
3661
|
gitlab_merge_request_id,
|
3572
3662
|
comparison_sha,
|
@@ -3584,7 +3674,12 @@ def change_owners(
|
|
3584
3674
|
)
|
3585
3675
|
@click.option("--commit", help="Reconcile just this commit.", default=None)
|
3586
3676
|
@click.pass_context
|
3587
|
-
def change_log_tracking(
|
3677
|
+
def change_log_tracking(
|
3678
|
+
ctx: click.Context,
|
3679
|
+
gitlab_project_id: str | None,
|
3680
|
+
process_existing: bool,
|
3681
|
+
commit: str | None,
|
3682
|
+
) -> None:
|
3588
3683
|
from reconcile.change_owners.change_log_tracking import (
|
3589
3684
|
ChangeLogIntegration,
|
3590
3685
|
ChangeLogIntegrationParams,
|
@@ -3598,7 +3693,7 @@ def change_log_tracking(ctx, gitlab_project_id, process_existing, commit):
|
|
3598
3693
|
commit=commit,
|
3599
3694
|
)
|
3600
3695
|
),
|
3601
|
-
ctx=ctx
|
3696
|
+
ctx=ctx,
|
3602
3697
|
)
|
3603
3698
|
|
3604
3699
|
|
@@ -3607,16 +3702,16 @@ def change_log_tracking(ctx, gitlab_project_id, process_existing, commit):
|
|
3607
3702
|
)
|
3608
3703
|
@click.option("--instance", help="Reconcile just this instance.", default=None)
|
3609
3704
|
@click.pass_context
|
3610
|
-
def glitchtip(ctx, instance):
|
3705
|
+
def glitchtip(ctx: click.Context, instance: str | None) -> None:
|
3611
3706
|
import reconcile.glitchtip.integration
|
3612
3707
|
|
3613
|
-
run_integration(reconcile.glitchtip.integration, ctx
|
3708
|
+
run_integration(reconcile.glitchtip.integration, ctx, instance)
|
3614
3709
|
|
3615
3710
|
|
3616
3711
|
@integration.command(short_help="Configure Glitchtip project alerts.")
|
3617
3712
|
@click.option("--instance", help="Reconcile just this instance.", default=None)
|
3618
3713
|
@click.pass_context
|
3619
|
-
def glitchtip_project_alerts(ctx, instance):
|
3714
|
+
def glitchtip_project_alerts(ctx: click.Context, instance: str | None) -> None:
|
3620
3715
|
from reconcile.glitchtip_project_alerts.integration import (
|
3621
3716
|
GlitchtipProjectAlertsIntegration,
|
3622
3717
|
GlitchtipProjectAlertsIntegrationParams,
|
@@ -3626,7 +3721,7 @@ def glitchtip_project_alerts(ctx, instance):
|
|
3626
3721
|
integration=GlitchtipProjectAlertsIntegration(
|
3627
3722
|
GlitchtipProjectAlertsIntegrationParams(instance=instance)
|
3628
3723
|
),
|
3629
|
-
ctx=ctx
|
3724
|
+
ctx=ctx,
|
3630
3725
|
)
|
3631
3726
|
|
3632
3727
|
|
@@ -3638,12 +3733,18 @@ def glitchtip_project_alerts(ctx, instance):
|
|
3638
3733
|
@use_jump_host()
|
3639
3734
|
@click.option("--instance", help="Reconcile just this instance.", default=None)
|
3640
3735
|
@click.pass_context
|
3641
|
-
def glitchtip_project_dsn(
|
3736
|
+
def glitchtip_project_dsn(
|
3737
|
+
ctx: click.Context,
|
3738
|
+
thread_pool_size: int,
|
3739
|
+
internal: bool,
|
3740
|
+
use_jump_host: bool,
|
3741
|
+
instance: str | None,
|
3742
|
+
) -> None:
|
3642
3743
|
import reconcile.glitchtip_project_dsn.integration
|
3643
3744
|
|
3644
3745
|
run_integration(
|
3645
3746
|
reconcile.glitchtip_project_dsn.integration,
|
3646
|
-
ctx
|
3747
|
+
ctx,
|
3647
3748
|
thread_pool_size,
|
3648
3749
|
internal,
|
3649
3750
|
use_jump_host,
|
@@ -3658,12 +3759,14 @@ def glitchtip_project_dsn(ctx, thread_pool_size, internal, use_jump_host, instan
|
|
3658
3759
|
@internal()
|
3659
3760
|
@use_jump_host()
|
3660
3761
|
@click.pass_context
|
3661
|
-
def skupper_network(
|
3762
|
+
def skupper_network(
|
3763
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
3764
|
+
) -> None:
|
3662
3765
|
import reconcile.skupper_network.integration
|
3663
3766
|
|
3664
3767
|
run_integration(
|
3665
3768
|
reconcile.skupper_network.integration,
|
3666
|
-
ctx
|
3769
|
+
ctx,
|
3667
3770
|
thread_pool_size,
|
3668
3771
|
internal,
|
3669
3772
|
use_jump_host,
|
@@ -3686,7 +3789,9 @@ def skupper_network(ctx, thread_pool_size, internal, use_jump_host):
|
|
3686
3789
|
default="sre-capabilities.rhidp",
|
3687
3790
|
)
|
3688
3791
|
@click.pass_context
|
3689
|
-
def ocm_labels(
|
3792
|
+
def ocm_labels(
|
3793
|
+
ctx: click.Context, managed_label_prefixes: str, ignored_label_prefixes: str
|
3794
|
+
) -> None:
|
3690
3795
|
from reconcile.ocm_labels.integration import (
|
3691
3796
|
OcmLabelsIntegration,
|
3692
3797
|
OcmLabelsIntegrationParams,
|
@@ -3699,7 +3804,7 @@ def ocm_labels(ctx, managed_label_prefixes, ignored_label_prefixes):
|
|
3699
3804
|
ignored_label_prefixes=list(set(ignored_label_prefixes.split(","))),
|
3700
3805
|
)
|
3701
3806
|
),
|
3702
|
-
ctx=ctx
|
3807
|
+
ctx=ctx,
|
3703
3808
|
)
|
3704
3809
|
|
3705
3810
|
|
@@ -3707,43 +3812,43 @@ def ocm_labels(ctx, managed_label_prefixes, ignored_label_prefixes):
|
|
3707
3812
|
short_help="Notifications to internal Red Hat users based on conditions in OCM."
|
3708
3813
|
)
|
3709
3814
|
@click.pass_context
|
3710
|
-
def ocm_internal_notifications(ctx):
|
3815
|
+
def ocm_internal_notifications(ctx: click.Context) -> None:
|
3711
3816
|
from reconcile.ocm_internal_notifications.integration import (
|
3712
3817
|
OcmInternalNotifications,
|
3713
3818
|
)
|
3714
3819
|
|
3715
3820
|
run_class_integration(
|
3716
3821
|
integration=OcmInternalNotifications(),
|
3717
|
-
ctx=ctx
|
3822
|
+
ctx=ctx,
|
3718
3823
|
)
|
3719
3824
|
|
3720
3825
|
|
3721
3826
|
@integration.command(short_help="Manages RHACS rbac configuration")
|
3722
3827
|
@click.pass_context
|
3723
|
-
def acs_rbac(ctx):
|
3828
|
+
def acs_rbac(ctx: click.Context) -> None:
|
3724
3829
|
from reconcile import acs_rbac
|
3725
3830
|
|
3726
3831
|
run_class_integration(
|
3727
3832
|
integration=acs_rbac.AcsRbacIntegration(),
|
3728
|
-
ctx=ctx
|
3833
|
+
ctx=ctx,
|
3729
3834
|
)
|
3730
3835
|
|
3731
3836
|
|
3732
3837
|
@integration.command(short_help="Manages RHACS security policy configurations")
|
3733
3838
|
@click.pass_context
|
3734
|
-
def acs_policies(ctx):
|
3839
|
+
def acs_policies(ctx: click.Context) -> None:
|
3735
3840
|
from reconcile import acs_policies
|
3736
3841
|
|
3737
3842
|
run_class_integration(
|
3738
3843
|
integration=acs_policies.AcsPoliciesIntegration(),
|
3739
|
-
ctx=ctx
|
3844
|
+
ctx=ctx,
|
3740
3845
|
)
|
3741
3846
|
|
3742
3847
|
|
3743
3848
|
@integration.command(short_help="Manage Unleash feature toggles.")
|
3744
3849
|
@click.option("--instance", help="Reconcile just this Unlash instance.", default=None)
|
3745
3850
|
@click.pass_context
|
3746
|
-
def unleash_feature_toggles(ctx, instance):
|
3851
|
+
def unleash_feature_toggles(ctx: click.Context, instance: str | None) -> None:
|
3747
3852
|
from reconcile.unleash_feature_toggles.integration import (
|
3748
3853
|
UnleashTogglesIntegration,
|
3749
3854
|
UnleashTogglesIntegrationParams,
|
@@ -3753,18 +3858,18 @@ def unleash_feature_toggles(ctx, instance):
|
|
3753
3858
|
integration=UnleashTogglesIntegration(
|
3754
3859
|
UnleashTogglesIntegrationParams(instance=instance)
|
3755
3860
|
),
|
3756
|
-
ctx=ctx
|
3861
|
+
ctx=ctx,
|
3757
3862
|
)
|
3758
3863
|
|
3759
3864
|
|
3760
3865
|
@integration.command(short_help="Automate Deadmanssnitch Creation/Deletion")
|
3761
3866
|
@click.pass_context
|
3762
|
-
def deadmanssnitch(ctx):
|
3867
|
+
def deadmanssnitch(ctx: click.Context) -> None:
|
3763
3868
|
from reconcile import deadmanssnitch
|
3764
3869
|
|
3765
3870
|
run_class_integration(
|
3766
3871
|
integration=deadmanssnitch.DeadMansSnitchIntegration(),
|
3767
|
-
ctx=ctx
|
3872
|
+
ctx=ctx,
|
3768
3873
|
)
|
3769
3874
|
|
3770
3875
|
|
@@ -3787,17 +3892,17 @@ def deadmanssnitch(ctx):
|
|
3787
3892
|
default="",
|
3788
3893
|
)
|
3789
3894
|
def external_resources(
|
3790
|
-
ctx,
|
3895
|
+
ctx: click.Context,
|
3791
3896
|
dry_run_job_suffix: str,
|
3792
3897
|
thread_pool_size: int,
|
3793
3898
|
workers_cluster: str,
|
3794
3899
|
workers_namespace: str,
|
3795
|
-
):
|
3900
|
+
) -> None:
|
3796
3901
|
import reconcile.external_resources.integration
|
3797
3902
|
|
3798
3903
|
run_integration(
|
3799
3904
|
reconcile.external_resources.integration,
|
3800
|
-
ctx
|
3905
|
+
ctx,
|
3801
3906
|
dry_run_job_suffix=dry_run_job_suffix,
|
3802
3907
|
thread_pool_size=thread_pool_size,
|
3803
3908
|
workers_cluster=workers_cluster,
|
@@ -3811,14 +3916,14 @@ def external_resources(
|
|
3811
3916
|
@click.pass_context
|
3812
3917
|
@threaded(default=5)
|
3813
3918
|
def external_resources_secrets_sync(
|
3814
|
-
ctx,
|
3919
|
+
ctx: click.Context,
|
3815
3920
|
thread_pool_size: int,
|
3816
|
-
):
|
3921
|
+
) -> None:
|
3817
3922
|
import reconcile.external_resources.integration_secrets_sync
|
3818
3923
|
|
3819
3924
|
run_integration(
|
3820
3925
|
reconcile.external_resources.integration_secrets_sync,
|
3821
|
-
ctx
|
3926
|
+
ctx,
|
3822
3927
|
thread_pool_size,
|
3823
3928
|
)
|
3824
3929
|
|
@@ -3828,7 +3933,9 @@ def external_resources_secrets_sync(
|
|
3828
3933
|
@internal()
|
3829
3934
|
@use_jump_host()
|
3830
3935
|
@click.pass_context
|
3831
|
-
def automated_actions_config(
|
3936
|
+
def automated_actions_config(
|
3937
|
+
ctx: click.Context, thread_pool_size: int, internal: bool, use_jump_host: bool
|
3938
|
+
) -> None:
|
3832
3939
|
from reconcile.automated_actions.config.integration import (
|
3833
3940
|
AutomatedActionsConfigIntegration,
|
3834
3941
|
AutomatedActionsConfigIntegrationParams,
|
@@ -3842,7 +3949,7 @@ def automated_actions_config(ctx, thread_pool_size, internal, use_jump_host):
|
|
3842
3949
|
internal=internal,
|
3843
3950
|
)
|
3844
3951
|
),
|
3845
|
-
ctx=ctx
|
3952
|
+
ctx=ctx,
|
3846
3953
|
)
|
3847
3954
|
|
3848
3955
|
|