SAP-archive / karydia

Kubernetes Security Walnut
Other
77 stars 10 forks source link

Fixed internal error when pod has no annotation #95

Closed Neumann-Nils closed 5 years ago

Neumann-Nils commented 5 years ago

Description

If the pod doesn't have any annotations, karydia's attempt to patch the resource fails with

Error from server (InternalError): Internal error occurred: Internal error occurred: jsonpatch add operation does not apply: doc is missing path: "/metadata/annotations/seccomp.security.alpha.kubernetes.io~1pod"

This was due to pkg/admission/karydiasecuritypolicy/pod.go (master) and is fixed in pkg/admission/karydiasecuritypolicy/pod.go.

This PR fixes #83.

Checklist

Before submitting this PR, please make sure: