qontract-reconcile 0.10.2.dev98__py3-none-any.whl → 0.10.2.dev100__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev98
3
+ Version: 0.10.2.dev100
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
@@ -207,13 +207,13 @@ reconcile/external_resources/reconciler.py,sha256=wB8cB5pmqDJ1_t5_Aly4mrULGnI3OQ
207
207
  reconcile/external_resources/secrets_sync.py,sha256=ZDxzGZ6wC4zxLhA7-L39xDRH6rzUM285gytuzmRQdlw,16208
208
208
  reconcile/external_resources/state.py,sha256=gF3ACdl7YiUlbQ4uEGrD6i_Txxqr6mT9f8IFlTQ-8dY,13176
209
209
  reconcile/fleet_labeler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
210
- reconcile/fleet_labeler/dependencies.py,sha256=6vD9dC1pXOztWQpQCZa2ZLbXrTf50kzjtpqewRybuJ4,3169
211
- reconcile/fleet_labeler/integration.py,sha256=vMvDnQW1NXv2qWeG8ab_gguBq45UtmYErSXy6XR83d8,14149
210
+ reconcile/fleet_labeler/dependencies.py,sha256=MFiSfT25Ks0X3iQxwayNvFX_l6bQi97f3IiaNR1wtHc,3173
211
+ reconcile/fleet_labeler/integration.py,sha256=ckmVga18DgidA2u50mFnp87oDAa2pKpnuORW-PMCKVY,14157
212
212
  reconcile/fleet_labeler/merge_request.py,sha256=SfGxXInxeJzVnsTtO0ZC9-PesUJMdpKxKY9eCB6ms-g,1538
213
213
  reconcile/fleet_labeler/meta.py,sha256=lWnpH2U0PHCPXu9Ok_CPmO494qQJQ5pOuqo28s0jzIQ,146
214
214
  reconcile/fleet_labeler/metrics.py,sha256=zhcp06woGaZywTqWZf3znh6C2S2u7OHBLXalXYKuTzQ,1934
215
215
  reconcile/fleet_labeler/ocm.py,sha256=qcg1_p7nKlZG7-MQeOZos3rz6YSPAPh-HKxE3OVJwe0,4165
216
- reconcile/fleet_labeler/validate.py,sha256=gzc2tt7h9F60h7dcyJfEmsnjnfuux5Jtc_WzrIqr-5k,2541
216
+ reconcile/fleet_labeler/validate.py,sha256=Ch4fe7jXQZKl4pnvl5IxWS-dKSIuuiwdH2B7mivZoco,1654
217
217
  reconcile/fleet_labeler/vcs.py,sha256=6UHUQ08AGAHXF7629I6X-T_E1pvx96LxjS66EeOzve4,1108
218
218
  reconcile/glitchtip/README.md,sha256=rfXT6jNP9khJW65jL7I2PgoxvxgcGGuJF8NpbzufEQ4,4335
219
219
  reconcile/glitchtip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -224,7 +224,7 @@ reconcile/glitchtip_project_alerts/integration.py,sha256=BgMx-NyV9mTuv7Sotb2OioC
224
224
  reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
225
225
  reconcile/glitchtip_project_dsn/integration.py,sha256=2iugub-kHYkHNK33n0v9_TeWonuxCPah_VkoTPvaajE,8077
226
226
  reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
227
- reconcile/gql_definitions/introspection.json,sha256=xA_cHhSy0wr9PG9y_Nwk75MbnjtHQjOEMd48nLZMK8E,2239784
227
+ reconcile/gql_definitions/introspection.json,sha256=-3s2bAXc064r3TJEHURAQX7_brHpdV72c-BR5_rXzpw,2239798
228
228
  reconcile/gql_definitions/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
229
229
  reconcile/gql_definitions/acs/acs_instances.py,sha256=L91WW9LbhJbBSrECqShQpFtjoBOsmNIYLRpMbx1io5o,2181
230
230
  reconcile/gql_definitions/acs/acs_policies.py,sha256=bN5i4mks10Z23KJSj7jqp966Osq2dps4d-sPH9gjxEA,7008
@@ -314,7 +314,7 @@ reconcile/gql_definitions/external_resources/external_resources_settings.py,sha2
314
314
  reconcile/gql_definitions/external_resources/fragments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
315
315
  reconcile/gql_definitions/external_resources/fragments/external_resources_module_overrides.py,sha256=T_qWCRtzU8F9frebBXG9TkeQdrKGt3R9YinSngPoFqM,1262
316
316
  reconcile/gql_definitions/fleet_labeler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
- reconcile/gql_definitions/fleet_labeler/fleet_labels.py,sha256=ow9LTm376Y5rCVMWgRtrj2yWKK7_aBC5AM7svLN7pKo,4546
317
+ reconcile/gql_definitions/fleet_labeler/fleet_labels.py,sha256=XPk1YFmiCtGlwrldxdABwYaT-wgZdTjpDFHmUnq6xcM,4349
318
318
  reconcile/gql_definitions/fragments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
319
319
  reconcile/gql_definitions/fragments/aus_organization.py,sha256=uBKbTuBa3CZmTXR5HOcGhRcu2U9kM93KbYmoWTxcpB0,4767
320
320
  reconcile/gql_definitions/fragments/aws_account_common.py,sha256=3-7ZAP6GSff7Z2Syz2VQCLY4IySqBOSVmceaRiVNQpw,2385
@@ -631,7 +631,7 @@ reconcile/utils/password_validator.py,sha256=XwuWg-8CPlcuG7dl_oQ1G1h2gSVSnfMym_V
631
631
  reconcile/utils/prometheus.py,sha256=Ad0rwLbxRuuYjHwkwJloHEdK0bvy42h-p-HIT1DhDhs,3832
632
632
  reconcile/utils/promotion_state.py,sha256=McSgGj3oog83ThJCrMR2v8q6Xb_Pxij-HEe_RbDu8cg,3946
633
633
  reconcile/utils/promtool.py,sha256=qOWgRY9-HgfTAcQz8NnLfnZn2WtCAvRAr85YQRXvMSA,2831
634
- reconcile/utils/quay_api.py,sha256=uE_jxcdy3ViHtYFAfwDQuFDaO7Pr6AAPoVnmORbyHio,7822
634
+ reconcile/utils/quay_api.py,sha256=SW9UEdIs4PUL7ttTrFxPXO_Eu39IKMAL86j0cAxnMVI,7938
635
635
  reconcile/utils/raw_github_api.py,sha256=2WKtE8ABYYB9UGOAh9N_kLkksBWL3320Z2_scteZddI,2805
636
636
  reconcile/utils/repo_owners.py,sha256=BHrAXxKyvn4qWJwFPWYGTtfgnLmYnWtYFEJGFeD__FE,6573
637
637
  reconcile/utils/rest_api_base.py,sha256=Ep3wmabbzpWzcvZsfJHN3R1XgNtQXHmiYKOMAgtLspk,4277
@@ -786,7 +786,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
786
786
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
787
787
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
788
788
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
789
- qontract_reconcile-0.10.2.dev98.dist-info/METADATA,sha256=MejCD_NtyQK68CSmDQ5laTsLKIDzMVDVp_YkPtbRvMs,24565
790
- qontract_reconcile-0.10.2.dev98.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
- qontract_reconcile-0.10.2.dev98.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
- qontract_reconcile-0.10.2.dev98.dist-info/RECORD,,
789
+ qontract_reconcile-0.10.2.dev100.dist-info/METADATA,sha256=B-YM-5lrAMNRoaIdRRJJTJ7f_5eRdK47wtq3gmGXkuM,24566
790
+ qontract_reconcile-0.10.2.dev100.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
+ qontract_reconcile-0.10.2.dev100.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
+ qontract_reconcile-0.10.2.dev100.dist-info/RECORD,,
@@ -61,10 +61,10 @@ def _ocm_clients(secret_reader: SecretReaderBase) -> dict[str, OCMClient]:
61
61
  for spec in get_fleet_label_specs():
62
62
  ocm_base_client = init_ocm_base_client(
63
63
  cfg=OCMClientConfig(
64
- url=spec.ocm.environment.url,
65
- access_token_client_id=spec.ocm.access_token_client_id,
66
- access_token_url=spec.ocm.access_token_url,
67
- access_token_client_secret=spec.ocm.access_token_client_secret,
64
+ url=spec.ocm_env.url,
65
+ access_token_client_id=spec.ocm_env.access_token_client_id,
66
+ access_token_url=spec.ocm_env.access_token_url,
67
+ access_token_client_secret=spec.ocm_env.access_token_client_secret,
68
68
  ),
69
69
  secret_reader=secret_reader,
70
70
  )
@@ -257,7 +257,7 @@ class FleetLabelerIntegration(QontractReconcileIntegration[NoParams]):
257
257
  f"[{spec.name}] Cluster ID {cluster_id} is matched multiple times by different label matchers:\n{label_matches}"
258
258
  )
259
259
  metrics.set_duplicate_cluster_matches_gauge(
260
- ocm_name=spec.ocm.name,
260
+ ocm_name=spec.ocm_env.name,
261
261
  spec_name=spec.name,
262
262
  value=len(clusters_with_duplicate_matches),
263
263
  )
@@ -291,7 +291,7 @@ class FleetLabelerIntegration(QontractReconcileIntegration[NoParams]):
291
291
  )
292
292
  )
293
293
  metrics.set_label_rendering_error_gauge(
294
- ocm_name=spec.ocm.name,
294
+ ocm_name=spec.ocm_env.name,
295
295
  spec_name=spec.name,
296
296
  value=label_rendering_errors_cnt,
297
297
  )
@@ -3,22 +3,9 @@ from collections.abc import Mapping
3
3
 
4
4
  from reconcile.gql_definitions.fleet_labeler.fleet_labels import (
5
5
  FleetLabelsSpecV1,
6
- OpenShiftClusterManagerV1,
7
6
  )
8
7
 
9
8
 
10
- class OCMAccessTokenClientIdMissing(Exception):
11
- pass
12
-
13
-
14
- class OCMAccessTokenClientSecretMissing(Exception):
15
- pass
16
-
17
-
18
- class OCMAccessTokenUrlMissing(Exception):
19
- pass
20
-
21
-
22
9
  class MatchLabelsNotUniqueError(Exception):
23
10
  pass
24
11
 
@@ -28,7 +15,6 @@ def validate_label_specs(specs: Mapping[str, FleetLabelsSpecV1]) -> None:
28
15
  We cannot catch all potential errors through json schema definition.
29
16
  """
30
17
  for spec in specs.values():
31
- _validate_ocm_token_spec(spec.ocm)
32
18
  _validate_match_labels(spec)
33
19
  _validate_unique_ocm_managed_label_combo(spec)
34
20
 
@@ -63,21 +49,3 @@ def _validate_match_labels(spec: FleetLabelsSpecV1) -> None:
63
49
  raise MatchLabelsNotUniqueError(
64
50
  f"The 'matchSubscriptionLabels' combinations must be unique within a spec. Found duplicates in spec {spec.name} for matchers: {duplicates}"
65
51
  )
66
-
67
-
68
- def _validate_ocm_token_spec(ocm: OpenShiftClusterManagerV1) -> None:
69
- """
70
- OCM tokens are optional in the schema. Lets verify they exist.
71
- """
72
- if not ocm.access_token_client_id:
73
- raise OCMAccessTokenClientIdMissing(
74
- f"accessTokenClientId missing in ocm spec '{ocm.name}'"
75
- )
76
- if not ocm.access_token_client_secret:
77
- raise OCMAccessTokenClientSecretMissing(
78
- f"accessTokenClientSecret missing in ocm spec '{ocm.name}'"
79
- )
80
- if not ocm.access_token_url:
81
- raise OCMAccessTokenUrlMissing(
82
- f"accessTokenUrl missing in ocm spec '{ocm.name}'"
83
- )
@@ -34,11 +34,9 @@ query FleetLabelSpecs {
34
34
  path
35
35
  managedSubscriptionLabelPrefix
36
36
  dryRunLabelSynchronization
37
- ocm {
37
+ ocmEnv {
38
38
  name
39
- environment {
40
- url
41
- }
39
+ url
42
40
  accessTokenClientId
43
41
  accessTokenClientSecret {
44
42
  ... VaultSecret
@@ -75,15 +73,11 @@ class ConfiguredBaseModel(BaseModel):
75
73
 
76
74
 
77
75
  class OpenShiftClusterManagerEnvironmentV1(ConfiguredBaseModel):
78
- url: str = Field(..., alias="url")
79
-
80
-
81
- class OpenShiftClusterManagerV1(ConfiguredBaseModel):
82
76
  name: str = Field(..., alias="name")
83
- environment: OpenShiftClusterManagerEnvironmentV1 = Field(..., alias="environment")
84
- access_token_client_id: Optional[str] = Field(..., alias="accessTokenClientId")
85
- access_token_client_secret: Optional[VaultSecret] = Field(..., alias="accessTokenClientSecret")
86
- access_token_url: Optional[str] = Field(..., alias="accessTokenUrl")
77
+ url: str = Field(..., alias="url")
78
+ access_token_client_id: str = Field(..., alias="accessTokenClientId")
79
+ access_token_client_secret: VaultSecret = Field(..., alias="accessTokenClientSecret")
80
+ access_token_url: str = Field(..., alias="accessTokenUrl")
87
81
 
88
82
 
89
83
  class ResourceV1(ConfiguredBaseModel):
@@ -115,7 +109,7 @@ class FleetLabelsSpecV1(ConfiguredBaseModel):
115
109
  path: str = Field(..., alias="path")
116
110
  managed_subscription_label_prefix: str = Field(..., alias="managedSubscriptionLabelPrefix")
117
111
  dry_run_label_synchronization: Optional[bool] = Field(..., alias="dryRunLabelSynchronization")
118
- ocm: OpenShiftClusterManagerV1 = Field(..., alias="ocm")
112
+ ocm_env: OpenShiftClusterManagerEnvironmentV1 = Field(..., alias="ocmEnv")
119
113
  label_defaults: list[FleetLabelDefaultV1] = Field(..., alias="labelDefaults")
120
114
  clusters: list[FleetClusterV1] = Field(..., alias="clusters")
121
115
 
@@ -34382,7 +34382,7 @@
34382
34382
  "deprecationReason": null
34383
34383
  },
34384
34384
  {
34385
- "name": "ocm",
34385
+ "name": "ocmEnv",
34386
34386
  "description": null,
34387
34387
  "args": [],
34388
34388
  "type": {
@@ -34390,7 +34390,7 @@
34390
34390
  "name": null,
34391
34391
  "ofType": {
34392
34392
  "kind": "OBJECT",
34393
- "name": "OpenShiftClusterManager_v1",
34393
+ "name": "OpenShiftClusterManagerEnvironment_v1",
34394
34394
  "ofType": null
34395
34395
  }
34396
34396
  },
@@ -68,9 +68,12 @@ class QuayApi:
68
68
  if not r.ok:
69
69
  message = r.json().get("message", "")
70
70
 
71
- expected_message = f"User {user} does not belong to team {team}"
71
+ expected_messages = [
72
+ f"User {user} does not belong to team {team}",
73
+ "User cannot remove themselves from their only admin team.",
74
+ ]
72
75
 
73
- if message != expected_message:
76
+ if message not in expected_messages:
74
77
  r.raise_for_status()
75
78
 
76
79
  url_org = f"{self.api_url}/organization/{self.organization}/members/{user}"