Documentation

Overview

    Package admission provides libraries for creating admission webhooks.

    Example
    Output:
    
    

    Index

    Examples

    Constants

    This section is empty.

    Variables

    View Source
    var DefaultAdmissionFns = &Manager{
    	SMux: http.DefaultServeMux,
    }

      DefaultAdmissionFns is the default admission control functions registry

      Functions

      func AllowResponse

      func AllowResponse() *v1beta1.AdmissionResponse

        AllowResponse returns a new response for admitting a request

        Example
        Output:
        
        

        func Decode

          Decode reads the Raw data from review and deserializes it into object returning a non-nil response if there was an error

          Example
          Output:
          
          

          func DenyResponse

          func DenyResponse(msg string) *v1beta1.AdmissionResponse

            DenyResponse returns a new response for denying a request

            Example
            Output:
            
            

            func ErrorResponse

            func ErrorResponse(err error) *v1beta1.AdmissionResponse

              ErrorResponse creates a new AdmissionResponse for an error handling the request

              Example
              Output:
              
              

              func HandleFunc

              func HandleFunc(path string, gvr metav1.GroupVersionResource, fn Func)

                HandleFunc registers fn as an admission control webhook callback for the group,version,resources specified

                Example
                Output:
                
                

                func ListenAndServeTLS

                func ListenAndServeTLS(addr string) error

                  ListenAndServeTLS starts the admission HttpServer.

                  Types

                  type Func

                    Func implements an AdmissionReview operation for a GroupVersionResource

                    Example
                    Output:
                    
                    

                    type Manager

                    type Manager struct {
                    	Entries map[string]admissionHandler
                    	SMux    *http.ServeMux
                    }

                      Manager manages admission controllers

                      func (*Manager) HandleFunc

                      func (e *Manager) HandleFunc(path string, gvr metav1.GroupVersionResource, fn Func)

                        HandleFunc registers fn as an admission control webhook callback for the group,version,resources specified

                        Example
                        Output: