Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes data from last-applied-configuration closes #27 #29

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading