Skip to content

Commit 53d2cfe

Browse files
committed
chore: fix linter issues
Signed-off-by: Francesco Canovai <[email protected]>
1 parent 89d4b4d commit 53d2cfe

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

internal/cnpgi/instance/internal/client/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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
5354
func (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
142144
func (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
160163
func (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
178182
func (e *ExtendedClient) Patch(
179183
ctx context.Context,
180184
obj client.Object,

internal/cnpgi/instance/internal/client/client_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
package client
22

33
import (
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"

internal/cnpgi/operator/lifecycle.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)