@kubenode/controller-runtime v0.4.2
@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.
| Param | Type | Description |
|---|---|---|
| name | string | Resource name. |
| namespace | string | Resource 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.
| Param | Type | Description |
|---|---|---|
| options | AdmissionRequestOptions | Options used to construct instance. |
AdmissionResponse
Kind: global class
new AdmissionResponse(options)
Creates a new AdmissionResponse instance.
| Param | Type | Description |
|---|---|---|
| options | AdmissionResponseOptions | Options 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
| Param | Type | Description |
|---|---|---|
| req | AdmissionRequest | The request corresponding to this response. |
AdmissionReview
Kind: global class
new AdmissionReview(options)
Creates a new AdmissionReview instance.
| Param | Type | Description |
|---|---|---|
| options | AdmissionReviewOptions | Options used to construct instance. |
Server
Kind: global class
- Server
- new Server([options])
- .inject(settings) ⇒ Promise
- .register(path, hook)
- .start(ctx) ⇒ Promise
new Server(options)
Creates a new Server instance.
| Param | Type | Description |
|---|---|---|
| options | ServerOptions | Options used to construct instance. |
server.inject(settings) ⇒ Promise
inject() creates a simulated request in the server.
Kind: instance method of Server
| Param | Type | Description |
|---|---|---|
| settings | Object | Simulated request configuration. |
server.register(path, hook)
register() marks the given webhook as being served at the given path.
Kind: instance method of Server
| Param | Type | Description |
|---|---|---|
| path | string | The path to serve the webhook from. |
| hook | function | The webhook to serve. |
server.start(ctx) ⇒ Promise
start() runs the server.
Kind: instance method of Server
| Param | Type | Description |
|---|---|---|
| ctx | Object | The 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.
| Param | Type |
|---|---|
| err | Error |
isAlreadyExists(err) ⇒ boolean
isAlreadyExists() determines if the err is an error which indicates that a specified resource already exists.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
isBadRequest(err) ⇒ boolean
isBadRequest() determines if err is an error which indicates that the request is invalid.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
isConflict(err) ⇒ boolean
isConflict() determines if the err is an error which indicates the provided update conflicts.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
isGone(err) ⇒ boolean
isGone() is true if the error indicates the requested resource is no longer available.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
isInternalError(err) ⇒ boolean
isInternalError() determines if err is an error which indicates an internal server error.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
isInvalid(err) ⇒ boolean
isInvalid() determines if the err is an error which indicates the provided resource is not valid.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
isNotFound(err) ⇒ boolean
isNotFound() determines if an err indicating that a resource could not be found.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
isRequestEntityTooLargeError(err) ⇒ boolean
isRequestEntityTooLargeError() determines if err is an error which indicates the request entity is too large.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
isServiceUnavailable(err) ⇒ boolean
isServiceUnavailable() is true if the error indicates the underlying service is no longer available.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
isTimeout(err) ⇒ boolean
isTimeout() determines if err is an error which indicates that request times out due to long processing.
Kind: global function
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
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
| Param | Type |
|---|---|
| err | Error |
allowed(message) ⇒ AdmissionResponse
allowed() constructs a response indicating that the given operation is allowed.
Kind: global function
| Param | Type | Description |
|---|---|---|
| message | string | additional message to attach to the response. |
denied(message) ⇒ AdmissionResponse
denied() constructs a response indicating that the given operation is denied.
Kind: global function
| Param | Type | Description |
|---|---|---|
| message | string | additional message to attach to the response. |
errored(code, err) ⇒ AdmissionResponse
errored() creates a new response for error-handling a request.
Kind: global function
| Param | Type | Description |
|---|---|---|
| code | number | error code to return. |
| err | Error | an error whose message is included in the response. |
validationResponse(allowed, message) ⇒ AdmissionResponse
validationResponse() returns a response for admitting a request.
Kind: global function
| Param | Type | Description |
|---|---|---|
| allowed | boolean | allowed indicates whether or not the admission request was permitted. |
| message | string | additional message to attach to the response. |
withResolvers() ⇒ PromiseWithResolvers
withResolvers() works like Promise.withResolvers().
Kind: global function
AdmissionRequestOptions : Object
Kind: global typedef Properties
| Name | Type | Description |
|---|---|---|
| uid | string | uid is an identifier for the individual request/response. |
| kind | Object | kind is the fully-qualified type of object being submitted. |
| resource | Object | resource is the fully-qualified resource being requested. |
| subResource | string | subResource is the subresource being requested, if any. |
| requestKind | Object | requestKind is the fully-qualified type of the original API request |
| requestResource | Object | requestResource is the fully-qualified resource of the original API request. |
| requestSubResource | string | requestSubResource is the name of the subresource of the original API request, if any. |
| name | string | name is the name of the object as presented in the request. |
| namespace | string | namespace is the namespace associated with the request, if any. |
| operation | string | operation is the operation being performed. |
| userInfo | Object | userInfo is information about the requesting user. |
| object | Object | object is the object from the incoming request. |
| oldObject | Object | oldObject is the existing object. Only populated for DELETE and UPDATE requests. |
| dryRun | Object | dryRun indicates that modifications will definitely not be persisted for this request. |
| options | Object | options is the operation option structure of the operation being performed. |
AdmissionResponseOptions : Object
Kind: global typedef Properties
| Name | Type | Description |
|---|---|---|
| uid | string | uid is an identifier for the individual request/response. |
| allowed | boolean | allowed indicates whether or not the admission request was permitted. |
| status | Object | status contains extra details into why an admission request was denied. |
| patch | Object | The patch body. |
| patches | Array.<Object> | patches are the JSON patches for mutating webhooks. |
| auditAnnotations | Object | auditAnnotations is an unstructured key value map set by remote admission controller |
| warnings | Array.<string> | warnings is a list of warning messages to return to the requesting API client. |
AdmissionReviewOptions : Object
Kind: global typedef Properties
| Name | Type | Description |
|---|---|---|
| request | Object | Object used to create an AdmissionRequest. |
| response | Object | Object used to create an AdmissionResponse. |
ServerOptions : Object
Kind: global typedef Properties
| Name | Type | Description |
|---|---|---|
| certDir | string | The directory that contains the server key and certificate. |
| certName | string | The server certificate name. Defaults to tls.crt. |
| insecure | boolean | If true, the server uses HTTP instead of HTTPS. |
| keyName | string | The server key name. Defaults to tls.key. |
| port | number | The port number that the server will bind to. |