Skip to content

Commit

Permalink
Merge pull request #616 from gefyrahq/fix-unbridge
Browse files Browse the repository at this point in the history
fix: storing original pod config
  • Loading branch information
SteinRobert authored May 16, 2024
2 parents 2790587 + 85f8f52 commit 536d3f9
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions operator/gefyra/bridge/carrier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,18 @@ def _store_pod_original_config(self, container: k8s.client.V1Container) -> None:
:param ireq_object: the InterceptRequest object
:return: None
"""
config = {
f"{self.namespace}-{self.pod}": json.dumps(
{
"originalConfig": {
"image": container.image,
"command": container.command,
"args": container.args,
}
data = json.dumps(
{
"originalConfig": {
"image": container.image,
"command": container.command,
"args": container.args,
}
)
}
}
)
config = [
{"op": "add", "path": f"/data/{self.namespace}-{self.pod}", "value": data}
]
try:
core_v1_api.patch_namespaced_config_map(
name=CARRIER_ORIGINAL_CONFIGMAP,
Expand All @@ -257,7 +258,9 @@ def _store_pod_original_config(self, container: k8s.client.V1Container) -> None:
metadata=k8s.client.V1ObjectMeta(
name=CARRIER_ORIGINAL_CONFIGMAP
),
data=config,
data={
f"{self.namespace}-{self.pod}": data,
},
),
)
else:
Expand Down

0 comments on commit 536d3f9

Please sign in to comment.