Skip to content

Commit

Permalink
removes data from last-applied-configuration closes #27
Browse files Browse the repository at this point in the history
  • Loading branch information
Skybound1 committed Oct 8, 2024
1 parent c8414be commit 0f308e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions icekube/models/secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ def remove_secret_data(cls, v: Optional[str]) -> Optional[str]:
if "data" in data:
del data["data"]

last_applied_configuration = (
data.get("metadata", {})
.get("annotations", {})
.get("kubectl.kubernetes.io/last-applied-configuration")
)
if last_applied_configuration:
last_applied_configuration = json.loads(last_applied_configuration)
if "data" in last_applied_configuration:
del last_applied_configuration["data"]
data["metadata"]["annotations"][
"kubectl.kubernetes.io/last-applied-configuration"
] = json.dumps(last_applied_configuration)

return json.dumps(data)

return v
Expand Down

0 comments on commit 0f308e1

Please sign in to comment.