func (v *Namespace) Handle(ctx context.Context, req admission.Request) admission.Response {
	log := v.Log.WithValues("NamespaceName", req.Name)
	// Early exit since the HNC SA can do whatever it wants.
	if isHNCServiceAccount(&req.AdmissionRequest.UserInfo) {
		log.V(1).Info("Allowed change by HNC SA")
		return allow("HNC SA")
	}

	decoded, err := v.decodeRequest(log, req)
	if err != nil {
		log.Error(err, "Couldn't decode request")
		return deny(metav1.StatusReasonBadRequest, err.Error())
	}

	resp := v.handle(decoded)
	log.V(1).Info("Handled", "allowed", resp.Allowed, "code", resp.Result.Code, "reason", resp.Result.Reason, "message", resp.Result.Message)
	return resp
}
// Handle implements the validation webhook.
Handle implements the validation webhook.
// Handle implements the validation webhook .
func (v *Namespace) Handle(ctx context.Context, req admission.Request) admission.Response {
	log := v.Log.WithValues("NamespaceName", req.Name)
	if isHNCServiceAccount(&req.AdmissionRequest.UserInfo) {
		log.V(1).Info("Allowed change by HNC SA")
		return allow("HNC SA")
	}
	decoded, err := v.decodeRequest(log, req)
	if err != nil {
		log.Error(err, "Couldn't decode request")
		return deny(metav1.StatusReasonBadRequest, err.Error())
	}
	resp := v.handle(decoded)
	log.V(1).Info("Handled", "allowed", resp.Allowed, "code", resp.Result.Code, "reason", resp.Result.Reason, "message", resp.Result.Message)
	return resp
}
func ( v * Namespace ) Handle ( ctx context . Context , req admission . Request ) admission . Response { log := v . Log . WithValues ( " " , req . Name ) if isHNCServiceAccount ( & req . AdmissionRequest . UserInfo ) { log . V ( 1 ) . Info ( " " ) return allow ( " " ) } decoded , err := v . decodeRequest ( log , req ) if err != nil { log . Error ( err , " " ) return deny ( metav1 . StatusReasonBadRequest , err . Error ( ) ) } resp := v . handle ( decoded ) log . V ( 1 ) . Info ( " " , " " , resp . Allowed , " " , resp . Result . Code , " " , resp . Result . Reason , " " , resp . Result . Message ) return resp }
Handle implements the validation webhook.
Handle implements the validation webhook .
// Early exit since the HNC SA can do whatever it wants.