@@ -56,7 +56,7 @@ func (n *namespacedClient) RESTMapper() meta.RESTMapper {
56
56
func (n * namespacedClient ) Create (ctx context.Context , obj Object , opts ... CreateOption ) error {
57
57
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , n .Scheme (), n .RESTMapper ())
58
58
if err != nil {
59
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
59
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
60
60
}
61
61
62
62
objectNamespace := obj .GetNamespace ()
@@ -74,7 +74,7 @@ func (n *namespacedClient) Create(ctx context.Context, obj Object, opts ...Creat
74
74
func (n * namespacedClient ) Update (ctx context.Context , obj Object , opts ... UpdateOption ) error {
75
75
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , n .Scheme (), n .RESTMapper ())
76
76
if err != nil {
77
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
77
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
78
78
}
79
79
80
80
objectNamespace := obj .GetNamespace ()
@@ -92,7 +92,7 @@ func (n *namespacedClient) Update(ctx context.Context, obj Object, opts ...Updat
92
92
func (n * namespacedClient ) Delete (ctx context.Context , obj Object , opts ... DeleteOption ) error {
93
93
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , n .Scheme (), n .RESTMapper ())
94
94
if err != nil {
95
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
95
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
96
96
}
97
97
98
98
objectNamespace := obj .GetNamespace ()
@@ -110,7 +110,7 @@ func (n *namespacedClient) Delete(ctx context.Context, obj Object, opts ...Delet
110
110
func (n * namespacedClient ) DeleteAllOf (ctx context.Context , obj Object , opts ... DeleteAllOfOption ) error {
111
111
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , n .Scheme (), n .RESTMapper ())
112
112
if err != nil {
113
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
113
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
114
114
}
115
115
116
116
if isNamespaceScoped {
@@ -123,7 +123,7 @@ func (n *namespacedClient) DeleteAllOf(ctx context.Context, obj Object, opts ...
123
123
func (n * namespacedClient ) Patch (ctx context.Context , obj Object , patch Patch , opts ... PatchOption ) error {
124
124
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , n .Scheme (), n .RESTMapper ())
125
125
if err != nil {
126
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
126
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
127
127
}
128
128
129
129
objectNamespace := obj .GetNamespace ()
@@ -141,7 +141,7 @@ func (n *namespacedClient) Patch(ctx context.Context, obj Object, patch Patch, o
141
141
func (n * namespacedClient ) Get (ctx context.Context , key ObjectKey , obj Object ) error {
142
142
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , n .Scheme (), n .RESTMapper ())
143
143
if err != nil {
144
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
144
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
145
145
}
146
146
if isNamespaceScoped {
147
147
if key .Namespace != "" && key .Namespace != n .namespace {
@@ -179,7 +179,7 @@ func (nsw *namespacedClientStatusWriter) Update(ctx context.Context, obj Object,
179
179
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , nsw .namespacedclient .Scheme (), nsw .namespacedclient .RESTMapper ())
180
180
181
181
if err != nil {
182
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
182
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
183
183
}
184
184
185
185
objectNamespace := obj .GetNamespace ()
@@ -198,7 +198,7 @@ func (nsw *namespacedClientStatusWriter) Patch(ctx context.Context, obj Object,
198
198
isNamespaceScoped , err := objectutil .IsAPINamespaced (obj , nsw .namespacedclient .Scheme (), nsw .namespacedclient .RESTMapper ())
199
199
200
200
if err != nil {
201
- return fmt .Errorf ("error finding the scope of the object: %v " , err )
201
+ return fmt .Errorf ("error finding the scope of the object: %w " , err )
202
202
}
203
203
204
204
objectNamespace := obj .GetNamespace ()
0 commit comments