prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Duplicate checks CKV_K8S_29 and CKV_K8S_30 ?
  It seem that both checks are the same, at least in the description :
  
  ```
  Check: CKV_K8S_29: "Apply security context to your pods and containers"
  	FAILED for resource: module.some_module.kubernetes_deployment.app
  	File: /base/main.tf:12-355
  	Calling File: /some_module.tf:1-116
  
  Check: CKV_K8S_30: "Apply security context to your pods and containers"
  	FAILED for resource: module.some_module.kubernetes_deployment.app
  	File: /base/main.tf:12-355
  	Calling File: /some_module.tf:1-116
  ```
  
  </issue>
  <code>
  [start of checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py]
  1 from typing import Any, Dict
  2 
  3 from checkov.common.models.enums import CheckResult
  4 from checkov.kubernetes.checks.resource.base_container_check import BaseK8sContainerCheck
  5 
  6 
  7 class ContainerSecurityContext(BaseK8sContainerCheck):
  8     def __init__(self) -> None:
  9         # CIS-1.5 5.7.3
  10         name = "Apply security context to your pods and containers"
  11         # Security context can be set at pod or container level.
  12         # Location: container .securityContext
  13         id = "CKV_K8S_30"
  14         super().__init__(name=name, id=id)
  15 
  16     def scan_container_conf(self, metadata: Dict[str, Any], conf: Dict[str, Any]) -> CheckResult:
  17         self.evaluated_container_keys = ["securityContext"]
  18         if conf.get("securityContext"):
  19             return CheckResult.PASSED
  20         return CheckResult.FAILED
  21 
  22 
  23 check = ContainerSecurityContext()
  24
  [end of checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py]
  [start of checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py]
  1 from checkov.common.models.enums import CheckCategories, CheckResult
  2 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
  3 
  4 
  5 class PodSecurityContext(BaseResourceCheck):
  6 
  7     def __init__(self):
  8         # CIS-1.5 5.7.3
  9         name = "Apply security context to your pods and containers"
  10         # Security context can be set at pod or container level.
  11         id = "CKV_K8S_29"
  12 
  13         supported_resources = ('kubernetes_pod', 'kubernetes_pod_v1',
  14                                'kubernetes_deployment', 'kubernetes_deployment_v1',
  15                                'kubernetes_daemonset', 'kubernetes_daemon_set_v1')
  16         categories = (CheckCategories.GENERAL_SECURITY,)
  17         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
  18 
  19     def scan_resource_conf(self, conf) -> CheckResult:
  20         if "spec" not in conf:
  21             self.evaluated_keys = [""]
  22             return CheckResult.FAILED
  23         spec = conf['spec'][0]
  24         if spec.get("container"):
  25             containers = spec.get("container")
  26 
  27             for idx, container in enumerate(containers):
  28                 if type(container) != dict:
  29                     return CheckResult.UNKNOWN
  30 
  31                 if not container.get("security_context"):
  32                     self.evaluated_keys = [f"spec/[0]/container/{idx}"]
  33                     return CheckResult.FAILED
  34             return CheckResult.PASSED
  35 
  36         if spec.get("template") and isinstance(spec.get("template"), list):
  37             template = spec.get("template")[0]
  38             if template.get("spec") and isinstance(template.get("spec"), list):
  39                 temp_spec = template.get("spec")[0]
  40                 if temp_spec.get("container"):
  41                     containers = temp_spec.get("container")
  42 
  43                     for idx, container in enumerate(containers):
  44                         if type(container) != dict:
  45                             return CheckResult.UNKNOWN
  46 
  47                         if not container.get("security_context"):
  48                             self.evaluated_keys = [f"spec/[0]/template/[0]/spec/[0]/container/{idx}"]
  49                             return CheckResult.FAILED
  50                     return CheckResult.PASSED
  51         return CheckResult.FAILED
  52 
  53 
  54 check = PodSecurityContext()
  55
  [end of checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py b/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py
  --- a/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py
  +++ b/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py
  @@ -7,7 +7,7 @@
   class ContainerSecurityContext(BaseK8sContainerCheck):
       def __init__(self) -> None:
           # CIS-1.5 5.7.3
  -        name = "Apply security context to your pods and containers"
  +        name = "Apply security context to your containers"
           # Security context can be set at pod or container level.
           # Location: container .securityContext
           id = "CKV_K8S_30"
  diff --git a/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py b/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py
  --- a/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py
  +++ b/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py
  @@ -6,7 +6,7 @@
   
       def __init__(self):
           # CIS-1.5 5.7.3
  -        name = "Apply security context to your pods and containers"
  +        name = "Apply security context to your pods, deployments and daemon_sets"
           # Security context can be set at pod or container level.
           id = "CKV_K8S_29"
  
verification_info: {"golden_diff": "diff --git a/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py b/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py\n--- a/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py\n+++ b/checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py\n@@ -7,7 +7,7 @@\n class ContainerSecurityContext(BaseK8sContainerCheck):\n     def __init__(self) -> None:\n         # CIS-1.5 5.7.3\n-        name = \"Apply security context to your pods and containers\"\n+        name = \"Apply security context to your containers\"\n         # Security context can be set at pod or container level.\n         # Location: container .securityContext\n         id = \"CKV_K8S_30\"\ndiff --git a/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py b/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py\n--- a/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py\n+++ b/checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py\n@@ -6,7 +6,7 @@\n \n     def __init__(self):\n         # CIS-1.5 5.7.3\n-        name = \"Apply security context to your pods and containers\"\n+        name = \"Apply security context to your pods, deployments and daemon_sets\"\n         # Security context can be set at pod or container level.\n         id = \"CKV_K8S_29\"\n", "issue": "Duplicate checks CKV_K8S_29 and CKV_K8S_30 ?\nIt seem that both checks are the same, at least in the description :\r\n\r\n```\r\nCheck: CKV_K8S_29: \"Apply security context to your pods and containers\"\r\n\tFAILED for resource: module.some_module.kubernetes_deployment.app\r\n\tFile: /base/main.tf:12-355\r\n\tCalling File: /some_module.tf:1-116\r\n\r\nCheck: CKV_K8S_30: \"Apply security context to your pods and containers\"\r\n\tFAILED for resource: module.some_module.kubernetes_deployment.app\r\n\tFile: /base/main.tf:12-355\r\n\tCalling File: /some_module.tf:1-116\r\n```\n", "before_files": [{"content": "from typing import Any, Dict\n\nfrom checkov.common.models.enums import CheckResult\nfrom checkov.kubernetes.checks.resource.base_container_check import BaseK8sContainerCheck\n\n\nclass ContainerSecurityContext(BaseK8sContainerCheck):\n    def __init__(self) -> None:\n        # CIS-1.5 5.7.3\n        name = \"Apply security context to your pods and containers\"\n        # Security context can be set at pod or container level.\n        # Location: container .securityContext\n        id = \"CKV_K8S_30\"\n        super().__init__(name=name, id=id)\n\n    def scan_container_conf(self, metadata: Dict[str, Any], conf: Dict[str, Any]) -> CheckResult:\n        self.evaluated_container_keys = [\"securityContext\"]\n        if conf.get(\"securityContext\"):\n            return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = ContainerSecurityContext()\n", "path": "checkov/kubernetes/checks/resource/k8s/ContainerSecurityContext.py"}, {"content": "from checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\n\n\nclass PodSecurityContext(BaseResourceCheck):\n\n    def __init__(self):\n        # CIS-1.5 5.7.3\n        name = \"Apply security context to your pods and containers\"\n        # Security context can be set at pod or container level.\n        id = \"CKV_K8S_29\"\n\n        supported_resources = ('kubernetes_pod', 'kubernetes_pod_v1',\n                               'kubernetes_deployment', 'kubernetes_deployment_v1',\n                               'kubernetes_daemonset', 'kubernetes_daemon_set_v1')\n        categories = (CheckCategories.GENERAL_SECURITY,)\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf) -> CheckResult:\n        if \"spec\" not in conf:\n            self.evaluated_keys = [\"\"]\n            return CheckResult.FAILED\n        spec = conf['spec'][0]\n        if spec.get(\"container\"):\n            containers = spec.get(\"container\")\n\n            for idx, container in enumerate(containers):\n                if type(container) != dict:\n                    return CheckResult.UNKNOWN\n\n                if not container.get(\"security_context\"):\n                    self.evaluated_keys = [f\"spec/[0]/container/{idx}\"]\n                    return CheckResult.FAILED\n            return CheckResult.PASSED\n\n        if spec.get(\"template\") and isinstance(spec.get(\"template\"), list):\n            template = spec.get(\"template\")[0]\n            if template.get(\"spec\") and isinstance(template.get(\"spec\"), list):\n                temp_spec = template.get(\"spec\")[0]\n                if temp_spec.get(\"container\"):\n                    containers = temp_spec.get(\"container\")\n\n                    for idx, container in enumerate(containers):\n                        if type(container) != dict:\n                            return CheckResult.UNKNOWN\n\n                        if not container.get(\"security_context\"):\n                            self.evaluated_keys = [f\"spec/[0]/template/[0]/spec/[0]/container/{idx}\"]\n                            return CheckResult.FAILED\n                    return CheckResult.PASSED\n        return CheckResult.FAILED\n\n\ncheck = PodSecurityContext()\n", "path": "checkov/terraform/checks/resource/kubernetes/PodSecurityContext.py"}]}