sovereign 0.31.0__py3-none-any.whl → 0.32.0__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.
Potentially problematic release.
This version of sovereign might be problematic. Click here for more details.
- sovereign/views/discovery.py +13 -5
- {sovereign-0.31.0.dist-info → sovereign-0.32.0.dist-info}/METADATA +1 -1
- {sovereign-0.31.0.dist-info → sovereign-0.32.0.dist-info}/RECORD +6 -6
- {sovereign-0.31.0.dist-info → sovereign-0.32.0.dist-info}/LICENSE.txt +0 -0
- {sovereign-0.31.0.dist-info → sovereign-0.32.0.dist-info}/WHEEL +0 -0
- {sovereign-0.31.0.dist-info → sovereign-0.32.0.dist-info}/entry_points.txt +0 -0
sovereign/views/discovery.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from typing import Dict
|
|
2
3
|
|
|
3
4
|
from fastapi import Body, Header
|
|
@@ -117,8 +118,6 @@ async def perform_discovery(
|
|
|
117
118
|
authenticate(req)
|
|
118
119
|
if discovery_cache.enabled:
|
|
119
120
|
logs.access_logger.queue_log_fields(CACHE_XDS_HIT=False)
|
|
120
|
-
metadata_keys = discovery_cache.extra_keys.get("metadata", [])
|
|
121
|
-
extra_metadata = [req.node.metadata.get(key, None) for key in metadata_keys]
|
|
122
121
|
hash_keys = [
|
|
123
122
|
api_version,
|
|
124
123
|
resource_type,
|
|
@@ -130,11 +129,20 @@ async def perform_discovery(
|
|
|
130
129
|
req.node.cluster,
|
|
131
130
|
req.node.locality,
|
|
132
131
|
# TODO: this is very bad and everyone should feel bad. Remove this in the next breaking release
|
|
133
|
-
req.node.metadata.get("auth"
|
|
134
|
-
req.node.metadata.get("num_cpus"
|
|
132
|
+
req.node.metadata.get("auth"),
|
|
133
|
+
req.node.metadata.get("num_cpus"),
|
|
135
134
|
]
|
|
135
|
+
|
|
136
|
+
metadata_keys = discovery_cache.extra_keys.get("metadata", [])
|
|
137
|
+
extra_metadata = [req.node.metadata.get(key) for key in metadata_keys]
|
|
136
138
|
hash_keys += extra_metadata
|
|
137
|
-
|
|
139
|
+
|
|
140
|
+
env_keys = discovery_cache.extra_keys.get("env_vars", [])
|
|
141
|
+
env_var_values = [os.getenv(key) for key in env_keys]
|
|
142
|
+
hash_keys += env_var_values
|
|
143
|
+
|
|
144
|
+
cache_key = compute_hash(*hash_keys)
|
|
145
|
+
|
|
138
146
|
if template := await cache.get(key=cache_key, default=None):
|
|
139
147
|
logs.access_logger.queue_log_fields(CACHE_XDS_HIT=True)
|
|
140
148
|
return template # type: ignore[no-any-return]
|
|
@@ -55,11 +55,11 @@ sovereign/utils/weighted_clusters.py,sha256=bPzuRE7Qgvv04HcR2AhMDvBrFlZ8AfteweLK
|
|
|
55
55
|
sovereign/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
56
|
sovereign/views/admin.py,sha256=LQhz5CPFfEa8PjAp-SSQ_zce1sq-B95x4cG0BC_j-_s,4807
|
|
57
57
|
sovereign/views/crypto.py,sha256=7y0eHWtt-bbr2CwHEkH7odPaJ1IEviU-71U-MYJD0Kc,3360
|
|
58
|
-
sovereign/views/discovery.py,sha256=
|
|
58
|
+
sovereign/views/discovery.py,sha256=S8Mp3TfcEyfyFfr234xmXSUxH5x27OdBZ5NzrOsiIu0,6348
|
|
59
59
|
sovereign/views/healthchecks.py,sha256=8BA11nigm1btnBOdtXGN1B04Ow2uswWNNsuKoPLXgh0,1393
|
|
60
60
|
sovereign/views/interface.py,sha256=KoLB3YIZGulrYOV6MA6ucmQzlmSDrYEO8uq045awy1Q,7712
|
|
61
|
-
sovereign-0.
|
|
62
|
-
sovereign-0.
|
|
63
|
-
sovereign-0.
|
|
64
|
-
sovereign-0.
|
|
65
|
-
sovereign-0.
|
|
61
|
+
sovereign-0.32.0.dist-info/LICENSE.txt,sha256=2X125zvAb9AYLjCgdMDQZuufhm0kwcg31A8pGKj_-VY,560
|
|
62
|
+
sovereign-0.32.0.dist-info/METADATA,sha256=efYUaL5x25dJS2K7wC_US0L9fei1kdo0TZfKc8K5vWo,6194
|
|
63
|
+
sovereign-0.32.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
64
|
+
sovereign-0.32.0.dist-info/entry_points.txt,sha256=CTCjlomxNz2Ii4hYbN-gEZPBrZNUCcmJcb7NYqm4Nn8,1328
|
|
65
|
+
sovereign-0.32.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|