qontract-reconcile 0.10.2.dev184__py3-none-any.whl → 0.10.2.dev186__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.dev184.dist-info → qontract_reconcile-0.10.2.dev186.dist-info}/METADATA +1 -2
- {qontract_reconcile-0.10.2.dev184.dist-info → qontract_reconcile-0.10.2.dev186.dist-info}/RECORD +10 -12
- reconcile/acs_policies.py +1 -13
- reconcile/automated_actions/config/integration.py +85 -65
- reconcile/cli.py +0 -11
- reconcile/gql_definitions/acs/acs_policies.py +0 -90
- reconcile/gql_definitions/automated_actions/instance.py +47 -38
- reconcile/gql_definitions/introspection.json +634 -270
- reconcile/acs_notifiers.py +0 -126
- reconcile/utils/acs/notifiers.py +0 -145
- {qontract_reconcile-0.10.2.dev184.dist-info → qontract_reconcile-0.10.2.dev186.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev184.dist-info → qontract_reconcile-0.10.2.dev186.dist-info}/entry_points.txt +0 -0
{qontract_reconcile-0.10.2.dev184.dist-info → qontract_reconcile-0.10.2.dev186.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.2.
|
3
|
+
Version: 0.10.2.dev186
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
|
6
6
|
Project-URL: repository, https://github.com/app-sre/qontract-reconcile
|
@@ -99,7 +99,6 @@ OpenShift templates can be found [here](/openshift/qontract-reconcile.yaml). In
|
|
99
99
|
`qontract-reconcile` includes the following integrations:
|
100
100
|
|
101
101
|
```text
|
102
|
-
acs-notifiers Manages RHACS notifier configurations
|
103
102
|
acs-policies Manages RHACS security policy configurations
|
104
103
|
acs-rbac Manages RHACS rbac configuration
|
105
104
|
advanced-upgrade-scheduler Manage Cluster Upgrade Policy schedules in
|
{qontract_reconcile-0.10.2.dev184.dist-info → qontract_reconcile-0.10.2.dev186.dist-info}/RECORD
RENAMED
@@ -1,6 +1,5 @@
|
|
1
1
|
reconcile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
reconcile/
|
3
|
-
reconcile/acs_policies.py,sha256=xNbhIlwE1u2URbEQcX-3C-pTu--XjrKAqGj0-Wd85dY,9152
|
2
|
+
reconcile/acs_policies.py,sha256=pwFKP3afmRbpRq-7FRAosI-A60yfufE2vvXBjOMgsCU,8653
|
4
3
|
reconcile/acs_rbac.py,sha256=15vNfNzdG_DeXaJ-f5m8DSaJh__LUK766_xAECqyTsg,22657
|
5
4
|
reconcile/aws_ami_share.py,sha256=M_gT7y3cSAyT_Pm90PBCNDSmbZtqREqe2jNETh0i9Qs,3808
|
6
5
|
reconcile/aws_ecr_image_pull_secrets.py,sha256=F58PtX1GlB9XHqj8hGy9ItiTznXLAAKTNlWD9iT2MWI,2593
|
@@ -10,7 +9,7 @@ reconcile/aws_iam_password_reset.py,sha256=O0JX2N5kNRKs3u2xzu4NNrI6p0ag5JWy3MTsv
|
|
10
9
|
reconcile/aws_support_cases_sos.py,sha256=PDhilxQ4TBxVnxUPIUdTbKEaNUI0wzPiEsB91oHT2fY,3384
|
11
10
|
reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
|
12
11
|
reconcile/checkpoint.py,sha256=_JhMxrye5BgkRMxWYuf7Upli6XayPINKSsuo3ynHTRc,5010
|
13
|
-
reconcile/cli.py,sha256
|
12
|
+
reconcile/cli.py,sha256=-WTtuEtxDuHdZ-GIGtklu4p6r8YdR7QfRqdK6rHl2gY,108163
|
14
13
|
reconcile/closedbox_endpoint_monitoring_base.py,sha256=al7m8EgnnYx90rY1REryW3byN_ItfJfAzEeLtjbCfi0,4921
|
15
14
|
reconcile/cluster_deployment_mapper.py,sha256=5gumAaRCcFXsabUJ1dnuUy9WrP_FEEM5JnOnE8ch9sE,2326
|
16
15
|
reconcile/dashdotdb_base.py,sha256=83ZWIf5JJk3P_D69y2TmXRcQr6ELJGlv10OM0h7fJVs,4767
|
@@ -141,7 +140,7 @@ reconcile/aus/version_gates/ocp_gate_handler.py,sha256=RW1ppDaCZXVegV9AzzqYXxDUu
|
|
141
140
|
reconcile/aus/version_gates/sts_version_gate_handler.py,sha256=swwwz0YyvrEBf_InqrRRBCt2QzHYNvvq8jz9aYwElh4,3663
|
142
141
|
reconcile/automated_actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
143
142
|
reconcile/automated_actions/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
144
|
-
reconcile/automated_actions/config/integration.py,sha256=
|
143
|
+
reconcile/automated_actions/config/integration.py,sha256=gDNUKxs8m_4GWH0GnW9QXubtsBF6idc0kHxo05hdj0U,11633
|
145
144
|
reconcile/aws_account_manager/README.md,sha256=_XFM3GZNHUzv--e_navqJuaUWpjC6QrHfulreHynFf0,262
|
146
145
|
reconcile/aws_account_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
147
146
|
reconcile/aws_account_manager/integration.py,sha256=XTamC824imAezzVoQhhwdMOawNcPCOghR_y7i_8bpJI,15343
|
@@ -227,10 +226,10 @@ reconcile/glitchtip_project_alerts/integration.py,sha256=BgMx-NyV9mTuv7Sotb2OioC
|
|
227
226
|
reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
228
227
|
reconcile/glitchtip_project_dsn/integration.py,sha256=2iugub-kHYkHNK33n0v9_TeWonuxCPah_VkoTPvaajE,8077
|
229
228
|
reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
230
|
-
reconcile/gql_definitions/introspection.json,sha256=
|
229
|
+
reconcile/gql_definitions/introspection.json,sha256=MT1HCR90ZahZxjrgaBEp34JNhjaEiDRblQK-qfSrfF0,2316277
|
231
230
|
reconcile/gql_definitions/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
232
231
|
reconcile/gql_definitions/acs/acs_instances.py,sha256=L91WW9LbhJbBSrECqShQpFtjoBOsmNIYLRpMbx1io5o,2181
|
233
|
-
reconcile/gql_definitions/acs/acs_policies.py,sha256=
|
232
|
+
reconcile/gql_definitions/acs/acs_policies.py,sha256=Ygpfl2-VkYLSlJvHgp_dJBfb66K_Rwfdfpsa18w1v1s,4338
|
234
233
|
reconcile/gql_definitions/acs/acs_rbac.py,sha256=cZsIlCWliPQdQHgmBsIMx54fJNOtkdRXLzmOKZmJNHk,3009
|
235
234
|
reconcile/gql_definitions/advanced_upgrade_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
236
235
|
reconcile/gql_definitions/advanced_upgrade_service/aus_clusters.py,sha256=230uwBoBaaVz686d_WNZT9eAw6BX2VpoQX0mKhf5UcM,4390
|
@@ -241,7 +240,7 @@ reconcile/gql_definitions/app_sre_tekton_access_revalidation/__init__.py,sha256=
|
|
241
240
|
reconcile/gql_definitions/app_sre_tekton_access_revalidation/roles.py,sha256=8Y4NsS5T7tumDWxY5MuoV50MK2i-DsLYSpCRjb7KaLE,2353
|
242
241
|
reconcile/gql_definitions/app_sre_tekton_access_revalidation/users.py,sha256=XdVxBxiyTR6Cy939EHNw__0k7iWrZWlhrgS5DakST0I,2504
|
243
242
|
reconcile/gql_definitions/automated_actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
244
|
-
reconcile/gql_definitions/automated_actions/instance.py,sha256=
|
243
|
+
reconcile/gql_definitions/automated_actions/instance.py,sha256=73vRFDvrD9t2cY1Y8jmjfVPNJ_osPrI8fHTAQz0CGv4,6105
|
245
244
|
reconcile/gql_definitions/aws_account_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
246
245
|
reconcile/gql_definitions/aws_account_manager/aws_accounts.py,sha256=vF51KrY2gwX0J9vESiaRMPQqdAMEtz9f_tBq52bInp0,5148
|
247
246
|
reconcile/gql_definitions/aws_ami_cleanup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -675,7 +674,6 @@ reconcile/utils/vaultsecretref.py,sha256=0KUSzuvTRxPyKY919TO3-B_eYg4_76fzKvMF8j5
|
|
675
674
|
reconcile/utils/vcs.py,sha256=AK35vIjx9bXYclKmvNekpaG_OETt-ZybibwV-m123xc,10186
|
676
675
|
reconcile/utils/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
677
676
|
reconcile/utils/acs/base.py,sha256=4UsDrCpAOuddL3PKNuIQYoJP1BtZQNNB8_KEX0lXneg,2532
|
678
|
-
reconcile/utils/acs/notifiers.py,sha256=DlzTDM9arWQlBSiDy70y5Mf38OKVs9V0FzFe2LfOKXA,5046
|
679
677
|
reconcile/utils/acs/policies.py,sha256=jpbi3qpGkBD_X6MfzsX12dPajUbmACmhIOz_0rDvYzs,5489
|
680
678
|
reconcile/utils/acs/rbac.py,sha256=ugsLM9Pb7FbUbdq85E3VzXGMaB9ZovXob7tdWCxwqZ8,8808
|
681
679
|
reconcile/utils/aws_api_typed/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -807,7 +805,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
807
805
|
tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
|
808
806
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
809
807
|
tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
|
810
|
-
qontract_reconcile-0.10.2.
|
811
|
-
qontract_reconcile-0.10.2.
|
812
|
-
qontract_reconcile-0.10.2.
|
813
|
-
qontract_reconcile-0.10.2.
|
808
|
+
qontract_reconcile-0.10.2.dev186.dist-info/METADATA,sha256=0hGybBCljHc9z_10Wcq6RvjgFFVSF7GPG9w5yhdMTTM,24555
|
809
|
+
qontract_reconcile-0.10.2.dev186.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
810
|
+
qontract_reconcile-0.10.2.dev186.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
|
811
|
+
qontract_reconcile-0.10.2.dev186.dist-info/RECORD,,
|
reconcile/acs_policies.py
CHANGED
@@ -8,7 +8,6 @@ from reconcile.gql_definitions.acs.acs_policies import (
|
|
8
8
|
AcsPolicyV1,
|
9
9
|
)
|
10
10
|
from reconcile.utils import gql
|
11
|
-
from reconcile.utils.acs.notifiers import JiraNotifier
|
12
11
|
from reconcile.utils.acs.policies import AcsPolicyApi, Policy, PolicyCondition, Scope
|
13
12
|
from reconcile.utils.differ import diff_iterables
|
14
13
|
from reconcile.utils.runtime.integration import (
|
@@ -63,21 +62,10 @@ class AcsPoliciesIntegration(QontractReconcileIntegration[NoParams]):
|
|
63
62
|
conditions = [
|
64
63
|
pc for c in gql_policy.conditions if (pc := self._build_policy_condition(c))
|
65
64
|
]
|
66
|
-
jira_notifier = (
|
67
|
-
notifier_name_to_id.get(
|
68
|
-
JiraNotifier.from_escalation_policy(
|
69
|
-
gql_policy.integrations.notifiers.jira.escalation_policy
|
70
|
-
).name
|
71
|
-
)
|
72
|
-
if gql_policy.integrations
|
73
|
-
and gql_policy.integrations.notifiers
|
74
|
-
and gql_policy.integrations.notifiers.jira
|
75
|
-
else None
|
76
|
-
)
|
77
65
|
return Policy(
|
78
66
|
name=gql_policy.name,
|
79
67
|
description=gql_policy.description,
|
80
|
-
notifiers=[
|
68
|
+
notifiers=[],
|
81
69
|
severity=f"{gql_policy.severity.upper()}_SEVERITY", # align with acs api severity value format
|
82
70
|
scope=sorted(
|
83
71
|
[
|
@@ -16,10 +16,11 @@ from pydantic import BaseModel
|
|
16
16
|
|
17
17
|
import reconcile.openshift_base as ob
|
18
18
|
from reconcile.gql_definitions.automated_actions.instance import (
|
19
|
-
|
20
|
-
|
19
|
+
AutomatedActionActionListV1,
|
20
|
+
AutomatedActionOpenshiftWorkloadRestartArgumentV1,
|
21
|
+
AutomatedActionOpenshiftWorkloadRestartV1,
|
21
22
|
AutomatedActionsInstanceV1,
|
22
|
-
|
23
|
+
AutomatedActionV1,
|
23
24
|
)
|
24
25
|
from reconcile.gql_definitions.automated_actions.instance import query as instance_query
|
25
26
|
from reconcile.utils import expiration, gql
|
@@ -35,7 +36,7 @@ from reconcile.utils.runtime.integration import (
|
|
35
36
|
from reconcile.utils.semver_helper import make_semver
|
36
37
|
|
37
38
|
QONTRACT_INTEGRATION = "automated-actions-config"
|
38
|
-
QONTRACT_INTEGRATION_VERSION = make_semver(0, 1,
|
39
|
+
QONTRACT_INTEGRATION_VERSION = make_semver(0, 1, 1)
|
39
40
|
|
40
41
|
|
41
42
|
class AutomatedActionsConfigIntegrationParams(PydanticRunParams):
|
@@ -51,7 +52,6 @@ class AutomatedActionsUser(BaseModel):
|
|
51
52
|
|
52
53
|
|
53
54
|
class AutomatedActionsPolicy(BaseModel):
|
54
|
-
sub: str
|
55
55
|
obj: str
|
56
56
|
max_ops: int
|
57
57
|
params: dict[str, str] = {}
|
@@ -89,89 +89,109 @@ class AutomatedActionsConfigIntegration(
|
|
89
89
|
for instance in data.automated_actions_instances_v1 or []:
|
90
90
|
if instance.deployment.delete:
|
91
91
|
continue
|
92
|
-
instance.
|
93
|
-
self.filter_permissions(instance.permissions or [])
|
94
|
-
)
|
92
|
+
instance.actions = list(self.filter_actions(instance.actions or []))
|
95
93
|
yield instance
|
96
94
|
|
97
|
-
def is_enabled(
|
95
|
+
def is_enabled(
|
96
|
+
self, argument: AutomatedActionOpenshiftWorkloadRestartArgumentV1
|
97
|
+
) -> bool:
|
98
98
|
"""Check if the integration is enabled for the given argument namespace."""
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
)
|
104
|
-
return True
|
99
|
+
return (
|
100
|
+
integration_is_enabled("automated-actions", argument.namespace.cluster)
|
101
|
+
and not argument.namespace.delete
|
102
|
+
)
|
105
103
|
|
106
|
-
def
|
107
|
-
self,
|
108
|
-
) -> Generator[
|
104
|
+
def filter_actions(
|
105
|
+
self, actions: Iterable[AutomatedActionV1]
|
106
|
+
) -> Generator[AutomatedActionV1, None, None]:
|
109
107
|
"""Filter out expired roles and arguments (cluster.namespace) with disabled integrations."""
|
110
|
-
for
|
111
|
-
|
112
|
-
|
113
|
-
|
108
|
+
for action in actions:
|
109
|
+
match action:
|
110
|
+
case AutomatedActionOpenshiftWorkloadRestartV1():
|
111
|
+
# automated actions disabled for the cluster?
|
112
|
+
action.openshift_workload_restart_arguments = [
|
113
|
+
arg
|
114
|
+
for arg in action.openshift_workload_restart_arguments or []
|
115
|
+
if self.is_enabled(arg)
|
116
|
+
]
|
117
|
+
|
118
|
+
# Remove expired roles
|
119
|
+
for permission in action.permissions or []:
|
120
|
+
permission.roles = expiration.filter(permission.roles)
|
121
|
+
|
122
|
+
# Remove permissions without roles
|
123
|
+
action.permissions = [
|
124
|
+
permission
|
125
|
+
for permission in action.permissions or []
|
126
|
+
if permission.roles
|
114
127
|
]
|
115
|
-
|
116
|
-
|
117
|
-
if not permission.roles:
|
128
|
+
|
129
|
+
if not action.permissions:
|
118
130
|
continue
|
119
|
-
|
131
|
+
|
132
|
+
yield action
|
120
133
|
|
121
134
|
def compile_users(
|
122
|
-
self,
|
135
|
+
self, actions: Iterable[AutomatedActionV1]
|
123
136
|
) -> list[AutomatedActionsUser]:
|
124
|
-
"""Compile all automated actions
|
137
|
+
"""Compile a list of all automated actions users with their role relations."""
|
125
138
|
users: dict[str, AutomatedActionsUser] = {}
|
126
|
-
for
|
127
|
-
for
|
128
|
-
for
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
139
|
+
for action in actions:
|
140
|
+
for permission in action.permissions or []:
|
141
|
+
for role in permission.roles or []:
|
142
|
+
for user in (role.users or []) + (role.bots or []):
|
143
|
+
if not user.org_username:
|
144
|
+
continue
|
145
|
+
aa_user = users.setdefault(
|
146
|
+
user.org_username,
|
147
|
+
AutomatedActionsUser(username=user.org_username, roles=[]),
|
148
|
+
)
|
149
|
+
aa_user.roles.add(role.name)
|
136
150
|
|
137
151
|
return list(users.values())
|
138
152
|
|
139
153
|
def compile_roles(
|
140
|
-
self,
|
154
|
+
self, actions: Iterable[AutomatedActionV1]
|
141
155
|
) -> AutomatedActionRoles:
|
142
156
|
"""Compile all automated actions policies."""
|
143
157
|
roles: AutomatedActionRoles = {}
|
144
158
|
|
145
|
-
for
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
159
|
+
for action in actions:
|
160
|
+
parameters: list[dict[str, str]] = []
|
161
|
+
match action:
|
162
|
+
case AutomatedActionActionListV1():
|
163
|
+
# no special handling needed, just dump the values
|
164
|
+
parameters.extend(
|
165
|
+
arg.dict(exclude_none=True, exclude_defaults=True)
|
166
|
+
for arg in action.action_list_arguments or []
|
167
|
+
)
|
168
|
+
case AutomatedActionOpenshiftWorkloadRestartV1():
|
169
|
+
parameters.extend(
|
170
|
+
{
|
153
171
|
# all parameter values are regexes in the OPA policy
|
154
172
|
# therefore, cluster and namespace must be fixed to the current strings
|
155
173
|
"cluster": f"^{arg.namespace.cluster.name}$",
|
156
174
|
"namespace": f"^{arg.namespace.name}$",
|
157
|
-
"kind": arg.
|
158
|
-
"name": arg.
|
159
|
-
}
|
160
|
-
|
161
|
-
|
162
|
-
|
175
|
+
"kind": arg.kind,
|
176
|
+
"name": arg.name,
|
177
|
+
}
|
178
|
+
for arg in action.openshift_workload_restart_arguments
|
179
|
+
)
|
180
|
+
|
181
|
+
if not parameters:
|
182
|
+
parameters = [{}]
|
183
|
+
|
184
|
+
for permission in action.permissions or []:
|
185
|
+
for role in permission.roles or []:
|
186
|
+
aa_role = roles.setdefault(role.name, [])
|
187
|
+
aa_role.extend(
|
188
|
+
AutomatedActionsPolicy(
|
189
|
+
obj=action.q_type,
|
190
|
+
max_ops=action.max_ops,
|
191
|
+
params=params,
|
163
192
|
)
|
164
|
-
|
165
|
-
aa_role = roles.setdefault(role.name, [])
|
166
|
-
aa_role.extend(
|
167
|
-
AutomatedActionsPolicy(
|
168
|
-
sub=role.name,
|
169
|
-
obj=action.operation_id,
|
170
|
-
max_ops=action.max_ops,
|
171
|
-
params=params,
|
193
|
+
for params in parameters
|
172
194
|
)
|
173
|
-
for params in parameters
|
174
|
-
)
|
175
195
|
return roles
|
176
196
|
|
177
197
|
def build_policy_file(
|
@@ -273,8 +293,8 @@ class AutomatedActionsConfigIntegration(
|
|
273
293
|
ri = ResourceInventory()
|
274
294
|
|
275
295
|
for instance in instances:
|
276
|
-
users = self.compile_users(instance.
|
277
|
-
policies = self.compile_roles(instance.
|
296
|
+
users = self.compile_users(instance.actions or [])
|
297
|
+
policies = self.compile_roles(instance.actions or [])
|
278
298
|
if not users and not policies:
|
279
299
|
logging.info(
|
280
300
|
f"{instance.deployment.cluster.name}/{instance.deployment.name}: No enabled automated actions found. Skipping this instance!"
|
reconcile/cli.py
CHANGED
@@ -3719,17 +3719,6 @@ def acs_policies(ctx):
|
|
3719
3719
|
)
|
3720
3720
|
|
3721
3721
|
|
3722
|
-
@integration.command(short_help="Manages RHACS notifier configurations")
|
3723
|
-
@click.pass_context
|
3724
|
-
def acs_notifiers(ctx):
|
3725
|
-
from reconcile import acs_notifiers
|
3726
|
-
|
3727
|
-
run_class_integration(
|
3728
|
-
integration=acs_notifiers.AcsNotifiersIntegration(),
|
3729
|
-
ctx=ctx.obj,
|
3730
|
-
)
|
3731
|
-
|
3732
|
-
|
3733
3722
|
@integration.command(short_help="Manage Unleash feature toggles.")
|
3734
3723
|
@click.option("--instance", help="Reconcile just this Unlash instance.", default=None)
|
3735
3724
|
@click.pass_context
|
@@ -24,40 +24,6 @@ query AcsPolicy {
|
|
24
24
|
name
|
25
25
|
description
|
26
26
|
severity
|
27
|
-
integrations {
|
28
|
-
notifiers {
|
29
|
-
jira {
|
30
|
-
escalationPolicy {
|
31
|
-
name
|
32
|
-
channels {
|
33
|
-
jiraBoard {
|
34
|
-
name
|
35
|
-
server {
|
36
|
-
serverUrl
|
37
|
-
}
|
38
|
-
severityPriorityMappings {
|
39
|
-
name
|
40
|
-
mappings {
|
41
|
-
severity
|
42
|
-
priority
|
43
|
-
}
|
44
|
-
}
|
45
|
-
issueType
|
46
|
-
issueFields {
|
47
|
-
name
|
48
|
-
value
|
49
|
-
}
|
50
|
-
disable {
|
51
|
-
integrations
|
52
|
-
}
|
53
|
-
}
|
54
|
-
jiraComponent
|
55
|
-
jiraLabels
|
56
|
-
}
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
60
|
-
}
|
61
27
|
categories
|
62
28
|
scope {
|
63
29
|
level
|
@@ -107,61 +73,6 @@ class ConfiguredBaseModel(BaseModel):
|
|
107
73
|
extra=Extra.forbid
|
108
74
|
|
109
75
|
|
110
|
-
class JiraServerV1(ConfiguredBaseModel):
|
111
|
-
server_url: str = Field(..., alias="serverUrl")
|
112
|
-
|
113
|
-
|
114
|
-
class SeverityPriorityMappingV1(ConfiguredBaseModel):
|
115
|
-
severity: str = Field(..., alias="severity")
|
116
|
-
priority: str = Field(..., alias="priority")
|
117
|
-
|
118
|
-
|
119
|
-
class JiraSeverityPriorityMappingsV1(ConfiguredBaseModel):
|
120
|
-
name: str = Field(..., alias="name")
|
121
|
-
mappings: list[SeverityPriorityMappingV1] = Field(..., alias="mappings")
|
122
|
-
|
123
|
-
|
124
|
-
class JiraBoardIssueFieldV1(ConfiguredBaseModel):
|
125
|
-
name: str = Field(..., alias="name")
|
126
|
-
value: str = Field(..., alias="value")
|
127
|
-
|
128
|
-
|
129
|
-
class DisableJiraBoardAutomationsV1(ConfiguredBaseModel):
|
130
|
-
integrations: Optional[list[str]] = Field(..., alias="integrations")
|
131
|
-
|
132
|
-
|
133
|
-
class JiraBoardV1(ConfiguredBaseModel):
|
134
|
-
name: str = Field(..., alias="name")
|
135
|
-
server: JiraServerV1 = Field(..., alias="server")
|
136
|
-
severity_priority_mappings: JiraSeverityPriorityMappingsV1 = Field(..., alias="severityPriorityMappings")
|
137
|
-
issue_type: Optional[str] = Field(..., alias="issueType")
|
138
|
-
issue_fields: Optional[list[JiraBoardIssueFieldV1]] = Field(..., alias="issueFields")
|
139
|
-
disable: Optional[DisableJiraBoardAutomationsV1] = Field(..., alias="disable")
|
140
|
-
|
141
|
-
|
142
|
-
class AppEscalationPolicyChannelsV1(ConfiguredBaseModel):
|
143
|
-
jira_board: list[JiraBoardV1] = Field(..., alias="jiraBoard")
|
144
|
-
jira_component: Optional[str] = Field(..., alias="jiraComponent")
|
145
|
-
jira_labels: Optional[list[str]] = Field(..., alias="jiraLabels")
|
146
|
-
|
147
|
-
|
148
|
-
class AppEscalationPolicyV1(ConfiguredBaseModel):
|
149
|
-
name: str = Field(..., alias="name")
|
150
|
-
channels: AppEscalationPolicyChannelsV1 = Field(..., alias="channels")
|
151
|
-
|
152
|
-
|
153
|
-
class AcsPolicyIntegrationNotifierJiraV1(ConfiguredBaseModel):
|
154
|
-
escalation_policy: AppEscalationPolicyV1 = Field(..., alias="escalationPolicy")
|
155
|
-
|
156
|
-
|
157
|
-
class AcsPolicyIntegrationNotifiersV1(ConfiguredBaseModel):
|
158
|
-
jira: Optional[AcsPolicyIntegrationNotifierJiraV1] = Field(..., alias="jira")
|
159
|
-
|
160
|
-
|
161
|
-
class AcsPolicyIntegrationsV1(ConfiguredBaseModel):
|
162
|
-
notifiers: Optional[AcsPolicyIntegrationNotifiersV1] = Field(..., alias="notifiers")
|
163
|
-
|
164
|
-
|
165
76
|
class AcsPolicyScopeV1(ConfiguredBaseModel):
|
166
77
|
level: str = Field(..., alias="level")
|
167
78
|
|
@@ -218,7 +129,6 @@ class AcsPolicyV1(ConfiguredBaseModel):
|
|
218
129
|
name: str = Field(..., alias="name")
|
219
130
|
description: Optional[str] = Field(..., alias="description")
|
220
131
|
severity: str = Field(..., alias="severity")
|
221
|
-
integrations: Optional[AcsPolicyIntegrationsV1] = Field(..., alias="integrations")
|
222
132
|
categories: list[str] = Field(..., alias="categories")
|
223
133
|
scope: Union[AcsPolicyScopeClusterV1, AcsPolicyScopeNamespaceV1, AcsPolicyScopeV1] = Field(..., alias="scope")
|
224
134
|
conditions: list[Union[AcsPolicyConditionsCvssV1, AcsPolicyConditionsSeverityV1, AcsPolicyConditionsImageTagV1, AcsPolicyConditionsCveV1, AcsPolicyConditionsImageAgeV1, AcsPolicyConditionsV1]] = Field(..., alias="conditions")
|
@@ -69,27 +69,23 @@ query AutomatedActionsInstances {
|
|
69
69
|
...OcConnectionCluster
|
70
70
|
}
|
71
71
|
}
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
72
|
+
actions {
|
73
|
+
type
|
74
|
+
permissions {
|
75
|
+
roles {
|
76
|
+
name
|
77
|
+
users {
|
78
|
+
org_username
|
79
|
+
}
|
80
|
+
bots {
|
81
|
+
org_username
|
82
|
+
}
|
83
|
+
expirationDate
|
80
84
|
}
|
81
|
-
expirationDate
|
82
85
|
}
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
retries
|
87
|
-
maxOps
|
88
|
-
}
|
89
|
-
|
90
|
-
arguments {
|
91
|
-
type
|
92
|
-
... on AutomatedActionArgumentOpenshift_v1 {
|
86
|
+
maxOps
|
87
|
+
... on AutomatedActionOpenshiftWorkloadRestart_v1 {
|
88
|
+
openshift_workload_restart_arguments: arguments {
|
93
89
|
namespace {
|
94
90
|
name
|
95
91
|
delete
|
@@ -100,8 +96,14 @@ query AutomatedActionsInstances {
|
|
100
96
|
}
|
101
97
|
}
|
102
98
|
}
|
103
|
-
|
104
|
-
|
99
|
+
kind
|
100
|
+
name
|
101
|
+
}
|
102
|
+
}
|
103
|
+
... on AutomatedActionActionList_v1 {
|
104
|
+
action_list_arguments: arguments {
|
105
|
+
action_user
|
106
|
+
max_age_minutes
|
105
107
|
}
|
106
108
|
}
|
107
109
|
}
|
@@ -138,47 +140,54 @@ class RoleV1(ConfiguredBaseModel):
|
|
138
140
|
expiration_date: Optional[str] = Field(..., alias="expirationDate")
|
139
141
|
|
140
142
|
|
141
|
-
class
|
142
|
-
|
143
|
-
retries: int = Field(..., alias="retries")
|
144
|
-
max_ops: int = Field(..., alias="maxOps")
|
143
|
+
class PermissionAutomatedActionsV1(ConfiguredBaseModel):
|
144
|
+
roles: Optional[list[RoleV1]] = Field(..., alias="roles")
|
145
145
|
|
146
146
|
|
147
|
-
class
|
147
|
+
class AutomatedActionV1(ConfiguredBaseModel):
|
148
148
|
q_type: str = Field(..., alias="type")
|
149
|
+
permissions: Optional[list[PermissionAutomatedActionsV1]] = Field(..., alias="permissions")
|
150
|
+
max_ops: int = Field(..., alias="maxOps")
|
149
151
|
|
150
152
|
|
151
153
|
class DisableClusterAutomationsV1(ConfiguredBaseModel):
|
152
154
|
integrations: Optional[list[str]] = Field(..., alias="integrations")
|
153
155
|
|
154
156
|
|
155
|
-
class
|
157
|
+
class AutomatedActionOpenshiftWorkloadRestartArgumentV1_NamespaceV1_ClusterV1(ConfiguredBaseModel):
|
156
158
|
name: str = Field(..., alias="name")
|
157
159
|
disable: Optional[DisableClusterAutomationsV1] = Field(..., alias="disable")
|
158
160
|
|
159
161
|
|
160
|
-
class
|
162
|
+
class AutomatedActionOpenshiftWorkloadRestartArgumentV1_NamespaceV1(ConfiguredBaseModel):
|
161
163
|
name: str = Field(..., alias="name")
|
162
164
|
delete: Optional[bool] = Field(..., alias="delete")
|
163
|
-
cluster:
|
165
|
+
cluster: AutomatedActionOpenshiftWorkloadRestartArgumentV1_NamespaceV1_ClusterV1 = Field(..., alias="cluster")
|
164
166
|
|
165
167
|
|
166
|
-
class
|
167
|
-
namespace:
|
168
|
-
|
169
|
-
|
168
|
+
class AutomatedActionOpenshiftWorkloadRestartArgumentV1(ConfiguredBaseModel):
|
169
|
+
namespace: AutomatedActionOpenshiftWorkloadRestartArgumentV1_NamespaceV1 = Field(..., alias="namespace")
|
170
|
+
kind: str = Field(..., alias="kind")
|
171
|
+
name: str = Field(..., alias="name")
|
170
172
|
|
171
173
|
|
172
|
-
class
|
173
|
-
|
174
|
-
|
175
|
-
|
174
|
+
class AutomatedActionOpenshiftWorkloadRestartV1(AutomatedActionV1):
|
175
|
+
openshift_workload_restart_arguments: list[AutomatedActionOpenshiftWorkloadRestartArgumentV1] = Field(..., alias="openshift_workload_restart_arguments")
|
176
|
+
|
177
|
+
|
178
|
+
class AutomatedActionActionListArgumentV1(ConfiguredBaseModel):
|
179
|
+
action_user: Optional[str] = Field(..., alias="action_user")
|
180
|
+
max_age_minutes: Optional[int] = Field(..., alias="max_age_minutes")
|
181
|
+
|
182
|
+
|
183
|
+
class AutomatedActionActionListV1(AutomatedActionV1):
|
184
|
+
action_list_arguments: Optional[list[AutomatedActionActionListArgumentV1]] = Field(..., alias="action_list_arguments")
|
176
185
|
|
177
186
|
|
178
187
|
class AutomatedActionsInstanceV1(ConfiguredBaseModel):
|
179
188
|
name: str = Field(..., alias="name")
|
180
189
|
deployment: NamespaceV1 = Field(..., alias="deployment")
|
181
|
-
|
190
|
+
actions: Optional[list[Union[AutomatedActionOpenshiftWorkloadRestartV1, AutomatedActionActionListV1, AutomatedActionV1]]] = Field(..., alias="actions")
|
182
191
|
|
183
192
|
|
184
193
|
class AutomatedActionsInstancesQueryData(ConfiguredBaseModel):
|