Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/client/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"

"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
)
Expand Down Expand Up @@ -133,3 +134,10 @@ func IgnoreNotFound(err error) error {
}
return err
}

// KubernetesResource allows functions to work indistinctly with any resource that
// implements both Object interfaces.
type KubernetesResource interface {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this is a union of two *.Object types would it be more intuitive for this to also include Object in the name?

Also, I wonder if the client package is the most appropriate place for this type. Nothing is really jumping out to me as an alternate though. Perhaps pkg/controller/controllerutil? 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed and moved

metav1.Object
runtime.Object
}