v1

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdmissionRequestBlank = (&AdmissionRequestDie{}).DieFeed(admissionv1.AdmissionRequest{})
View Source
var AdmissionResponseBlank = (&AdmissionResponseDie{}).DieFeed(admissionv1.AdmissionResponse{})
View Source
var AdmissionReviewBlank = (&AdmissionReviewDie{}).DieFeed(admissionv1.AdmissionReview{})

Functions

This section is empty.

Types

type AdmissionRequestDie

type AdmissionRequestDie struct {
	// contains filtered or unexported fields
}

func (*AdmissionRequestDie) DeepCopy

DeepCopy returns a new die with equivalent state. Useful for snapshotting a mutable die.

func (*AdmissionRequestDie) DieFeed

DieFeed returns a new die with the provided resource.

func (*AdmissionRequestDie) DieFeedJSON added in v0.8.0

func (d *AdmissionRequestDie) DieFeedJSON(j []byte) *AdmissionRequestDie

DieFeedJSON returns a new die with the provided JSON. Panics on error.

func (*AdmissionRequestDie) DieFeedPtr

DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead.

func (*AdmissionRequestDie) DieFeedRawExtension

func (d *AdmissionRequestDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionRequestDie

DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*AdmissionRequestDie) DieFeedYAML added in v0.8.0

func (d *AdmissionRequestDie) DieFeedYAML(y []byte) *AdmissionRequestDie

DieFeedYAML returns a new die with the provided YAML. Panics on error.

func (*AdmissionRequestDie) DieFeedYAMLFile added in v0.8.0

func (d *AdmissionRequestDie) DieFeedYAMLFile(name string) *AdmissionRequestDie

DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error.

func (*AdmissionRequestDie) DieImmutable

func (d *AdmissionRequestDie) DieImmutable(immutable bool) *AdmissionRequestDie

DieImmutable returns a new die for the current die's state that is either mutable (`false`) or immutable (`true`).

func (*AdmissionRequestDie) DieRelease

DieRelease returns the resource managed by the die.

func (*AdmissionRequestDie) DieReleaseJSON added in v0.8.0

func (d *AdmissionRequestDie) DieReleaseJSON() []byte

DieReleaseJSON returns the resource managed by the die as JSON. Panics on error.

func (*AdmissionRequestDie) DieReleasePtr

func (d *AdmissionRequestDie) DieReleasePtr() *admissionv1.AdmissionRequest

DieReleasePtr returns a pointer to the resource managed by the die.

func (*AdmissionRequestDie) DieReleaseRawExtension

func (d *AdmissionRequestDie) DieReleaseRawExtension() runtime.RawExtension

DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*AdmissionRequestDie) DieReleaseYAML added in v0.8.0

func (d *AdmissionRequestDie) DieReleaseYAML() []byte

DieReleaseYAML returns the resource managed by the die as YAML. Panics on error.

func (*AdmissionRequestDie) DieStamp

DieStamp returns a new die with the resource passed to the callback function. The resource is mutable.

func (*AdmissionRequestDie) DieStampAt added in v0.8.0

func (d *AdmissionRequestDie) DieStampAt(jp string, fn interface{}) *AdmissionRequestDie

Experimental: DieStampAt uses a JSON path (http://goessner.net/articles/JsonPath/) expression to stamp portions of the resource. The callback is invoked with each JSON path match. Panics if the callback function does not accept a single argument of the same type or a pointer to that type as found on the resource at the target location.

Future iterations will improve type coercion from the resource to the callback argument.

func (*AdmissionRequestDie) DieWith added in v0.9.0

func (d *AdmissionRequestDie) DieWith(fns ...func(d *AdmissionRequestDie)) *AdmissionRequestDie

DieWith returns a new die after passing the current die to the callback function. The passed die is mutable.

func (*AdmissionRequestDie) DryRun

DryRun indicates that modifications will definitely not be persisted for this request.

Defaults to false.

func (*AdmissionRequestDie) Kind

Kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale)

func (*AdmissionRequestDie) KindDie

func (*AdmissionRequestDie) Name

Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and

rely on the server to generate the name. If that is the case, this field will contain an empty string.

func (*AdmissionRequestDie) Namespace

Namespace is the namespace associated with the request (if any).

func (*AdmissionRequestDie) Object

Object is the object from the incoming request.

func (*AdmissionRequestDie) OldObject

OldObject is the existing object. Only populated for DELETE and UPDATE requests.

func (*AdmissionRequestDie) Operation

Operation is the operation being performed. This may be different than the operation

requested. e.g. a patch can result in either a CREATE or UPDATE Operation.

func (*AdmissionRequestDie) Options

Options is the operation option structure of the operation being performed.

e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be

different than the options the caller provided. e.g. for a patch request the performed

Operation might be a CREATE, in which case the Options will a

`meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.

func (*AdmissionRequestDie) RequestKind

RequestKind is the fully-qualified type of the original API request (for example, v1.Pod or autoscaling.v1.Scale).

If this is specified and differs from the value in "kind", an equivalent match and conversion was performed.

For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of

`apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,

an API request to apps/v1beta1 deployments would be converted and sent to the webhook

with `kind: {group:"apps", version:"v1", kind:"Deployment"}` (matching the rule the webhook registered for),

and `requestKind: {group:"apps", version:"v1beta1", kind:"Deployment"}` (indicating the kind of the original API request).

See documentation for the "matchPolicy" field in the webhook configuration type for more details.

func (*AdmissionRequestDie) RequestKindDie

func (d *AdmissionRequestDie) RequestKindDie(fn func(d *diemetav1.GroupVersionKindDie)) *AdmissionRequestDie

func (*AdmissionRequestDie) RequestResource

RequestResource is the fully-qualified resource of the original API request (for example, v1.pods).

If this is specified and differs from the value in "resource", an equivalent match and conversion was performed.

For example, if deployments can be modified via apps/v1 and apps/v1beta1, and a webhook registered a rule of

`apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]` and `matchPolicy: Equivalent`,

an API request to apps/v1beta1 deployments would be converted and sent to the webhook

with `resource: {group:"apps", version:"v1", resource:"deployments"}` (matching the resource the webhook registered for),

and `requestResource: {group:"apps", version:"v1beta1", resource:"deployments"}` (indicating the resource of the original API request).

See documentation for the "matchPolicy" field in the webhook configuration type.

func (*AdmissionRequestDie) RequestResourceDie

func (d *AdmissionRequestDie) RequestResourceDie(fn func(d *diemetav1.GroupVersionResourceDie)) *AdmissionRequestDie

func (*AdmissionRequestDie) RequestSubResource

func (d *AdmissionRequestDie) RequestSubResource(v string) *AdmissionRequestDie

RequestSubResource is the name of the subresource of the original API request, if any (for example, "status" or "scale")

If this is specified and differs from the value in "subResource", an equivalent match and conversion was performed.

See documentation for the "matchPolicy" field in the webhook configuration type.

func (*AdmissionRequestDie) Resource

Resource is the fully-qualified resource being requested (for example, v1.pods)

func (*AdmissionRequestDie) ResourceDie

func (*AdmissionRequestDie) SubResource

func (d *AdmissionRequestDie) SubResource(v string) *AdmissionRequestDie

SubResource is the subresource being requested, if any (for example, "status" or "scale")

func (*AdmissionRequestDie) UID

UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are

otherwise identical (parallel requests, requests when earlier requests did not modify etc)

The UID is meant to track the round trip (request/response) between the KAS and the WebHook, not the user request.

It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.

func (*AdmissionRequestDie) UserInfo

UserInfo is information about the requesting user

func (*AdmissionRequestDie) UserInfoDie

type AdmissionResponseDie

type AdmissionResponseDie struct {
	// contains filtered or unexported fields
}

func (*AdmissionResponseDie) AddAuditAnnotation

func (d *AdmissionResponseDie) AddAuditAnnotation(key, value string) *AdmissionResponseDie

func (*AdmissionResponseDie) Allowed

Allowed indicates whether or not the admission request was permitted.

func (*AdmissionResponseDie) AuditAnnotations

func (d *AdmissionResponseDie) AuditAnnotations(v map[string]string) *AdmissionResponseDie

AuditAnnotations is an unstructured key value map set by remote admission controller (e.g. error=image-blacklisted).

MutatingAdmissionWebhook and ValidatingAdmissionWebhook admission controller will prefix the keys with

admission webhook name (e.g. imagepolicy.example.com/error=image-blacklisted). AuditAnnotations will be provided by

the admission webhook to add additional context to the audit log for this request.

func (*AdmissionResponseDie) DeepCopy

DeepCopy returns a new die with equivalent state. Useful for snapshotting a mutable die.

func (*AdmissionResponseDie) DieFeed

DieFeed returns a new die with the provided resource.

func (*AdmissionResponseDie) DieFeedJSON added in v0.8.0

func (d *AdmissionResponseDie) DieFeedJSON(j []byte) *AdmissionResponseDie

DieFeedJSON returns a new die with the provided JSON. Panics on error.

func (*AdmissionResponseDie) DieFeedPtr

DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead.

func (*AdmissionResponseDie) DieFeedRawExtension

func (d *AdmissionResponseDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionResponseDie

DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*AdmissionResponseDie) DieFeedYAML added in v0.8.0

func (d *AdmissionResponseDie) DieFeedYAML(y []byte) *AdmissionResponseDie

DieFeedYAML returns a new die with the provided YAML. Panics on error.

func (*AdmissionResponseDie) DieFeedYAMLFile added in v0.8.0

func (d *AdmissionResponseDie) DieFeedYAMLFile(name string) *AdmissionResponseDie

DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error.

func (*AdmissionResponseDie) DieImmutable

func (d *AdmissionResponseDie) DieImmutable(immutable bool) *AdmissionResponseDie

DieImmutable returns a new die for the current die's state that is either mutable (`false`) or immutable (`true`).

func (*AdmissionResponseDie) DieRelease

DieRelease returns the resource managed by the die.

func (*AdmissionResponseDie) DieReleaseJSON added in v0.8.0

func (d *AdmissionResponseDie) DieReleaseJSON() []byte

DieReleaseJSON returns the resource managed by the die as JSON. Panics on error.

func (*AdmissionResponseDie) DieReleasePtr

DieReleasePtr returns a pointer to the resource managed by the die.

func (*AdmissionResponseDie) DieReleaseRawExtension

func (d *AdmissionResponseDie) DieReleaseRawExtension() runtime.RawExtension

DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*AdmissionResponseDie) DieReleaseYAML added in v0.8.0

func (d *AdmissionResponseDie) DieReleaseYAML() []byte

DieReleaseYAML returns the resource managed by the die as YAML. Panics on error.

func (*AdmissionResponseDie) DieStamp

DieStamp returns a new die with the resource passed to the callback function. The resource is mutable.

func (*AdmissionResponseDie) DieStampAt added in v0.8.0

func (d *AdmissionResponseDie) DieStampAt(jp string, fn interface{}) *AdmissionResponseDie

Experimental: DieStampAt uses a JSON path (http://goessner.net/articles/JsonPath/) expression to stamp portions of the resource. The callback is invoked with each JSON path match. Panics if the callback function does not accept a single argument of the same type or a pointer to that type as found on the resource at the target location.

Future iterations will improve type coercion from the resource to the callback argument.

func (*AdmissionResponseDie) DieWith added in v0.9.0

func (d *AdmissionResponseDie) DieWith(fns ...func(d *AdmissionResponseDie)) *AdmissionResponseDie

DieWith returns a new die after passing the current die to the callback function. The passed die is mutable.

func (*AdmissionResponseDie) Patch

The patch body. Currently we only support "JSONPatch" which implements RFC 6902.

func (*AdmissionResponseDie) PatchType

The type of Patch. Currently we only allow "JSONPatch".

func (*AdmissionResponseDie) Result

Result contains extra details into why an admission request was denied.

This field IS NOT consulted in any way if "Allowed" is "true".

func (*AdmissionResponseDie) ResultDie

func (d *AdmissionResponseDie) ResultDie(fn func(d *diemetav1.StatusDie)) *AdmissionResponseDie

func (*AdmissionResponseDie) UID

UID is an identifier for the individual request/response.

This must be copied over from the corresponding AdmissionRequest.

func (*AdmissionResponseDie) Warnings

warnings is a list of warning messages to return to the requesting API client.

Warning messages describe a problem the client making the API request should correct or be aware of.

Limit warnings to 120 characters if possible.

Warnings over 256 characters and large numbers of warnings may be truncated.

type AdmissionReviewDie

type AdmissionReviewDie struct {
	// contains filtered or unexported fields
}

func (*AdmissionReviewDie) DeepCopy

func (d *AdmissionReviewDie) DeepCopy() *AdmissionReviewDie

DeepCopy returns a new die with equivalent state. Useful for snapshotting a mutable die.

func (*AdmissionReviewDie) DieFeed

DieFeed returns a new die with the provided resource.

func (*AdmissionReviewDie) DieFeedJSON added in v0.8.0

func (d *AdmissionReviewDie) DieFeedJSON(j []byte) *AdmissionReviewDie

DieFeedJSON returns a new die with the provided JSON. Panics on error.

func (*AdmissionReviewDie) DieFeedPtr

DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead.

func (*AdmissionReviewDie) DieFeedRawExtension

func (d *AdmissionReviewDie) DieFeedRawExtension(raw runtime.RawExtension) *AdmissionReviewDie

DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*AdmissionReviewDie) DieFeedYAML added in v0.8.0

func (d *AdmissionReviewDie) DieFeedYAML(y []byte) *AdmissionReviewDie

DieFeedYAML returns a new die with the provided YAML. Panics on error.

func (*AdmissionReviewDie) DieFeedYAMLFile added in v0.8.0

func (d *AdmissionReviewDie) DieFeedYAMLFile(name string) *AdmissionReviewDie

DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error.

func (*AdmissionReviewDie) DieImmutable

func (d *AdmissionReviewDie) DieImmutable(immutable bool) *AdmissionReviewDie

DieImmutable returns a new die for the current die's state that is either mutable (`false`) or immutable (`true`).

func (*AdmissionReviewDie) DieRelease

DieRelease returns the resource managed by the die.

func (*AdmissionReviewDie) DieReleaseJSON added in v0.8.0

func (d *AdmissionReviewDie) DieReleaseJSON() []byte

DieReleaseJSON returns the resource managed by the die as JSON. Panics on error.

func (*AdmissionReviewDie) DieReleasePtr

func (d *AdmissionReviewDie) DieReleasePtr() *admissionv1.AdmissionReview

DieReleasePtr returns a pointer to the resource managed by the die.

func (*AdmissionReviewDie) DieReleaseRawExtension

func (d *AdmissionReviewDie) DieReleaseRawExtension() runtime.RawExtension

DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*AdmissionReviewDie) DieReleaseYAML added in v0.8.0

func (d *AdmissionReviewDie) DieReleaseYAML() []byte

DieReleaseYAML returns the resource managed by the die as YAML. Panics on error.

func (*AdmissionReviewDie) DieStamp

DieStamp returns a new die with the resource passed to the callback function. The resource is mutable.

func (*AdmissionReviewDie) DieStampAt added in v0.8.0

func (d *AdmissionReviewDie) DieStampAt(jp string, fn interface{}) *AdmissionReviewDie

Experimental: DieStampAt uses a JSON path (http://goessner.net/articles/JsonPath/) expression to stamp portions of the resource. The callback is invoked with each JSON path match. Panics if the callback function does not accept a single argument of the same type or a pointer to that type as found on the resource at the target location.

Future iterations will improve type coercion from the resource to the callback argument.

func (*AdmissionReviewDie) DieWith added in v0.9.0

func (d *AdmissionReviewDie) DieWith(fns ...func(d *AdmissionReviewDie)) *AdmissionReviewDie

DieWith returns a new die after passing the current die to the callback function. The passed die is mutable.

func (*AdmissionReviewDie) Request

Request describes the attributes for the admission request.

func (*AdmissionReviewDie) RequestDie

func (d *AdmissionReviewDie) RequestDie(fn func(d *AdmissionRequestDie)) *AdmissionReviewDie

func (*AdmissionReviewDie) Response

Response describes the attributes for the admission response.

func (*AdmissionReviewDie) ResponseDie

func (d *AdmissionReviewDie) ResponseDie(fn func(d *AdmissionResponseDie)) *AdmissionReviewDie

func (*AdmissionReviewDie) TypeMeta

Jump to

Keyboard shortcuts

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