mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-12 05:33:11 +01:00
chore: fix linter issues
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
This commit is contained in:
parent
ed6cc19d29
commit
8cd2a2e1ac
@ -50,6 +50,7 @@ func (e *ExtendedClient) refreshTTL(ctx context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get behaves like the original Get method, but uses a cache for secrets
|
||||||
func (e *ExtendedClient) Get(
|
func (e *ExtendedClient) Get(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
key client.ObjectKey,
|
key client.ObjectKey,
|
||||||
@ -139,6 +140,7 @@ func (e *ExtendedClient) RemoveSecret(key client.ObjectKey) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update behaves like the original Update method, but on secrets it removes the secret from the cache
|
||||||
func (e *ExtendedClient) Update(
|
func (e *ExtendedClient) Update(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
obj client.Object,
|
obj client.Object,
|
||||||
@ -157,6 +159,7 @@ func (e *ExtendedClient) Update(
|
|||||||
return e.Client.Update(ctx, obj, opts...)
|
return e.Client.Update(ctx, obj, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete behaves like the original Delete method, but on secrets it removes the secret from the cache
|
||||||
func (e *ExtendedClient) Delete(
|
func (e *ExtendedClient) Delete(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
obj client.Object,
|
obj client.Object,
|
||||||
@ -175,6 +178,7 @@ func (e *ExtendedClient) Delete(
|
|||||||
return e.Client.Delete(ctx, obj, opts...)
|
return e.Client.Delete(ctx, obj, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Patch behaves like the original Patch method, but on secrets it removes the secret from the cache
|
||||||
func (e *ExtendedClient) Patch(
|
func (e *ExtendedClient) Patch(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
obj client.Object,
|
obj client.Object,
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
"k8s.io/utils/ptr"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client/fake"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
v1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1"
|
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/utils/ptr"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||||
|
"sigs.k8s.io/controller-runtime/pkg/client/fake"
|
||||||
|
|
||||||
|
v1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|||||||
@ -165,14 +165,12 @@ func reconcilePod(
|
|||||||
request *lifecycle.OperatorLifecycleRequest,
|
request *lifecycle.OperatorLifecycleRequest,
|
||||||
pluginConfiguration *config.PluginConfiguration,
|
pluginConfiguration *config.PluginConfiguration,
|
||||||
) (*lifecycle.OperatorLifecycleResponse, error) {
|
) (*lifecycle.OperatorLifecycleResponse, error) {
|
||||||
contextLogger := log.FromContext(ctx).WithName("lifecycle")
|
|
||||||
|
|
||||||
pod, err := decoder.DecodePodJSON(request.GetObjectDefinition())
|
pod, err := decoder.DecodePodJSON(request.GetObjectDefinition())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
contextLogger = log.FromContext(ctx).WithName("plugin-barman-cloud-lifecycle").
|
contextLogger := log.FromContext(ctx).WithName("plugin-barman-cloud-lifecycle").
|
||||||
WithValues("podName", pod.Name)
|
WithValues("podName", pod.Name)
|
||||||
|
|
||||||
mutatedPod := pod.DeepCopy()
|
mutatedPod := pod.DeepCopy()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user