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

fix(kubernetes): fixed unexpected list object #3833

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions checkov/kubernetes/checks/resource/k8s/MemoryRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def scan_container_conf(self, metadata: Dict[str, Any], conf: Dict[str, Any]) ->
if not isinstance(res, dict):
return CheckResult.UNKNOWN
requests = res.get("requests")
if not isinstance(requests, dict):
return CheckResult.UNKNOWN
if requests and requests.get("memory"):
return CheckResult.PASSED
return CheckResult.FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Pod
metadata:
name: frontend
spec:
containers:
- name: db
image: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "password"
resources:
requests:
- memory: "64Mi"
cpu: "250m"
ephemeral-storage: "2Gi"
limits:
memory: "128Mi"
cpu: "500m"
ephemeral-storage: "4Gi"