Skip to content

Commit

Permalink
Added missing NamespacedName receivers for eventstreamchunk and savin…
Browse files Browse the repository at this point in the history
…gspolicy.
  • Loading branch information
kristofferahl committed Jul 4, 2023
1 parent a93e902 commit c4e3258
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apis/event/v1alpha1/eventstreamchunk_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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{})
}
9 changes: 9 additions & 0 deletions apis/sustainability/v1alpha1/savingspolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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,
}
}

0 comments on commit c4e3258

Please sign in to comment.