Kubewarden SDK Documentation

Structures

Policy​Log​Handler

This struct implements a custom logging backend (aka LogHandler) for the Swift-log library.

Settings​Validator

Helper structure that performs settings validation

Settings​Validation​Response

This structure defines the response to provide when validating settings.

Validation​Request

Describes the ValidationRequest object given to the policy inside of the validate guest function.

Validation​Response

This structure defines the response to provide when validating an admission request.

Enumerations

Settings​Validation​Error

Errors raised when policy's settings validation fails

Protocols

Validatable

Protocol that must be implemented by Kubewarden policies in order to be used by SettingsValidator

Functions

protocol​Version​Callback(payload:​)

This function provides the implementation of the protocol_version waPC guest function.

accept​Settings()

This function accepts the Settings as valid

reject​Settings(message:​)

This function rejects the Settings as invalid

make_validate_payload(request:​settings:​)

Helper function to be used while writing unit tests

accept​Request()

This function accepts the admission request as valid

mutate​Request(mutated​Object:​)

This function accepts the admission request as valid

reject​Request(message:​code:​)

This function rejects the admission request as invalid