Documentation ¶
Overview ¶
Package v1 contains API Schema definitions for the forward v1 API group +k8s:deepcopy-gen=package,register +groupName=forward.webhookrelay.com
Package v1 contains API Schema definitions for the forward v1 API group +k8s:deepcopy-gen=package,register +groupName=forward.webhookrelay.com
Index ¶
Constants ¶
const ( AccessTokenKeyName = "key" AccessTokenSecretName = "secret" )
Map keys used in secret
Variables ¶
var ( // SchemeGroupVersion is group version used to register these objects SchemeGroupVersion = schema.GroupVersion{Group: "forward.webhookrelay.com", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} )
Functions ¶
This section is empty.
Types ¶
type AgentStatus ¶
type AgentStatus string
AgentStatus is the phase of the Webhook Relay forwarder node at a given point in time.
const ( AgentStatusInitial AgentStatus = "" AgentStatusRunning AgentStatus = "Running" AgentStatusCreating AgentStatus = "Creating" AgentStatusTerminating AgentStatus = "Terminating" // TODO: needs finalizer )
Constants for operator defaults values and different phases.
type BucketSpec ¶
type BucketSpec struct { // Name is the name of a bucket that can be reused // (if it already exists) or that will be created by the operator. Buckets // act as a grouping mechanism for Inputs and Outputs Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` // Inputs are your public endpoints. Inputs can either be https://my.webhookrelay.com/v1/webhooks/[unique ID] // format or custom subdomains under https://[subdomain].hooks.webhookrelay.com or // completely custom domains such as https://hooks.example.com. // Important! Note that if you specify inputs, operator will automatically synchronize inputs of the specified // bucket with the provided CR spec. Inputs []InputSpec `json:"inputs,omitempty"` // Outputs are destinations where webhooks/API requests should be forwarded. Outputs []OutputSpec `json:"outputs,omitempty"` }
BucketSpec defines a bucket that groups one or more inputs (public endpoints) and one ore more outputs (where the webhooks should be routed)
func (*BucketSpec) DeepCopy ¶
func (in *BucketSpec) DeepCopy() *BucketSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketSpec.
func (*BucketSpec) DeepCopyInto ¶
func (in *BucketSpec) DeepCopyInto(out *BucketSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InputSpec ¶
type InputSpec struct { Name string `json:"name,omitempty"` // FunctionID attaches function to this input. Functions on inputs can modify // responses to the caller and modify requests that are then passed to each // output. FunctionID string `json:"functionId,omitempty"` // Static response configuration ResponseHeaders map[string][]string `json:"responseHeaders,omitempty"` ResponseStatusCode int `json:"responseStatusCode,omitempty"` ResponseBody string `json:"responseBody,omitempty"` // Dynamic response configuration // either output name, ID or "anyOutput" to indicate that the first response // from any output is good enough. Defaults to empty string ResponseFromOutput string `json:"responseFromOutput,omitempty"` // CustomDomain can be used to assign a permanent domain name for your input // such as example.hooks.webhookrelay.com CustomDomain *string `json:"customDomain,omitempty"` // PathPrefix can be combined together with CustomDomain to create 'API like' // functionality where calls from: // petshop.com/dogs -> are forwarded to [dogs store] // petshop.com/cats -> are forwarded to [cats store] PathPrefix string `json:"pathPrefix,omitempty"` // Description can be any string Description string `json:"description,omitempty"` }
InputSpec defines an input that belong to a bucket
func (*InputSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InputSpec.
func (*InputSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OutputSpec ¶
type OutputSpec struct { Name string `json:"name,omitempty"` // FunctionID attaches function to this output. Functions on output can modify // requests that are then passed to destinations. FunctionID string `json:"function_id,omitempty"` // OverrideHeaders OverrideHeaders map[string]string `json:"overrideHeaders,omitempty"` // Destination is a URL that specifies where to send the webhooks. For example it can be // http://local-jenkins/ghpr for Jenkins webhooks or any other URL. Destination string `json:"destination"` // Internal specifies whether webhook should be sent to an internal destination. Since // operator is working with internal agents, this option defaults to True Internal *bool `json:"internal,omitempty"` // LockPath ensures that the request path cannot be changed from what is // specified in the destination. For example if request is coming to /v1/webhooks/xxx/github-jenkins, // with lock path 'false' and destination 'http://localhost:8080' it would go to http://localhost:8080/github-jenkins. // However, with lock path 'true', it will be sent to 'http://localhost:8080' LockPath *bool `json:"lockPath,omitempty"` // Disabled allows disabling destination without deleting it (when you don't want to send webhooks temporarily) Disabled *bool `json:"disabled,omitempty"` // Timeout specifies how long agent should wait for the response Timeout int `json:"timeout,omitempty"` // Description can be any string Description string `json:"description,omitempty"` }
OutputSpec defines and output that belong to a bucket. Outputs are destinations where webhooks/API requests are forwarded.
func (*OutputSpec) DeepCopy ¶
func (in *OutputSpec) DeepCopy() *OutputSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutputSpec.
func (*OutputSpec) DeepCopyInto ¶
func (in *OutputSpec) DeepCopyInto(out *OutputSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RoutingStatus ¶
type RoutingStatus string
RoutingStatus is configuration status
const ( RoutingStatusConfigured RoutingStatus = "Configured" RoutingStatusFailed RoutingStatus = "Failed" )
Constants for operator routing configuration status
type WebhookRelayForward ¶
type WebhookRelayForward struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec WebhookRelayForwardSpec `json:"spec,omitempty"` Status WebhookRelayForwardStatus `json:"status,omitempty"` }
WebhookRelayForward is the Schema for the webhookrelayforwards API +kubebuilder:subresource:status +kubebuilder:resource:path=webhookrelayforwards,scope=Namespaced
func (*WebhookRelayForward) DeepCopy ¶
func (in *WebhookRelayForward) DeepCopy() *WebhookRelayForward
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookRelayForward.
func (*WebhookRelayForward) DeepCopyInto ¶
func (in *WebhookRelayForward) DeepCopyInto(out *WebhookRelayForward)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*WebhookRelayForward) DeepCopyObject ¶
func (in *WebhookRelayForward) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type WebhookRelayForwardList ¶
type WebhookRelayForwardList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []WebhookRelayForward `json:"items"` }
WebhookRelayForwardList contains a list of WebhookRelayForward
func (*WebhookRelayForwardList) DeepCopy ¶
func (in *WebhookRelayForwardList) DeepCopy() *WebhookRelayForwardList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookRelayForwardList.
func (*WebhookRelayForwardList) DeepCopyInto ¶
func (in *WebhookRelayForwardList) DeepCopyInto(out *WebhookRelayForwardList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*WebhookRelayForwardList) DeepCopyObject ¶
func (in *WebhookRelayForwardList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type WebhookRelayForwardSpec ¶
type WebhookRelayForwardSpec struct { // SecretRefName is the name of the secret object that contains // generated token from https://my.webhookrelay.com/tokens // secret should have two fields: // key - your token key (a long UUID) // secret - token secret, encrypted once generated and cannot be recovered from Webhook Relay. // If secret is lost, just create a new token SecretRefName string `json:"secretRefName,omitempty"` // SecretRefNamespace is the namespace of the secret reference. SecretRefNamespace string `json:"secretRefNamespace,omitempty"` // Image is webhookrelayd container, defaults to webhookrelay/webhookrelayd:latest Image string `json:"image,omitempty"` // Buckets to manage and subscribe to. Each CR can control one or more buckets. Buckets can be inspected // and manually created via Web UI here https://my.webhookrelay.com/buckets Buckets []BucketSpec `json:"buckets"` // Resources is to set the resource requirements of the Webhook Relay agent container`. Resources corev1.ResourceRequirements `json:"resources,omitempty"` // Extra environment variables to pass to the relay agent container ExtraEnvVars []corev1.EnvVar `json:"extraEnvVars,omitempty"` }
WebhookRelayForwardSpec defines the desired state of WebhookRelayForward
func (*WebhookRelayForwardSpec) DeepCopy ¶
func (in *WebhookRelayForwardSpec) DeepCopy() *WebhookRelayForwardSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookRelayForwardSpec.
func (*WebhookRelayForwardSpec) DeepCopyInto ¶
func (in *WebhookRelayForwardSpec) DeepCopyInto(out *WebhookRelayForwardSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WebhookRelayForwardStatus ¶
type WebhookRelayForwardStatus struct { // AgentStatus indicates agent deployment status AgentStatus AgentStatus `json:"agentStatus,omitempty"` // Ready indicates whether agent is deployed Ready bool `json:"ready,omitempty"` RoutingStatus RoutingStatus `json:"routingStatus,omitempty"` Message string `json:"message,omitempty"` // PublicEndpoints are all input public endpoints from the buckets // defined in the spec PublicEndpoints []string `json:"publicEndpoints,omitempty"` }
WebhookRelayForwardStatus defines the observed state of WebhookRelayForward +k8s:openapi-gen=true
func (*WebhookRelayForwardStatus) DeepCopy ¶
func (in *WebhookRelayForwardStatus) DeepCopy() *WebhookRelayForwardStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookRelayForwardStatus.
func (*WebhookRelayForwardStatus) DeepCopyInto ¶
func (in *WebhookRelayForwardStatus) DeepCopyInto(out *WebhookRelayForwardStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.