Documentation ¶
Index ¶
- Constants
- Variables
- type BackendOperationRequest
- type BackendOperationResponse
- type CreateLoadBalancerRequest
- type CreateLoadBalancerResponse
- type DeleteLoadBalancerRequest
- type DeleteLoadBalancerResponse
- type EnsureLoadBalancerRequest
- type EnsureLoadBalancerResponse
- type GenerateBackendAddrRequest
- type GenerateBackendAddrResponse
- type JudgePodDeregisterRequest
- type JudgePodDeregisterResponse
- type OperationType
- type PodBackendInGenerateAddrRequest
- type RequestForRetryHooks
- type ResponseForFailRetryHooks
- type ResponseForNoRetryHooks
- type ServiceBackendInGenerateAddrRequest
- type ValidateBackendRequest
- type ValidateBackendResponse
- type ValidateLoadBalancerRequest
- type ValidateLoadBalancerResponse
Constants ¶
const ( // ValidateLoadBalancer is the name and URL path of webhook validateLoadBalancer ValidateLoadBalancer = "validateLoadBalancer" // CreateLoadBalancer is the name and URL path of webhook createLoadBalancer CreateLoadBalancer = "createLoadBalancer" // EnsureLoadBalancer is the name and URL path of webhook ensureLoadBalancer EnsureLoadBalancer = "ensureLoadBalancer" // DeleteLoadBalancer is the name and URL path of webhook deleteLoadBalancer DeleteLoadBalancer = "deleteLoadBalancer" // ValidateBackend is the name and URL path of webhook validateBackend ValidateBackend = "validateBackend" // GenerateBackendAddr is the name and URL path of webhook generateBackendAddr GenerateBackendAddr = "generateBackendAddr" // EnsureBackend is the name and URL path of webhook ensureBackend EnsureBackend = "ensureBackend" // DeregBackend is the name and URL path of webhook deregisterBackend DeregBackend = "deregisterBackend" // JudgePodDeregister is the name and URL path of webhook judgePodDeregister JudgePodDeregister = "judgePodDeregister" )
const ( // StatusSucc indicates webhook succeeded StatusSucc = "Succ" // StatusFail indicates webhook failed StatusFail = "Fail" // StatusRunning indicates webhook is still running StatusRunning = "Running" )
Variables ¶
var KnownWebhooks = sets.NewString( ValidateLoadBalancer, CreateLoadBalancer, EnsureLoadBalancer, DeleteLoadBalancer, ValidateBackend, GenerateBackendAddr, EnsureBackend, DeregBackend, )
KnownWebhooks is a set contains all supported webhooks
Functions ¶
This section is empty.
Types ¶
type BackendOperationRequest ¶
type BackendOperationRequest struct { RequestForRetryHooks DryRun bool `json:"dryRun"` LBInfo map[string]string `json:"lbInfo"` BackendAddr string `json:"backendAddr"` Parameters map[string]string `json:"parameters"` InjectedInfo map[string]string `json:"injectedInfo"` }
BackendOperationRequest is the request for webhook ensureBackend and deregisterBackend
type BackendOperationResponse ¶
type BackendOperationResponse struct { ResponseForFailRetryHooks InjectedInfo map[string]string `json:"injectedInfo"` }
BackendOperationResponse is the response for webhook ensureBackend and deregisterBackend
type CreateLoadBalancerRequest ¶
type CreateLoadBalancerRequest struct { RequestForRetryHooks DryRun bool `json:"dryRun"` LBSpec map[string]string `json:"lbSpec"` Attributes map[string]string `json:"attributes"` }
CreateLoadBalancerRequest is the request for webhook createLoadBalancer
type CreateLoadBalancerResponse ¶
type CreateLoadBalancerResponse struct { ResponseForFailRetryHooks LBInfo map[string]string `json:"lbInfo"` }
CreateLoadBalancerResponse is the response for webhook createLoadBalancer
type DeleteLoadBalancerRequest ¶
type DeleteLoadBalancerRequest struct { RequestForRetryHooks DryRun bool `json:"dryRun"` LBInfo map[string]string `json:"lbInfo"` Attributes map[string]string `json:"attributes"` }
DeleteLoadBalancerRequest is the request for webhook deleteLoadBalancer
type DeleteLoadBalancerResponse ¶
type DeleteLoadBalancerResponse struct {
ResponseForFailRetryHooks
}
DeleteLoadBalancerResponse is the response for webhook deleteLoadBalancer
type EnsureLoadBalancerRequest ¶
type EnsureLoadBalancerRequest struct { RequestForRetryHooks DryRun bool `json:"dryRun"` LBInfo map[string]string `json:"lbInfo"` Attributes map[string]string `json:"attributes"` }
EnsureLoadBalancerRequest is the request for webhook ensureLoadBalancer
type EnsureLoadBalancerResponse ¶
type EnsureLoadBalancerResponse struct {
ResponseForFailRetryHooks
}
EnsureLoadBalancerResponse is the response for webhook ensureLoadBalancer
type GenerateBackendAddrRequest ¶
type GenerateBackendAddrRequest struct { RequestForRetryHooks DryRun bool `json:"dryRun"` LBInfo map[string]string `json:"lbInfo"` LBAttributes map[string]string `json:"lbAttributes"` Parameters map[string]string `json:"parameters"` PodBackend *PodBackendInGenerateAddrRequest `json:"podBackend"` ServiceBackend *ServiceBackendInGenerateAddrRequest `json:"serviceBackend"` }
GenerateBackendAddrRequest is the request for webhook generateBackendAddr
type GenerateBackendAddrResponse ¶
type GenerateBackendAddrResponse struct { ResponseForFailRetryHooks BackendAddr string `json:"backendAddr"` }
GenerateBackendAddrResponse is the response for webhook generateBackendAddr
type JudgePodDeregisterRequest ¶ added in v1.3.0
type JudgePodDeregisterRequest struct { DryRun bool `json:"dryRun"` NotReadyPods []*v1.Pod `json:"notReadyPods"` }
JudgePodDeregisterRequest is the request for webhook judgePodDeregister
type JudgePodDeregisterResponse ¶ added in v1.3.0
type JudgePodDeregisterResponse struct { ResponseForNoRetryHooks DoNotDeregister []*v1.Pod `json:"doNotDeregister"` }
JudgePodDeregisterResponse is the response for for webhook judgePodDeregister
type OperationType ¶
type OperationType string
OperationType is used to distinguish why a webhook is called
const ( // OperationCreate indicates the webhook is called for an object is created in K8S OperationCreate OperationType = "Create" // OperationUpdate indicates the webhook is called for an object is updated in K8S OperationUpdate OperationType = "Update" )
type PodBackendInGenerateAddrRequest ¶
type PodBackendInGenerateAddrRequest struct { Pod v1.Pod `json:"pod"` Port v1beta1.PortSelector `json:"port"` }
PodBackendInGenerateAddrRequest is part of GenerateBackendAddrRequest
type RequestForRetryHooks ¶
type RequestForRetryHooks struct { RecordID string `json:"recordID"` RetryID string `json:"retryID"` }
RequestForRetryHooks is the common request for webhooks that can be retried, including:
createLoadBalancer, ensureLoadBalancer, deleteLoadBalancer, generateBackendAddr, ensureBackend, deregisterBackend
type ResponseForFailRetryHooks ¶
type ResponseForFailRetryHooks struct { Status string `json:"status"` Msg string `json:"msg"` MinRetryDelayInSeconds int32 `json:"minRetryDelayInSeconds"` }
ResponseForFailRetryHooks is the common response for webhooks that can be retried, including:
createLoadBalancer, ensureLoadBalancer, deleteLoadBalancer, generateBackendAddr, ensureBackend, deregisterBackend
type ResponseForNoRetryHooks ¶
ResponseForNoRetryHooks is the common response for webhooks that can NOT be retried, including:
validateLoadBalancer, validateBackend
type ServiceBackendInGenerateAddrRequest ¶
type ServiceBackendInGenerateAddrRequest struct { Service v1.Service `json:"service"` Port v1beta1.PortSelector `json:"port"` NodeName string `json:"nodeName"` NodeAddresses []v1.NodeAddress `json:"nodeAddresses"` }
ServiceBackendInGenerateAddrRequest is part of GenerateBackendAddrRequest
type ValidateBackendRequest ¶
type ValidateBackendRequest struct { DryRun bool `json:"dryRun"` BackendType string `json:"backendType"` LBInfo map[string]string `json:"lbInfo"` Operation OperationType `json:"operation"` Parameters map[string]string `json:"parameters"` OldParameters map[string]string `json:"OldParameters,omitempty"` }
ValidateBackendRequest is the request for webhook validateBackend
type ValidateBackendResponse ¶
type ValidateBackendResponse struct {
ResponseForNoRetryHooks
}
ValidateBackendResponse is the response for webhook validateBackend
type ValidateLoadBalancerRequest ¶
type ValidateLoadBalancerRequest struct { DryRun bool `json:"dryRun"` LBSpec map[string]string `json:"lbSpec"` Operation OperationType `json:"operation"` Attributes map[string]string `json:"attributes"` OldAttributes map[string]string `json:"oldAttributes,omitempty"` }
ValidateLoadBalancerRequest is the request for webhook validateLoadBalancer
type ValidateLoadBalancerResponse ¶
type ValidateLoadBalancerResponse struct {
ResponseForNoRetryHooks
}
ValidateLoadBalancerResponse is the response for webhook validateLoadBalancer