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 LeaseBlank = (&LeaseDie{}).DieFeed(coordinationv1.Lease{})
View Source
var LeaseSpecBlank = (&LeaseSpecDie{}).DieFeed(coordinationv1.LeaseSpec{})

Functions

This section is empty.

Types

type LeaseDie

type LeaseDie struct {
	metav1.FrozenObjectMeta
	// contains filtered or unexported fields
}

func (*LeaseDie) APIVersion

func (d *LeaseDie) APIVersion(v string) *LeaseDie

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

func (*LeaseDie) DeepCopy

func (d *LeaseDie) DeepCopy() *LeaseDie

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

func (*LeaseDie) DeepCopyObject

func (d *LeaseDie) DeepCopyObject() runtime.Object

func (*LeaseDie) DieDefaultTypeMetadata added in v0.13.0

func (d *LeaseDie) DieDefaultTypeMetadata() *LeaseDie

DieDefaultTypeMetadata sets the APIVersion and Kind to "coordination.k8s.io/v1" and "Lease" respectively.

func (*LeaseDie) DieDiff added in v0.13.0

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

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

func (*LeaseDie) DieFeed

func (d *LeaseDie) DieFeed(r coordinationv1.Lease) *LeaseDie

DieFeed returns a new die with the provided resource.

func (*LeaseDie) DieFeedJSON

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

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

func (*LeaseDie) DieFeedPtr

func (d *LeaseDie) DieFeedPtr(r *coordinationv1.Lease) *LeaseDie

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

func (*LeaseDie) DieFeedRawExtension

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

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

func (*LeaseDie) DieFeedYAML

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

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

func (*LeaseDie) DieFeedYAMLFile

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

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

func (*LeaseDie) DieImmutable

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

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

func (*LeaseDie) DiePatch added in v0.13.0

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

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

func (*LeaseDie) DieRelease

func (d *LeaseDie) DieRelease() coordinationv1.Lease

DieRelease returns the resource managed by the die.

func (*LeaseDie) DieReleaseJSON

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

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

func (*LeaseDie) DieReleasePtr

func (d *LeaseDie) DieReleasePtr() *coordinationv1.Lease

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

func (*LeaseDie) DieReleaseRawExtension

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

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

func (*LeaseDie) DieReleaseUnstructured

func (d *LeaseDie) DieReleaseUnstructured() *unstructured.Unstructured

DieReleaseUnstructured returns the resource managed by the die as an unstructured object. Panics on error.

func (*LeaseDie) DieReleaseYAML

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

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

func (*LeaseDie) DieSeal added in v0.13.0

func (d *LeaseDie) DieSeal() *LeaseDie

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

func (*LeaseDie) DieSealFeed added in v0.13.0

func (d *LeaseDie) DieSealFeed(r coordinationv1.Lease) *LeaseDie

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 (*LeaseDie) DieSealFeedPtr added in v0.13.0

func (d *LeaseDie) DieSealFeedPtr(r *coordinationv1.Lease) *LeaseDie

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 (*LeaseDie) DieSealRelease added in v0.13.0

func (d *LeaseDie) DieSealRelease() coordinationv1.Lease

DieSealRelease returns the sealed resource managed by the die.

func (*LeaseDie) DieSealReleasePtr added in v0.13.0

func (d *LeaseDie) DieSealReleasePtr() *coordinationv1.Lease

DieSealReleasePtr returns the sealed resource pointer managed by the die.

func (*LeaseDie) DieStamp

func (d *LeaseDie) DieStamp(fn func(r *coordinationv1.Lease)) *LeaseDie

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

func (*LeaseDie) DieStampAt

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

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 (*LeaseDie) DieWith

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

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

func (*LeaseDie) GetObjectKind

func (d *LeaseDie) GetObjectKind() schema.ObjectKind

func (*LeaseDie) Kind

func (d *LeaseDie) Kind(v string) *LeaseDie

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

func (*LeaseDie) MarshalJSON

func (d *LeaseDie) MarshalJSON() ([]byte, error)

func (*LeaseDie) Metadata added in v0.13.0

func (d *LeaseDie) Metadata(v apismetav1.ObjectMeta) *LeaseDie

Metadata standard object's metadata.

func (*LeaseDie) MetadataDie

func (d *LeaseDie) MetadataDie(fn func(d *metav1.ObjectMetaDie)) *LeaseDie

MetadataDie stamps the resource's ObjectMeta field with a mutable die.

func (*LeaseDie) Spec

spec contains the specification of the Lease.

More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

func (*LeaseDie) SpecDie

func (d *LeaseDie) SpecDie(fn func(d *LeaseSpecDie)) *LeaseDie

SpecDie stamps the resource's spec field with a mutable die.

func (*LeaseDie) TypeMetadata added in v0.13.0

func (d *LeaseDie) TypeMetadata(v apismetav1.TypeMeta) *LeaseDie

TypeMetadata standard object's type metadata.

func (*LeaseDie) TypeMetadataDie added in v0.13.0

func (d *LeaseDie) TypeMetadataDie(fn func(d *metav1.TypeMetaDie)) *LeaseDie

TypeMetadataDie stamps the resource's TypeMeta field with a mutable die.

func (*LeaseDie) UnmarshalJSON

func (d *LeaseDie) UnmarshalJSON(b []byte) error

type LeaseSpecDie

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

func (*LeaseSpecDie) AcquireTime

func (d *LeaseSpecDie) AcquireTime(v *apismetav1.MicroTime) *LeaseSpecDie

acquireTime is a time when the current lease was acquired.

func (*LeaseSpecDie) DeepCopy

func (d *LeaseSpecDie) DeepCopy() *LeaseSpecDie

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

func (*LeaseSpecDie) DieDiff added in v0.13.0

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

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

func (*LeaseSpecDie) DieFeed

DieFeed returns a new die with the provided resource.

func (*LeaseSpecDie) DieFeedJSON

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

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

func (*LeaseSpecDie) DieFeedPtr

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

func (*LeaseSpecDie) DieFeedRawExtension

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

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

func (*LeaseSpecDie) DieFeedYAML

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

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

func (*LeaseSpecDie) DieFeedYAMLFile

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

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

func (*LeaseSpecDie) DieImmutable

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

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

func (*LeaseSpecDie) DiePatch added in v0.13.0

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

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

func (*LeaseSpecDie) DieRelease

func (d *LeaseSpecDie) DieRelease() coordinationv1.LeaseSpec

DieRelease returns the resource managed by the die.

func (*LeaseSpecDie) DieReleaseJSON

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

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

func (*LeaseSpecDie) DieReleasePtr

func (d *LeaseSpecDie) DieReleasePtr() *coordinationv1.LeaseSpec

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

func (*LeaseSpecDie) DieReleaseRawExtension

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

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

func (*LeaseSpecDie) DieReleaseYAML

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

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

func (*LeaseSpecDie) DieSeal added in v0.13.0

func (d *LeaseSpecDie) DieSeal() *LeaseSpecDie

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

func (*LeaseSpecDie) 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 (*LeaseSpecDie) DieSealFeedPtr added in v0.13.0

func (d *LeaseSpecDie) DieSealFeedPtr(r *coordinationv1.LeaseSpec) *LeaseSpecDie

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 (*LeaseSpecDie) DieSealRelease added in v0.13.0

func (d *LeaseSpecDie) DieSealRelease() coordinationv1.LeaseSpec

DieSealRelease returns the sealed resource managed by the die.

func (*LeaseSpecDie) DieSealReleasePtr added in v0.13.0

func (d *LeaseSpecDie) DieSealReleasePtr() *coordinationv1.LeaseSpec

DieSealReleasePtr returns the sealed resource pointer managed by the die.

func (*LeaseSpecDie) DieStamp

func (d *LeaseSpecDie) DieStamp(fn func(r *coordinationv1.LeaseSpec)) *LeaseSpecDie

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

func (*LeaseSpecDie) DieStampAt

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

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 (*LeaseSpecDie) DieWith

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

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

func (*LeaseSpecDie) HolderIdentity

func (d *LeaseSpecDie) HolderIdentity(v *string) *LeaseSpecDie

holderIdentity contains the identity of the holder of a current lease.

If Coordinated Leader Election is used, the holder identity must be

equal to the elected LeaseCandidate.metadata.name field.

func (*LeaseSpecDie) LeaseDurationSeconds

func (d *LeaseSpecDie) LeaseDurationSeconds(v *int32) *LeaseSpecDie

leaseDurationSeconds is a duration that candidates for a lease need

to wait to force acquire it. This is measured against the time of last

observed renewTime.

func (*LeaseSpecDie) LeaseTransitions

func (d *LeaseSpecDie) LeaseTransitions(v *int32) *LeaseSpecDie

leaseTransitions is the number of transitions of a lease between

holders.

func (*LeaseSpecDie) PreferredHolder added in v0.14.0

func (d *LeaseSpecDie) PreferredHolder(v *string) *LeaseSpecDie

PreferredHolder signals to a lease holder that the lease has a

more optimal holder and should be given up.

This field can only be set if Strategy is also set.

func (*LeaseSpecDie) RenewTime

func (d *LeaseSpecDie) RenewTime(v *apismetav1.MicroTime) *LeaseSpecDie

renewTime is a time when the current holder of a lease has last

updated the lease.

func (*LeaseSpecDie) Strategy added in v0.14.0

Strategy indicates the strategy for picking the leader for coordinated leader election.

If the field is not specified, there is no active coordination for this lease.

(Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.

Jump to

Keyboard shortcuts

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