Have generated the webhook code using operator-sdk, but could not able to get the user information

Viewed 20

the K8S api server will send a AdmissionReview “request” and expects a AdmissionReview “response”, as part of the request, we get the user info

// unmarshal request into AdmissionReview struct admReview := v1beta1.AdmissionReview{} if err := json.Unmarshal(body, &admReview); err != nil { return nil, fmt.Errorf("unmarshaling request failed with%s",err) } admReview.Request.UserInfo.Username

with operator-sdk, we are receiving the resource directly but no visibility on who created the resource.

0 Answers
Related