v1

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 15 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) DieDiff added in v0.13.0

func (d *AdmissionRequestDie) DieDiff(opts ...cmp.Option) string

DieDiff uses cmp.Diff to compare the current value of the die with the sealed value.

func (*AdmissionRequestDie) DieFeed

DieFeed returns a new die with the provided resource.

func (*AdmissionRequestDie) DieFeedJSON

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

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

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

func (*AdmissionRequestDie) DieFeedYAMLFile

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) DiePatch added in v0.13.0

func (d *AdmissionRequestDie) DiePatch(patchType types.PatchType) ([]byte, error)

DiePatch generates a patch between the current value of the die and the sealed value.

func (*AdmissionRequestDie) DieRelease

DieRelease returns the resource managed by the die.

func (*AdmissionRequestDie) DieReleaseJSON

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

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

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

func (*AdmissionRequestDie) DieSeal added in v0.13.0

DieSeal returns a new die for the current die's state that is sealed for comparison in future diff and patch operations.

func (*AdmissionRequestDie) DieSealFeed added in v0.13.0

DieSealFeed returns a new die for the current die's state that uses a specific resource for comparison in future diff and patch operations.

func (*AdmissionRequestDie) DieSealFeedPtr added in v0.13.0

DieSealFeedPtr returns a new die for the current die's state that uses a specific resource pointer for comparison in future diff and patch operations. If the resource is nil, the empty value is used instead.

func (*AdmissionRequestDie) DieSealRelease added in v0.13.0

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

DieSealRelease returns the sealed resource managed by the die.

func (*AdmissionRequestDie) DieSealReleasePtr added in v0.13.0

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

DieSealReleasePtr returns the sealed resource pointer managed by the die.

func (*AdmissionRequestDie) DieStamp

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

func (*AdmissionRequestDie) DieStampAt

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

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

KindDie mutates Kind as a die.

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

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 *metav1.GroupVersionKindDie)) *AdmissionRequestDie

RequestKindDie mutates RequestKind as a die.

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) 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 *metav1.GroupVersionResourceDie)) *AdmissionRequestDie

RequestResourceDie mutates RequestResource as a die.

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) 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

ResourceDie mutates Resource as a die.

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

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

UserInfoDie mutates UserInfo as a die.

UserInfo is information about the requesting user

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) DieDiff added in v0.13.0

func (d *AdmissionResponseDie) DieDiff(opts ...cmp.Option) string

DieDiff uses cmp.Diff to compare the current value of the die with the sealed value.

func (*AdmissionResponseDie) DieFeed

DieFeed returns a new die with the provided resource.

func (*AdmissionResponseDie) DieFeedJSON

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

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

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

func (*AdmissionResponseDie) DieFeedYAMLFile

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) DiePatch added in v0.13.0

func (d *AdmissionResponseDie) DiePatch(patchType types.PatchType) ([]byte, error)

DiePatch generates a patch between the current value of the die and the sealed value.

func (*AdmissionResponseDie) DieRelease

DieRelease returns the resource managed by the die.

func (*AdmissionResponseDie) DieReleaseJSON

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

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

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

func (*AdmissionResponseDie) DieSeal added in v0.13.0

DieSeal returns a new die for the current die's state that is sealed for comparison in future diff and patch operations.

func (*AdmissionResponseDie) DieSealFeed added in v0.13.0

DieSealFeed returns a new die for the current die's state that uses a specific resource for comparison in future diff and patch operations.

func (*AdmissionResponseDie) DieSealFeedPtr added in v0.13.0

DieSealFeedPtr returns a new die for the current die's state that uses a specific resource pointer for comparison in future diff and patch operations. If the resource is nil, the empty value is used instead.

func (*AdmissionResponseDie) DieSealRelease added in v0.13.0

DieSealRelease returns the sealed resource managed by the die.

func (*AdmissionResponseDie) DieSealReleasePtr added in v0.13.0

func (d *AdmissionResponseDie) DieSealReleasePtr() *admissionv1.AdmissionResponse

DieSealReleasePtr returns the sealed resource pointer managed by the die.

func (*AdmissionResponseDie) DieStamp

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

func (*AdmissionResponseDie) DieStampAt

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

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 *metav1.StatusDie)) *AdmissionResponseDie

ResultDie mutates Result as a die.

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) 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) DieDiff added in v0.13.0

func (d *AdmissionReviewDie) DieDiff(opts ...cmp.Option) string

DieDiff uses cmp.Diff to compare the current value of the die with the sealed value.

func (*AdmissionReviewDie) DieFeed

DieFeed returns a new die with the provided resource.

func (*AdmissionReviewDie) DieFeedJSON

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

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

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

func (*AdmissionReviewDie) DieFeedYAMLFile

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) DiePatch added in v0.13.0

func (d *AdmissionReviewDie) DiePatch(patchType types.PatchType) ([]byte, error)

DiePatch generates a patch between the current value of the die and the sealed value.

func (*AdmissionReviewDie) DieRelease

DieRelease returns the resource managed by the die.

func (*AdmissionReviewDie) DieReleaseJSON

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

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

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

func (*AdmissionReviewDie) DieSeal added in v0.13.0

func (d *AdmissionReviewDie) DieSeal() *AdmissionReviewDie

DieSeal returns a new die for the current die's state that is sealed for comparison in future diff and patch operations.

func (*AdmissionReviewDie) DieSealFeed added in v0.13.0

DieSealFeed returns a new die for the current die's state that uses a specific resource for comparison in future diff and patch operations.

func (*AdmissionReviewDie) DieSealFeedPtr added in v0.13.0

DieSealFeedPtr returns a new die for the current die's state that uses a specific resource pointer for comparison in future diff and patch operations. If the resource is nil, the empty value is used instead.

func (*AdmissionReviewDie) DieSealRelease added in v0.13.0

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

DieSealRelease returns the sealed resource managed by the die.

func (*AdmissionReviewDie) DieSealReleasePtr added in v0.13.0

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

DieSealReleasePtr returns the sealed resource pointer managed by the die.

func (*AdmissionReviewDie) DieStamp

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

func (*AdmissionReviewDie) DieStampAt

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

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

RequestDie mutates Request as a die.

Request describes the attributes for the admission request.

func (*AdmissionReviewDie) Response

Response describes the attributes for the admission response.

func (*AdmissionReviewDie) ResponseDie

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

ResponseDie mutates Response as a die.

Response describes the attributes for the admission response.

func (*AdmissionReviewDie) TypeMeta

Jump to

Keyboard shortcuts

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