0.4.2 • Published 7 months ago

@kubenode/controller-runtime v0.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@kubenode/controller-runtime

Utilities for writing Kubernetes controllers in JavaScript.

Classes

Functions

Typedefs

NamespacedName

NamespacedName comprises a resource name and namespace rendered as "namespace/name".

Kind: global class

new NamespacedName(name, namespace)

Construct a NamespacedName.

ParamTypeDescription
namestringResource name.
namespacestringResource namespace.

namespacedName.toString() ⇒ string

Converts a NamespacedName to a string of the form "namespace/name".

Kind: instance method of NamespacedName Returns: string - A string representation of the NamespacedName.

AdmissionRequest

Kind: global class

new AdmissionRequest(options)

Creates a new AdmissionRequest instance.

ParamTypeDescription
optionsAdmissionRequestOptionsOptions used to construct instance.

AdmissionResponse

Kind: global class

new AdmissionResponse(options)

Creates a new AdmissionResponse instance.

ParamTypeDescription
optionsAdmissionResponseOptionsOptions used to construct instance.

admissionResponse.complete(req)

complete() populates any fields that are yet to be set in the underlying response.

Kind: instance method of AdmissionResponse

ParamTypeDescription
reqAdmissionRequestThe request corresponding to this response.

AdmissionReview

Kind: global class

new AdmissionReview(options)

Creates a new AdmissionReview instance.

ParamTypeDescription
optionsAdmissionReviewOptionsOptions used to construct instance.

Server

Kind: global class

new Server(options)

Creates a new Server instance.

ParamTypeDescription
optionsServerOptionsOptions used to construct instance.

server.inject(settings) ⇒ Promise

inject() creates a simulated request in the server.

Kind: instance method of Server

ParamTypeDescription
settingsObjectSimulated request configuration.

server.register(path, hook)

register() marks the given webhook as being served at the given path.

Kind: instance method of Server

ParamTypeDescription
pathstringThe path to serve the webhook from.
hookfunctionThe webhook to serve.

server.start(ctx) ⇒ Promise

start() runs the server.

Kind: instance method of Server

ParamTypeDescription
ctxObjectThe context object.

reasonForError(err) ⇒ string

reasonForError() returns the reason for a particular error.

Kind: global function Returns: string - A StatusReason representing the cause of the error.

ParamType
errError

isAlreadyExists(err) ⇒ boolean

isAlreadyExists() determines if the err is an error which indicates that a specified resource already exists.

Kind: global function

ParamType
errError

isBadRequest(err) ⇒ boolean

isBadRequest() determines if err is an error which indicates that the request is invalid.

Kind: global function

ParamType
errError

isConflict(err) ⇒ boolean

isConflict() determines if the err is an error which indicates the provided update conflicts.

Kind: global function

ParamType
errError

isForbidden(err) ⇒ boolean

isForbidden() determines if err is an error which indicates that the request is forbidden and cannot be completed as requested.

Kind: global function

ParamType
errError

isGone(err) ⇒ boolean

isGone() is true if the error indicates the requested resource is no longer available.

Kind: global function

ParamType
errError

isInternalError(err) ⇒ boolean

isInternalError() determines if err is an error which indicates an internal server error.

Kind: global function

ParamType
errError

isInvalid(err) ⇒ boolean

isInvalid() determines if the err is an error which indicates the provided resource is not valid.

Kind: global function

ParamType
errError

isMethodNotSupported(err) ⇒ boolean

isMethodNotSupported() determines if the err is an error which indicates the provided action could not be performed because it is not supported by the server.

Kind: global function

ParamType
errError

isNotAcceptable(err) ⇒ boolean

isNotAcceptable() determines if err is an error which indicates that the request failed due to an invalid Accept header.

Kind: global function

ParamType
errError

isNotFound(err) ⇒ boolean

isNotFound() determines if an err indicating that a resource could not be found.

Kind: global function

ParamType
errError

isRequestEntityTooLargeError(err) ⇒ boolean

isRequestEntityTooLargeError() determines if err is an error which indicates the request entity is too large.

Kind: global function

ParamType
errError

isResourceExpired(err) ⇒ boolean

isResourceExpired() is true if the error indicates the resource has expired and the current action is no longer possible.

Kind: global function

ParamType
errError

isServerTimeout(err) ⇒ boolean

isServerTimeout() determines if err is an error which indicates that the request needs to be retried by the client.

Kind: global function

ParamType
errError

isServiceUnavailable(err) ⇒ boolean

isServiceUnavailable() is true if the error indicates the underlying service is no longer available.

Kind: global function

ParamType
errError

isTimeout(err) ⇒ boolean

isTimeout() determines if err is an error which indicates that request times out due to long processing.

Kind: global function

ParamType
errError

isTooManyRequests(err) ⇒ boolean

isTooManyRequests() determines if err is an error which indicates that there are too many requests that the server cannot handle.

Kind: global function

ParamType
errError

isUnauthorized(err) ⇒ boolean

isUnauthorized() determines if err is an error which indicates that the request is unauthorized and requires authentication by the user.

Kind: global function

ParamType
errError

isUnsupportedMediaType(err) ⇒ boolean

isUnsupportedMediaType() determines if err is an error which indicates that the request failed due to an invalid Content-Type header.

Kind: global function

ParamType
errError

allowed(message) ⇒ AdmissionResponse

allowed() constructs a response indicating that the given operation is allowed.

Kind: global function

ParamTypeDescription
messagestringadditional message to attach to the response.

denied(message) ⇒ AdmissionResponse

denied() constructs a response indicating that the given operation is denied.

Kind: global function

ParamTypeDescription
messagestringadditional message to attach to the response.

errored(code, err) ⇒ AdmissionResponse

errored() creates a new response for error-handling a request.

Kind: global function

ParamTypeDescription
codenumbererror code to return.
errErroran error whose message is included in the response.

validationResponse(allowed, message) ⇒ AdmissionResponse

validationResponse() returns a response for admitting a request.

Kind: global function

ParamTypeDescription
allowedbooleanallowed indicates whether or not the admission request was permitted.
messagestringadditional message to attach to the response.

withResolvers() ⇒ PromiseWithResolvers

withResolvers() works like Promise.withResolvers().

Kind: global function

AdmissionRequestOptions : Object

Kind: global typedef Properties

NameTypeDescription
uidstringuid is an identifier for the individual request/response.
kindObjectkind is the fully-qualified type of object being submitted.
resourceObjectresource is the fully-qualified resource being requested.
subResourcestringsubResource is the subresource being requested, if any.
requestKindObjectrequestKind is the fully-qualified type of the original API request
requestResourceObjectrequestResource is the fully-qualified resource of the original API request.
requestSubResourcestringrequestSubResource is the name of the subresource of the original API request, if any.
namestringname is the name of the object as presented in the request.
namespacestringnamespace is the namespace associated with the request, if any.
operationstringoperation is the operation being performed.
userInfoObjectuserInfo is information about the requesting user.
objectObjectobject is the object from the incoming request.
oldObjectObjectoldObject is the existing object. Only populated for DELETE and UPDATE requests.
dryRunObjectdryRun indicates that modifications will definitely not be persisted for this request.
optionsObjectoptions is the operation option structure of the operation being performed.

AdmissionResponseOptions : Object

Kind: global typedef Properties

NameTypeDescription
uidstringuid is an identifier for the individual request/response.
allowedbooleanallowed indicates whether or not the admission request was permitted.
statusObjectstatus contains extra details into why an admission request was denied.
patchObjectThe patch body.
patchesArray.<Object>patches are the JSON patches for mutating webhooks.
auditAnnotationsObjectauditAnnotations is an unstructured key value map set by remote admission controller
warningsArray.<string>warnings is a list of warning messages to return to the requesting API client.

AdmissionReviewOptions : Object

Kind: global typedef Properties

NameTypeDescription
requestObjectObject used to create an AdmissionRequest.
responseObjectObject used to create an AdmissionResponse.

ServerOptions : Object

Kind: global typedef Properties

NameTypeDescription
certDirstringThe directory that contains the server key and certificate.
certNamestringThe server certificate name. Defaults to tls.crt.
insecurebooleanIf true, the server uses HTTP instead of HTTPS.
keyNamestringThe server key name. Defaults to tls.key.
portnumberThe port number that the server will bind to.
0.3.0

9 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.4.1

9 months ago

0.1.4

1 year ago

0.4.0

9 months ago

0.4.2

7 months ago

0.1.5

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

1 year ago

0.1.0

1 year ago