Skip to content

Commit 45c8b28

Browse files
authored
Merge pull request #6099 from dlipovetsky/main
🌱 [controllers/external] Accept narrower interfaces
2 parents 691e5c4 + f9e4148 commit 45c8b28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controllers/external/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
)
3232

3333
// Get uses the client and reference to get an external, unstructured object.
34-
func Get(ctx context.Context, c client.Client, ref *corev1.ObjectReference, namespace string) (*unstructured.Unstructured, error) {
34+
func Get(ctx context.Context, c client.Reader, ref *corev1.ObjectReference, namespace string) (*unstructured.Unstructured, error) {
3535
if ref == nil {
3636
return nil, errors.Errorf("cannot get object - object reference not set")
3737
}
@@ -47,7 +47,7 @@ func Get(ctx context.Context, c client.Client, ref *corev1.ObjectReference, name
4747
}
4848

4949
// Delete uses the client and reference to delete an external, unstructured object.
50-
func Delete(ctx context.Context, c client.Client, ref *corev1.ObjectReference) error {
50+
func Delete(ctx context.Context, c client.Writer, ref *corev1.ObjectReference) error {
5151
obj := new(unstructured.Unstructured)
5252
obj.SetAPIVersion(ref.APIVersion)
5353
obj.SetKind(ref.Kind)

0 commit comments

Comments
 (0)