qontract-reconcile 0.10.2.dev104__py3-none-any.whl → 0.10.2.dev106__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.dev104
3
+ Version: 0.10.2.dev106
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
@@ -195,7 +195,7 @@ reconcile/endpoints_discovery/integration.py,sha256=ecjIZK_h6JO2wUhUmJlZ9pjOh60n
195
195
  reconcile/endpoints_discovery/merge_request.py,sha256=_yLb4tnvoZMCko8rta2C_CvOInJa9pa3HzSmHNtjgGU,2978
196
196
  reconcile/endpoints_discovery/merge_request_manager.py,sha256=a8zTIQIpRrUwXexZClwpQnnkEoS6XNZLJziI9x7ly0s,6389
197
197
  reconcile/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
198
- reconcile/external_resources/aws.py,sha256=q9ub1vI4meG8YzM6A88Q422XkTu6Y3ja12GuMjCwISs,11631
198
+ reconcile/external_resources/aws.py,sha256=KAZo-PcreAJ8gMPJU4d5ZaN2lo2OXvOfIF1kN1x8F38,11932
199
199
  reconcile/external_resources/factories.py,sha256=C0QHT0soEv6z99-ELAAE19S5MaMHhV0t1fSiQn0Coc4,5970
200
200
  reconcile/external_resources/integration.py,sha256=WF6O4rT0oUHbNaWEemjLLzCqdNSQIUaymUuj08VsIl8,7034
201
201
  reconcile/external_resources/integration_secrets_sync.py,sha256=CImwt_tyS3MMGpkjI_0gZqYt4XgqIw4BtdJiDH2xrCk,1700
@@ -208,10 +208,10 @@ reconcile/external_resources/secrets_sync.py,sha256=ZDxzGZ6wC4zxLhA7-L39xDRH6rzU
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
210
  reconcile/fleet_labeler/dependencies.py,sha256=MFiSfT25Ks0X3iQxwayNvFX_l6bQi97f3IiaNR1wtHc,3173
211
- reconcile/fleet_labeler/integration.py,sha256=ckmVga18DgidA2u50mFnp87oDAa2pKpnuORW-PMCKVY,14157
211
+ reconcile/fleet_labeler/integration.py,sha256=HGlUJe5BCfAgk7YCxxsIteB8LH1pL8led-KfaIVh214,14614
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
- reconcile/fleet_labeler/metrics.py,sha256=zhcp06woGaZywTqWZf3znh6C2S2u7OHBLXalXYKuTzQ,1934
214
+ reconcile/fleet_labeler/metrics.py,sha256=n2GkaEEIgIrwMy85Ztm_x34YrrKXKLIPlerxVXExzdE,3255
215
215
  reconcile/fleet_labeler/ocm.py,sha256=qcg1_p7nKlZG7-MQeOZos3rz6YSPAPh-HKxE3OVJwe0,4165
216
216
  reconcile/fleet_labeler/validate.py,sha256=Ch4fe7jXQZKl4pnvl5IxWS-dKSIuuiwdH2B7mivZoco,1654
217
217
  reconcile/fleet_labeler/vcs.py,sha256=6UHUQ08AGAHXF7629I6X-T_E1pvx96LxjS66EeOzve4,1108
@@ -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=-3s2bAXc064r3TJEHURAQX7_brHpdV72c-BR5_rXzpw,2239798
227
+ reconcile/gql_definitions/introspection.json,sha256=kY3f6I33Qo8h3ie2YiUWIXCNnlAe6_Ct-MVDuewmegQ,2246801
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
@@ -309,7 +309,7 @@ reconcile/gql_definitions/endpoints_discovery/apps.py,sha256=aBWRAwDUJQ32ghJS4cP
309
309
  reconcile/gql_definitions/external_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
310
310
  reconcile/gql_definitions/external_resources/aws_accounts.py,sha256=XR69j9dpTQ0gv8y-AZN7AJ0dPvO-wbHscyCDgrax6Bk,2046
311
311
  reconcile/gql_definitions/external_resources/external_resources_modules.py,sha256=JViHtDWEBwjStBUo_bUdm_sxdpjCHcoATeFvwFRLQpU,3009
312
- reconcile/gql_definitions/external_resources/external_resources_namespaces.py,sha256=GLkKeODZ4_wJ2WxuYXitfq3TTcISv5XF9w5JOKSzNjg,43187
312
+ reconcile/gql_definitions/external_resources/external_resources_namespaces.py,sha256=qGslq_4LdKd0jt8-TYySBU9c6rTTPVxG613xLSDFxBQ,44622
313
313
  reconcile/gql_definitions/external_resources/external_resources_settings.py,sha256=WBkJqnoyYCe1Vimwbp_Pa0RdyTdmWNf6oEWyA749QzA,3589
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
@@ -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.dev104.dist-info/METADATA,sha256=9v7ZHcP0L3QPNkpFKt5otqVTbrmy-UdvbWu2r3hFwzM,24566
790
- qontract_reconcile-0.10.2.dev104.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
- qontract_reconcile-0.10.2.dev104.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
- qontract_reconcile-0.10.2.dev104.dist-info/RECORD,,
789
+ qontract_reconcile-0.10.2.dev106.dist-info/METADATA,sha256=3p7qkhmRv3Ygggl73B74hFVQvPufuOTlfoiDQVNnDWU,24566
790
+ qontract_reconcile-0.10.2.dev106.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
+ qontract_reconcile-0.10.2.dev106.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
+ qontract_reconcile-0.10.2.dev106.dist-info/RECORD,,
@@ -166,6 +166,12 @@ class AWSRdsFactory(AWSDefaultResourceFactory):
166
166
  if "old_parameter_group" in data:
167
167
  old_pg_data = rvr._get_values(data["old_parameter_group"])
168
168
  data["old_parameter_group"] = old_pg_data
169
+ if (
170
+ (blue_green_deployment := data.get("blue_green_deployment"))
171
+ and (target := blue_green_deployment.get("target"))
172
+ and (parameter_group := target.get("parameter_group"))
173
+ ):
174
+ target["parameter_group"] = rvr._get_values(parameter_group)
169
175
  if "replica_source" in data:
170
176
  sourcedb_spec = self._get_source_db_spec(
171
177
  spec.provisioner_name, data["replica_source"]
@@ -66,11 +66,11 @@ class FleetLabelerIntegration(QontractReconcileIntegration[NoParams]):
66
66
  secret_reader=self.secret_reader,
67
67
  dry_run=dry_run,
68
68
  )
69
- self._metrics = dependencies.metrics
70
69
  self.reconcile(dependencies=dependencies)
71
70
 
72
71
  def reconcile(self, dependencies: Dependencies) -> None:
73
72
  validate_label_specs(specs=dependencies.label_specs_by_name)
73
+ all_cluster_ids: set[str] = set()
74
74
  for spec_name, ocm in dependencies.ocm_clients_by_label_spec_name.items():
75
75
  spec = dependencies.label_specs_by_name[spec_name]
76
76
  discovered_clusters = self._discover_desired_clusters(
@@ -99,6 +99,16 @@ class FleetLabelerIntegration(QontractReconcileIntegration[NoParams]):
99
99
  ocm=ocm,
100
100
  dry_run=synch_labels,
101
101
  )
102
+ num_labels = 0
103
+ for cluster in spec.clusters:
104
+ all_cluster_ids.add(cluster.cluster_id)
105
+ num_labels += len(cluster.subscription_labels)
106
+ dependencies.metrics.set_managed_labels_gauge(
107
+ ocm_name=spec.ocm_env.name,
108
+ spec_name=spec_name,
109
+ value=num_labels,
110
+ )
111
+ dependencies.metrics.set_managed_clusters_gauge(value=len(all_cluster_ids))
102
112
 
103
113
  def _discover_desired_clusters(
104
114
  self, spec: FleetLabelsSpecV1, ocm: OCMClient
@@ -36,14 +36,34 @@ class FleetLabelerMetrics:
36
36
  value,
37
37
  )
38
38
 
39
+ def set_managed_labels_gauge(
40
+ self, ocm_name: str, spec_name: str, value: int
41
+ ) -> None:
42
+ metrics.set_gauge(
43
+ FleetLabelerManagedLabelsGauge(
44
+ ocm_name=ocm_name,
45
+ spec=spec_name,
46
+ ),
47
+ value,
48
+ )
49
+
50
+ def set_managed_clusters_gauge(self, value: int) -> None:
51
+ metrics.set_gauge(
52
+ FleetLabelerManagedClustersGauge(),
53
+ value,
54
+ )
55
+
39
56
 
40
57
  class FleetLabelerBaseMetric(BaseModel):
41
58
  integration: str = QONTRACT_INTEGRATION
59
+
60
+
61
+ class FleetLabelerSpecBaseMetric(FleetLabelerBaseMetric):
42
62
  ocm_name: str
43
63
  spec: str
44
64
 
45
65
 
46
- class FleetLabelerDuplicateClusterMatchesGauge(FleetLabelerBaseMetric, GaugeMetric):
66
+ class FleetLabelerDuplicateClusterMatchesGauge(FleetLabelerSpecBaseMetric, GaugeMetric):
47
67
  """
48
68
  Gauge for the number of clusters that have duplicate matches. Clusters with
49
69
  duplicate matches are being ignored by fleet labeler, as it cannot clearly
@@ -56,7 +76,7 @@ class FleetLabelerDuplicateClusterMatchesGauge(FleetLabelerBaseMetric, GaugeMetr
56
76
  return "fleet_labeler_duplicate_cluster_matches"
57
77
 
58
78
 
59
- class FleetLabelerLabelRenderingErrorGauge(FleetLabelerBaseMetric, GaugeMetric):
79
+ class FleetLabelerLabelRenderingErrorGauge(FleetLabelerSpecBaseMetric, GaugeMetric):
60
80
  """
61
81
  Gauge for the number of clusters that have label render errors. This
62
82
  happens when the fleet labeler is unable to render the subscription labels
@@ -66,3 +86,28 @@ class FleetLabelerLabelRenderingErrorGauge(FleetLabelerBaseMetric, GaugeMetric):
66
86
  @classmethod
67
87
  def name(cls) -> str:
68
88
  return "fleet_labeler_label_rendering_error"
89
+
90
+
91
+ class FleetLabelerManagedLabelsGauge(FleetLabelerSpecBaseMetric, GaugeMetric):
92
+ """
93
+ Gauge for the current number of labels under management.
94
+ Note, that label<->cluster combination must be unique across all
95
+ specs, hence we can give the spec as a label here.
96
+ """
97
+
98
+ @classmethod
99
+ def name(cls) -> str:
100
+ return "fleet_labeler_managed_labels"
101
+
102
+
103
+ class FleetLabelerManagedClustersGauge(FleetLabelerBaseMetric, GaugeMetric):
104
+ """
105
+ Gauge for the current number of clusters under management.
106
+ Note, that a cluster can be part of multiple spec inventories.
107
+ This metric only cares about the total number of unique clusters,
108
+ thus the spec is not a label here.
109
+ """
110
+
111
+ @classmethod
112
+ def name(cls) -> str:
113
+ return "fleet_labeler_managed_clusters"
@@ -114,6 +114,20 @@ query ExternalResourcesNamespaces {
114
114
  availability_zone
115
115
  parameter_group
116
116
  old_parameter_group
117
+ blue_green_deployment {
118
+ enabled
119
+ switchover
120
+ delete
121
+ target {
122
+ allocated_storage
123
+ engine_version
124
+ instance_class
125
+ iops
126
+ parameter_group
127
+ storage_throughput
128
+ storage_type
129
+ }
130
+ }
117
131
  overrides
118
132
  output_resource_name
119
133
  enhanced_monitoring
@@ -571,6 +585,23 @@ class NamespaceTerraformResourceAWSV1(ConfiguredBaseModel):
571
585
  provider: str = Field(..., alias="provider")
572
586
 
573
587
 
588
+ class RDSBlueGreenDeploymentTargetV1(ConfiguredBaseModel):
589
+ allocated_storage: Optional[int] = Field(..., alias="allocated_storage")
590
+ engine_version: Optional[str] = Field(..., alias="engine_version")
591
+ instance_class: Optional[str] = Field(..., alias="instance_class")
592
+ iops: Optional[int] = Field(..., alias="iops")
593
+ parameter_group: Optional[str] = Field(..., alias="parameter_group")
594
+ storage_throughput: Optional[str] = Field(..., alias="storage_throughput")
595
+ storage_type: Optional[str] = Field(..., alias="storage_type")
596
+
597
+
598
+ class RDSBlueGreenDeploymentV1(ConfiguredBaseModel):
599
+ enabled: Optional[bool] = Field(..., alias="enabled")
600
+ switchover: Optional[bool] = Field(..., alias="switchover")
601
+ delete: Optional[bool] = Field(..., alias="delete")
602
+ target: Optional[RDSBlueGreenDeploymentTargetV1] = Field(..., alias="target")
603
+
604
+
574
605
  class AWSRDSEventNotificationV1(ConfiguredBaseModel):
575
606
  destination: str = Field(..., alias="destination")
576
607
  source_type: Optional[str] = Field(..., alias="source_type")
@@ -588,6 +619,7 @@ class NamespaceTerraformResourceRDSV1(NamespaceTerraformResourceAWSV1):
588
619
  availability_zone: Optional[str] = Field(..., alias="availability_zone")
589
620
  parameter_group: Optional[str] = Field(..., alias="parameter_group")
590
621
  old_parameter_group: Optional[str] = Field(..., alias="old_parameter_group")
622
+ blue_green_deployment: Optional[RDSBlueGreenDeploymentV1] = Field(..., alias="blue_green_deployment")
591
623
  overrides: Optional[str] = Field(..., alias="overrides")
592
624
  output_resource_name: Optional[str] = Field(..., alias="output_resource_name")
593
625
  enhanced_monitoring: Optional[bool] = Field(..., alias="enhanced_monitoring")
@@ -43531,6 +43531,18 @@
43531
43531
  "isDeprecated": false,
43532
43532
  "deprecationReason": null
43533
43533
  },
43534
+ {
43535
+ "name": "blue_green_deployment",
43536
+ "description": null,
43537
+ "args": [],
43538
+ "type": {
43539
+ "kind": "OBJECT",
43540
+ "name": "RDSBlueGreenDeployment_v1",
43541
+ "ofType": null
43542
+ },
43543
+ "isDeprecated": false,
43544
+ "deprecationReason": null
43545
+ },
43534
43546
  {
43535
43547
  "name": "overrides",
43536
43548
  "description": null,
@@ -43751,6 +43763,160 @@
43751
43763
  "enumValues": null,
43752
43764
  "possibleTypes": null
43753
43765
  },
43766
+ {
43767
+ "kind": "OBJECT",
43768
+ "name": "RDSBlueGreenDeployment_v1",
43769
+ "description": null,
43770
+ "fields": [
43771
+ {
43772
+ "name": "enabled",
43773
+ "description": null,
43774
+ "args": [],
43775
+ "type": {
43776
+ "kind": "SCALAR",
43777
+ "name": "Boolean",
43778
+ "ofType": null
43779
+ },
43780
+ "isDeprecated": false,
43781
+ "deprecationReason": null
43782
+ },
43783
+ {
43784
+ "name": "switchover",
43785
+ "description": null,
43786
+ "args": [],
43787
+ "type": {
43788
+ "kind": "SCALAR",
43789
+ "name": "Boolean",
43790
+ "ofType": null
43791
+ },
43792
+ "isDeprecated": false,
43793
+ "deprecationReason": null
43794
+ },
43795
+ {
43796
+ "name": "delete",
43797
+ "description": null,
43798
+ "args": [],
43799
+ "type": {
43800
+ "kind": "SCALAR",
43801
+ "name": "Boolean",
43802
+ "ofType": null
43803
+ },
43804
+ "isDeprecated": false,
43805
+ "deprecationReason": null
43806
+ },
43807
+ {
43808
+ "name": "target",
43809
+ "description": null,
43810
+ "args": [],
43811
+ "type": {
43812
+ "kind": "OBJECT",
43813
+ "name": "RDSBlueGreenDeploymentTarget_v1",
43814
+ "ofType": null
43815
+ },
43816
+ "isDeprecated": false,
43817
+ "deprecationReason": null
43818
+ }
43819
+ ],
43820
+ "inputFields": null,
43821
+ "interfaces": [],
43822
+ "enumValues": null,
43823
+ "possibleTypes": null
43824
+ },
43825
+ {
43826
+ "kind": "OBJECT",
43827
+ "name": "RDSBlueGreenDeploymentTarget_v1",
43828
+ "description": null,
43829
+ "fields": [
43830
+ {
43831
+ "name": "parameter_group",
43832
+ "description": null,
43833
+ "args": [],
43834
+ "type": {
43835
+ "kind": "SCALAR",
43836
+ "name": "String",
43837
+ "ofType": null
43838
+ },
43839
+ "isDeprecated": false,
43840
+ "deprecationReason": null
43841
+ },
43842
+ {
43843
+ "name": "engine_version",
43844
+ "description": null,
43845
+ "args": [],
43846
+ "type": {
43847
+ "kind": "SCALAR",
43848
+ "name": "String",
43849
+ "ofType": null
43850
+ },
43851
+ "isDeprecated": false,
43852
+ "deprecationReason": null
43853
+ },
43854
+ {
43855
+ "name": "instance_class",
43856
+ "description": null,
43857
+ "args": [],
43858
+ "type": {
43859
+ "kind": "SCALAR",
43860
+ "name": "String",
43861
+ "ofType": null
43862
+ },
43863
+ "isDeprecated": false,
43864
+ "deprecationReason": null
43865
+ },
43866
+ {
43867
+ "name": "allocated_storage",
43868
+ "description": null,
43869
+ "args": [],
43870
+ "type": {
43871
+ "kind": "SCALAR",
43872
+ "name": "Int",
43873
+ "ofType": null
43874
+ },
43875
+ "isDeprecated": false,
43876
+ "deprecationReason": null
43877
+ },
43878
+ {
43879
+ "name": "storage_type",
43880
+ "description": null,
43881
+ "args": [],
43882
+ "type": {
43883
+ "kind": "SCALAR",
43884
+ "name": "String",
43885
+ "ofType": null
43886
+ },
43887
+ "isDeprecated": false,
43888
+ "deprecationReason": null
43889
+ },
43890
+ {
43891
+ "name": "iops",
43892
+ "description": null,
43893
+ "args": [],
43894
+ "type": {
43895
+ "kind": "SCALAR",
43896
+ "name": "Int",
43897
+ "ofType": null
43898
+ },
43899
+ "isDeprecated": false,
43900
+ "deprecationReason": null
43901
+ },
43902
+ {
43903
+ "name": "storage_throughput",
43904
+ "description": null,
43905
+ "args": [],
43906
+ "type": {
43907
+ "kind": "SCALAR",
43908
+ "name": "String",
43909
+ "ofType": null
43910
+ },
43911
+ "isDeprecated": false,
43912
+ "deprecationReason": null
43913
+ }
43914
+ ],
43915
+ "inputFields": null,
43916
+ "interfaces": [],
43917
+ "enumValues": null,
43918
+ "possibleTypes": null
43919
+ },
43754
43920
  {
43755
43921
  "kind": "OBJECT",
43756
43922
  "name": "NamespaceTerraformResourceS3_v1",