From c4e32588dc0892ebf3aa2b3baeeaecdabb267d84 Mon Sep 17 00:00:00 2001 From: Kristoffer Ahl Date: Tue, 4 Jul 2023 15:32:22 +0200 Subject: [PATCH] Added missing NamespacedName receivers for eventstreamchunk and savingspolicy. --- apis/event/v1alpha1/eventstreamchunk_types.go | 9 +++++++++ apis/sustainability/v1alpha1/savingspolicy_types.go | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/apis/event/v1alpha1/eventstreamchunk_types.go b/apis/event/v1alpha1/eventstreamchunk_types.go index 7c48d3a..e1294c1 100644 --- a/apis/event/v1alpha1/eventstreamchunk_types.go +++ b/apis/event/v1alpha1/eventstreamchunk_types.go @@ -20,6 +20,7 @@ import ( "sort" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ) // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! @@ -86,6 +87,14 @@ func (l EventStreamChunkList) Sort() []EventStreamChunk { return l.Items } +// NamespacedName returns a namespaced name for the custom resource +func (esc EventStreamChunk) NamespacedName() types.NamespacedName { + return types.NamespacedName{ + Namespace: esc.Namespace, + Name: esc.Name, + } +} + func init() { SchemeBuilder.Register(&EventStreamChunk{}, &EventStreamChunkList{}) } diff --git a/apis/sustainability/v1alpha1/savingspolicy_types.go b/apis/sustainability/v1alpha1/savingspolicy_types.go index fbfa5b3..4b61bec 100644 --- a/apis/sustainability/v1alpha1/savingspolicy_types.go +++ b/apis/sustainability/v1alpha1/savingspolicy_types.go @@ -18,6 +18,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ) // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! @@ -114,3 +115,11 @@ type SavingsPolicyList struct { func init() { SchemeBuilder.Register(&SavingsPolicy{}, &SavingsPolicyList{}) } + +// NamespacedName returns a namespaced name for the custom resource +func (sp SavingsPolicy) NamespacedName() types.NamespacedName { + return types.NamespacedName{ + Namespace: sp.Namespace, + Name: sp.Name, + } +}