webhooks

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2020 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	// StatusSucc indicates webhook succeeded
	StatusSucc = "Succ"

	// StatusFail indicates webhook failed
	StatusFail = "Fail"

	// StatusRunning indicates webhook is still running
	StatusRunning = "Running"
)

Variables

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

type ResponseForNoRetryHooks struct {
	Succ bool   `json:"succ"`
	Msg  string `json:"msg"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL