handlers

package
v0.0.0-...-318d958 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//OrchestrationIdentifier identifier string for provider orchestration
	OrchestrationIdentifier = "kubernetes"
	//ProviderName name of the provider
	ProviderName = "faas-netes"
)

Variables

This section is empty.

Functions

func MakeDeleteHandler

func MakeDeleteHandler(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc

MakeDeleteHandler delete a function

func MakeDeployHandler

func MakeDeployHandler(functionNamespace string, factory k8s.FunctionFactory) http.HandlerFunc

MakeDeployHandler creates a handler to create new functions in the cluster

func MakeFunctionReader

func MakeFunctionReader(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc

MakeFunctionReader handler for reading functions deployed in the cluster as deployments.

func MakeHealthHandler

func MakeHealthHandler() http.HandlerFunc

MakeHealthHandler returns 200/OK when healthy

func MakeInfoHandler

func MakeInfoHandler(version, sha string) http.HandlerFunc

MakeInfoHandler creates handler for /system/info endpoint

func MakeNamespacesLister

func MakeNamespacesLister(defaultNamespace string, clientset kubernetes.Interface) http.HandlerFunc

MakeNamespacesLister builds a list of namespaces with an "openfaas" tag, or the default name

func MakeReplicaReader

func MakeReplicaReader(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc

MakeReplicaReader reads the amount of replicas for a deployment

func MakeReplicaUpdater

func MakeReplicaUpdater(defaultNamespace string, clientset *kubernetes.Clientset) http.HandlerFunc

MakeReplicaUpdater updates desired count of replicas

func MakeSecretHandler

func MakeSecretHandler(defaultNamespace string, kube kubernetes.Interface) http.HandlerFunc

MakeSecretHandler makes a handler for Create/List/Delete/Update of secrets in the Kubernetes API

func MakeUpdateHandler

func MakeUpdateHandler(defaultNamespace string, factory k8s.FunctionFactory) http.HandlerFunc

MakeUpdateHandler update specified function

func ProcessErrorReasons

func ProcessErrorReasons(err error) (int, metav1.StatusReason)

ProcessErrorReasons maps k8serrors.ReasonForError to http status codes

func ValidateDeployRequest

func ValidateDeployRequest(request *types.FunctionDeployment) error

ValidateDeployRequest validates that the service name is valid for Kubernetes

Types

type NamespaceResolver

type NamespaceResolver func(r *http.Request) (namespace string, err error)

NamespaceResolver is a method that determines the requested namespace corresponding to an HTTP request. It then validates that OpenFaaS is permitted to operate in that the namespace.

func NewNamespaceResolver

func NewNamespaceResolver(defaultNamespace string, kube kubernetes.Interface) NamespaceResolver

NewNamespaceResolver returns a generic namespace resolver that will inspect both the GET query parameters and the request body. It looks for the query param or json key "namespace".

Jump to

Keyboard shortcuts

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