File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ func (e *ExtendedClient) refreshTTL(ctx context.Context) error {
5050 return nil
5151}
5252
53+ // Get behaves like the original Get method, but uses a cache for secrets
5354func (e * ExtendedClient ) Get (
5455 ctx context.Context ,
5556 key client.ObjectKey ,
@@ -139,6 +140,7 @@ func (e *ExtendedClient) RemoveSecret(key client.ObjectKey) {
139140 }
140141}
141142
143+ // Update behaves like the original Update method, but on secrets it removes the secret from the cache
142144func (e * ExtendedClient ) Update (
143145 ctx context.Context ,
144146 obj client.Object ,
@@ -157,6 +159,7 @@ func (e *ExtendedClient) Update(
157159 return e .Client .Update (ctx , obj , opts ... )
158160}
159161
162+ // Delete behaves like the original Delete method, but on secrets it removes the secret from the cache
160163func (e * ExtendedClient ) Delete (
161164 ctx context.Context ,
162165 obj client.Object ,
@@ -175,6 +178,7 @@ func (e *ExtendedClient) Delete(
175178 return e .Client .Delete (ctx , obj , opts ... )
176179}
177180
181+ // Patch behaves like the original Patch method, but on secrets it removes the secret from the cache
178182func (e * ExtendedClient ) Patch (
179183 ctx context.Context ,
180184 obj client.Object ,
Original file line number Diff line number Diff line change 11package client
22
33import (
4- "k8s.io/apimachinery/pkg/runtime"
5- "k8s.io/utils/ptr"
6- "sigs.k8s.io/controller-runtime/pkg/client/fake"
74 "time"
85
9- v1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1"
106 corev1 "k8s.io/api/core/v1"
117 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8+ "k8s.io/apimachinery/pkg/runtime"
9+ "k8s.io/utils/ptr"
1210 "sigs.k8s.io/controller-runtime/pkg/client"
11+ "sigs.k8s.io/controller-runtime/pkg/client/fake"
12+
13+ v1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1"
1314
1415 . "github.com/onsi/ginkgo/v2"
1516 . "github.com/onsi/gomega"
Original file line number Diff line number Diff line change @@ -165,14 +165,12 @@ func reconcilePod(
165165 request * lifecycle.OperatorLifecycleRequest ,
166166 pluginConfiguration * config.PluginConfiguration ,
167167) (* lifecycle.OperatorLifecycleResponse , error ) {
168- contextLogger := log .FromContext (ctx ).WithName ("lifecycle" )
169-
170168 pod , err := decoder .DecodePodJSON (request .GetObjectDefinition ())
171169 if err != nil {
172170 return nil , err
173171 }
174172
175- contextLogger = log .FromContext (ctx ).WithName ("plugin-barman-cloud-lifecycle" ).
173+ contextLogger : = log .FromContext (ctx ).WithName ("plugin-barman-cloud-lifecycle" ).
176174 WithValues ("podName" , pod .Name )
177175
178176 mutatedPod := pod .DeepCopy ()
You can’t perform that action at this time.
0 commit comments