Skip to content

Commit 044e189

Browse files
committed
Introduce KubernetesResource interface
Signed-off-by: ruromero <rromerom@redhat.com>
1 parent ea32729 commit 044e189

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/client/interfaces.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
apierrors "k8s.io/apimachinery/pkg/api/errors"
2323

2424
"k8s.io/apimachinery/pkg/api/meta"
25+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2526
"k8s.io/apimachinery/pkg/runtime"
2627
"k8s.io/apimachinery/pkg/types"
2728
)
@@ -133,3 +134,10 @@ func IgnoreNotFound(err error) error {
133134
}
134135
return err
135136
}
137+
138+
// KubernetesResource allows functions to work indistinctly with any resource that
139+
// implements both Object interfaces.
140+
type KubernetesResource interface {
141+
metav1.Object
142+
runtime.Object
143+
}

0 commit comments

Comments
 (0)