@@ -30,7 +30,7 @@ type typedClient struct {
30
30
}
31
31
32
32
// Create implements client.Client
33
- func (c * typedClient ) Create (_ context.Context , obj runtime.Object ) error {
33
+ func (c * typedClient ) Create (ctx context.Context , obj runtime.Object ) error {
34
34
o , err := c .cache .getObjMeta (obj )
35
35
if err != nil {
36
36
return err
@@ -39,12 +39,13 @@ func (c *typedClient) Create(_ context.Context, obj runtime.Object) error {
39
39
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
40
40
Resource (o .resource ()).
41
41
Body (obj ).
42
+ Context (ctx ).
42
43
Do ().
43
44
Into (obj )
44
45
}
45
46
46
47
// Update implements client.Client
47
- func (c * typedClient ) Update (_ context.Context , obj runtime.Object ) error {
48
+ func (c * typedClient ) Update (ctx context.Context , obj runtime.Object ) error {
48
49
o , err := c .cache .getObjMeta (obj )
49
50
if err != nil {
50
51
return err
@@ -54,12 +55,13 @@ func (c *typedClient) Update(_ context.Context, obj runtime.Object) error {
54
55
Resource (o .resource ()).
55
56
Name (o .GetName ()).
56
57
Body (obj ).
58
+ Context (ctx ).
57
59
Do ().
58
60
Into (obj )
59
61
}
60
62
61
63
// Delete implements client.Client
62
- func (c * typedClient ) Delete (_ context.Context , obj runtime.Object , opts ... DeleteOptionFunc ) error {
64
+ func (c * typedClient ) Delete (ctx context.Context , obj runtime.Object , opts ... DeleteOptionFunc ) error {
63
65
o , err := c .cache .getObjMeta (obj )
64
66
if err != nil {
65
67
return err
@@ -71,24 +73,26 @@ func (c *typedClient) Delete(_ context.Context, obj runtime.Object, opts ...Dele
71
73
Resource (o .resource ()).
72
74
Name (o .GetName ()).
73
75
Body (deleteOpts .ApplyOptions (opts ).AsDeleteOptions ()).
76
+ Context (ctx ).
74
77
Do ().
75
78
Error ()
76
79
}
77
80
78
81
// Get implements client.Client
79
- func (c * typedClient ) Get (_ context.Context , key ObjectKey , obj runtime.Object ) error {
82
+ func (c * typedClient ) Get (ctx context.Context , key ObjectKey , obj runtime.Object ) error {
80
83
r , err := c .cache .getResource (obj )
81
84
if err != nil {
82
85
return err
83
86
}
84
87
return r .Get ().
85
88
NamespaceIfScoped (key .Namespace , r .isNamespaced ()).
86
89
Resource (r .resource ()).
90
+ Context (ctx ).
87
91
Name (key .Name ).Do ().Into (obj )
88
92
}
89
93
90
94
// List implements client.Client
91
- func (c * typedClient ) List (_ context.Context , opts * ListOptions , obj runtime.Object ) error {
95
+ func (c * typedClient ) List (ctx context.Context , opts * ListOptions , obj runtime.Object ) error {
92
96
r , err := c .cache .getResource (obj )
93
97
if err != nil {
94
98
return err
@@ -102,12 +106,13 @@ func (c *typedClient) List(_ context.Context, opts *ListOptions, obj runtime.Obj
102
106
Resource (r .resource ()).
103
107
Body (obj ).
104
108
VersionedParams (opts .AsListOptions (), c .paramCodec ).
109
+ Context (ctx ).
105
110
Do ().
106
111
Into (obj )
107
112
}
108
113
109
114
// UpdateStatus used by StatusWriter to write status.
110
- func (c * typedClient ) UpdateStatus (_ context.Context , obj runtime.Object ) error {
115
+ func (c * typedClient ) UpdateStatus (ctx context.Context , obj runtime.Object ) error {
111
116
o , err := c .cache .getObjMeta (obj )
112
117
if err != nil {
113
118
return err
@@ -122,6 +127,7 @@ func (c *typedClient) UpdateStatus(_ context.Context, obj runtime.Object) error
122
127
Name (o .GetName ()).
123
128
SubResource ("status" ).
124
129
Body (obj ).
130
+ Context (ctx ).
125
131
Do ().
126
132
Into (obj )
127
133
}
0 commit comments