qontract-reconcile 0.10.2.dev81__py3-none-any.whl → 0.10.2.dev83__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.dev81
3
+ Version: 0.10.2.dev83
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
@@ -204,7 +204,7 @@ reconcile/external_resources/meta.py,sha256=noaytFzmShpzLA_ebGh7wuP45mOfHIOnnoUx
204
204
  reconcile/external_resources/metrics.py,sha256=KiBjMUaN_z0cSkF_7Ar_a8RiuiwVqjyMcVdISlxhzXE,3898
205
205
  reconcile/external_resources/model.py,sha256=dxwiyI3J9xyLeue8_W9NJoap-CkKLMAoY0S0ml5-NbU,13450
206
206
  reconcile/external_resources/reconciler.py,sha256=-0trp1K-iUgOQn3mm1ZUSmfaReRrUT0eHzPkUhNPolQ,9583
207
- reconcile/external_resources/secrets_sync.py,sha256=50fK4fzgSz-K8uy5_DQQWA_ju_rTDYAC2HRymgfY7TA,16344
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
210
  reconcile/fleet_labeler/dependencies.py,sha256=Ta-SLnrHRN4OBAmhE_mTk1P7y1X7AInIiQsIYaY6hY0,2910
@@ -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.dev81.dist-info/METADATA,sha256=UGta8zuDkNLq5r2AZb6rYi8wn7ERsZ-jTHUwAadgF94,24565
790
- qontract_reconcile-0.10.2.dev81.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
- qontract_reconcile-0.10.2.dev81.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
- qontract_reconcile-0.10.2.dev81.dist-info/RECORD,,
789
+ qontract_reconcile-0.10.2.dev83.dist-info/METADATA,sha256=TieK7fz_M-bhsVyJT5I9A8b94qT5VaOCbvz_tmqjDx4,24565
790
+ qontract_reconcile-0.10.2.dev83.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
791
+ qontract_reconcile-0.10.2.dev83.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
792
+ qontract_reconcile-0.10.2.dev83.dist-info/RECORD,,
@@ -104,18 +104,13 @@ class OutputSecretsFormatter:
104
104
  def __init__(self, secret_reader: SecretReaderBase) -> None:
105
105
  self.secret_reader = secret_reader
106
106
 
107
- def _key_must_be_populated(self, key: str) -> bool:
108
- "Only keys containing '__' must be populated to Secrets"
109
- return "__" in key
110
-
111
107
  def _format_key(self, key: str) -> str:
112
- if "__" not in key:
113
- return key
114
- k_split = key.split("__")
115
- output_key = k_split[1]
116
- if output_key.startswith("db"):
117
- output_key = output_key.replace("db_", "db.")
118
- return output_key
108
+ # The "__" separator is a legacy feature of terraform resources
109
+ # This should be removed once all modules don't have outputs with this format.
110
+ if "__" in key:
111
+ _, key = key.split("__", 1)
112
+
113
+ return key.replace("db_", "db.", 1) if key.startswith("db_") else key
119
114
 
120
115
  def _format_value(self, value: str) -> str:
121
116
  decoded_value = base64.b64decode(value).decode("utf-8")
@@ -130,7 +125,6 @@ class OutputSecretsFormatter:
130
125
  return {
131
126
  self._format_key(key): self._format_value(value)
132
127
  for key, value in data.items()
133
- if self._key_must_be_populated(key)
134
128
  }
135
129
 
136
130