func (a *AdmissionResponder) HasErrors() bool {
	return len(a.errors) != 0
}
HasErrors returns a true if there are errors false if not
package webhook
import (
	"fmt"
	"net/http"
	"strings"
	"github.com/golang/glog"
	v1 "k8s.io/api/admission/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type AdmissionResponder struct {
	allowed bool
	errors  []string
	patches []byte
}
func (a *AdmissionResponder) Flush() *v1.AdmissionResponse {
	if a.allowed && !a.HasErrors() {
		res := &v1.AdmissionResponse{
			Allowed: true,
		}
		if a.patches != nil {
			res.Patch = a.patches
			pt := v1.PatchTypeJSONPatch
			res.PatchType = &pt
		}
		return res
	}
	return &v1.AdmissionResponse{
		Allowed: false,
		Result: &metav1.Status{
			Message: fmt.Sprintf("\n%s", strings.Join(a.errors, "\n")),
		},
	}
}