Skip to content

Commit 00b0ae5

Browse files
committed
refactor: remove redundant delegate methods from OvercommitClass
- Remove ~30 getter/setter methods that simply forwarded to the embedded metav1.ObjectMeta, which already implements the v1.Object interface via Go struct embedding - Remove unused 'k8s.io/apimachinery/pkg/types' import - Reduces ~140 lines of dead code improving maintainability
1 parent 31e776c commit 00b0ae5

1 file changed

Lines changed: 0 additions & 141 deletions

File tree

api/v1alphav1/overcommitclass_types.go

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package v1alphav1
88
import (
99
corev1 "k8s.io/api/core/v1"
1010
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11-
"k8s.io/apimachinery/pkg/types"
1211
)
1312

1413
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
@@ -68,146 +67,6 @@ type OvercommitClass struct {
6867
Status OvercommitClassStatus `json:"status,omitempty"`
6968
}
7069

71-
// GetAnnotations implements v1.Object.
72-
func (in *OvercommitClass) GetAnnotations() map[string]string {
73-
return in.ObjectMeta.Annotations
74-
}
75-
76-
// GetCreationTimestamp implements v1.Object.
77-
func (in *OvercommitClass) GetCreationTimestamp() metav1.Time {
78-
return in.ObjectMeta.CreationTimestamp
79-
}
80-
81-
// GetDeletionGracePeriodSeconds implements v1.Object.
82-
func (in *OvercommitClass) GetDeletionGracePeriodSeconds() *int64 {
83-
return in.ObjectMeta.DeletionGracePeriodSeconds
84-
}
85-
86-
// GetDeletionTimestamp implements v1.Object.
87-
func (in *OvercommitClass) GetDeletionTimestamp() *metav1.Time {
88-
return in.ObjectMeta.DeletionTimestamp
89-
}
90-
91-
// GetFinalizers implements v1.Object.
92-
func (in *OvercommitClass) GetFinalizers() []string {
93-
return in.ObjectMeta.Finalizers
94-
}
95-
96-
// GetGenerateName implements v1.Object.
97-
func (in *OvercommitClass) GetGenerateName() string {
98-
return in.ObjectMeta.GenerateName
99-
}
100-
101-
// GetGeneration implements v1.Object.
102-
func (in *OvercommitClass) GetGeneration() int64 {
103-
return in.ObjectMeta.Generation
104-
}
105-
106-
// GetLabels implements v1.Object.
107-
func (in *OvercommitClass) GetLabels() map[string]string {
108-
return in.ObjectMeta.Labels
109-
}
110-
111-
// GetManagedFields implements v1.Object.
112-
func (in *OvercommitClass) GetManagedFields() []metav1.ManagedFieldsEntry {
113-
return in.ObjectMeta.ManagedFields
114-
}
115-
116-
// GetName implements v1.Object.
117-
func (in *OvercommitClass) GetName() string {
118-
return in.ObjectMeta.Name
119-
}
120-
121-
// GetNamespace implements v1.Object.
122-
func (in *OvercommitClass) GetNamespace() string {
123-
return in.ObjectMeta.Namespace
124-
}
125-
126-
// GetOwnerReferences implements v1.Object.
127-
func (in *OvercommitClass) GetOwnerReferences() []metav1.OwnerReference {
128-
return in.ObjectMeta.OwnerReferences
129-
}
130-
131-
// GetResourceVersion implements v1.Object.
132-
func (in *OvercommitClass) GetResourceVersion() string {
133-
return in.ObjectMeta.ResourceVersion
134-
}
135-
136-
// GetUID implements v1.Object.
137-
func (in *OvercommitClass) GetUID() types.UID {
138-
return in.ObjectMeta.UID
139-
}
140-
141-
// SetAnnotations implements v1.Object.
142-
func (in *OvercommitClass) SetAnnotations(annotations map[string]string) {
143-
in.ObjectMeta.Annotations = annotations
144-
}
145-
146-
// SetCreationTimestamp implements v1.Object.
147-
func (in *OvercommitClass) SetCreationTimestamp(timestamp metav1.Time) {
148-
in.ObjectMeta.CreationTimestamp = timestamp
149-
}
150-
151-
// SetDeletionGracePeriodSeconds implements v1.Object.
152-
func (in *OvercommitClass) SetDeletionGracePeriodSeconds(seconds *int64) {
153-
in.ObjectMeta.DeletionGracePeriodSeconds = seconds
154-
}
155-
156-
// SetDeletionTimestamp implements v1.Object.
157-
func (in *OvercommitClass) SetDeletionTimestamp(timestamp *metav1.Time) {
158-
in.ObjectMeta.DeletionTimestamp = timestamp
159-
}
160-
161-
// SetFinalizers implements v1.Object.
162-
func (in *OvercommitClass) SetFinalizers(finalizers []string) {
163-
in.ObjectMeta.Finalizers = finalizers
164-
}
165-
166-
// SetGenerateName implements v1.Object.
167-
func (in *OvercommitClass) SetGenerateName(name string) {
168-
in.ObjectMeta.GenerateName = name
169-
}
170-
171-
// SetGeneration implements v1.Object.
172-
func (in *OvercommitClass) SetGeneration(generation int64) {
173-
in.ObjectMeta.Generation = generation
174-
}
175-
176-
// SetLabels implements v1.Object.
177-
func (in *OvercommitClass) SetLabels(labels map[string]string) {
178-
in.ObjectMeta.Labels = labels
179-
}
180-
181-
// SetManagedFields implements v1.Object.
182-
func (in *OvercommitClass) SetManagedFields(managedFields []metav1.ManagedFieldsEntry) {
183-
in.ObjectMeta.ManagedFields = managedFields
184-
}
185-
186-
// SetName implements v1.Object.
187-
func (in *OvercommitClass) SetName(name string) {
188-
in.ObjectMeta.Name = name
189-
}
190-
191-
// SetNamespace implements v1.Object.
192-
func (in *OvercommitClass) SetNamespace(namespace string) {
193-
in.ObjectMeta.Namespace = namespace
194-
}
195-
196-
// SetOwnerReferences implements v1.Object.
197-
func (in *OvercommitClass) SetOwnerReferences(references []metav1.OwnerReference) {
198-
in.ObjectMeta.OwnerReferences = references
199-
}
200-
201-
// SetResourceVersion implements v1.Object.
202-
func (in *OvercommitClass) SetResourceVersion(version string) {
203-
in.ObjectMeta.ResourceVersion = version
204-
}
205-
206-
// SetUID implements v1.Object.
207-
func (in *OvercommitClass) SetUID(uid types.UID) {
208-
in.ObjectMeta.UID = uid
209-
}
210-
21170
// +kubebuilder:object:root=true
21271

21372
// OvercommitClassList contains a list of OvercommitClass

0 commit comments

Comments
 (0)