SAP-archive / karydia

Kubernetes Security Walnut
Other
77 stars 10 forks source link

pkg/admission/karydia: read namespace from admission request #27

Closed schu closed 5 years ago

schu commented 5 years ago

For an incoming admission request, we need to know the target namespace in order to read per-namespace configuration and handle the request accordingly. Since the namespace of the target object isn't always populated from the beginning, read the namespace from the admission request instead.

Note that there can be admission requests where namespace is not set, it's an optional field. In the case of pod admission, we probably can expect it though and error out if not set.