2 Copyright 2018 The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
20 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
26 // Lease defines a lease concept.
28 metav1.TypeMeta `json:",inline"`
29 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
31 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
33 // Specification of the Lease.
34 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
36 Spec LeaseSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
39 // LeaseSpec is a specification of a Lease.
40 type LeaseSpec struct {
41 // holderIdentity contains the identity of the holder of a current lease.
43 HolderIdentity *string `json:"holderIdentity,omitempty" protobuf:"bytes,1,opt,name=holderIdentity"`
44 // leaseDurationSeconds is a duration that candidates for a lease need
45 // to wait to force acquire it. This is measure against time of last
46 // observed RenewTime.
48 LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty" protobuf:"varint,2,opt,name=leaseDurationSeconds"`
49 // acquireTime is a time when the current lease was acquired.
51 AcquireTime *metav1.MicroTime `json:"acquireTime,omitempty" protobuf:"bytes,3,opt,name=acquireTime"`
52 // renewTime is a time when the current holder of a lease has last
55 RenewTime *metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,4,opt,name=renewTime"`
56 // leaseTransitions is the number of transitions of a lease between
59 LeaseTransitions *int32 `json:"leaseTransitions,omitempty" protobuf:"varint,5,opt,name=leaseTransitions"`
62 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
64 // LeaseList is a list of Lease objects.
65 type LeaseList struct {
66 metav1.TypeMeta `json:",inline"`
67 // Standard list metadata.
68 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
70 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
72 // Items is a list of schema objects.
73 Items []Lease `json:"items" protobuf:"bytes,2,rep,name=items"`