chore: make linter happy

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
This commit is contained in:
Leonardo Cecchi 2026-05-04 14:35:46 +02:00 committed by Leonardo Cecchi
parent 58a6a7a328
commit ff426a651e
3 changed files with 10 additions and 3 deletions

View File

@ -41,6 +41,9 @@ import (
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/operator/config"
)
// fullRecoveryJobName is the name of the restore job.
const fullRecoveryJobName = "full-recovery"
// LifecycleImplementation is the implementation of the lifecycle handler
type LifecycleImplementation struct {
lifecycle.UnimplementedOperatorLifecycleServer
@ -48,6 +51,8 @@ type LifecycleImplementation struct {
}
// GetCapabilities exposes the lifecycle capabilities
//
//nolint:goconst
func (impl LifecycleImplementation) GetCapabilities(
_ context.Context,
_ *lifecycle.OperatorLifecycleCapabilitiesRequest,
@ -186,7 +191,7 @@ func reconcileJob(
contextLogger.Debug("starting job reconciliation")
jobRole := getCNPGJobRole(&job)
if jobRole != "full-recovery" &&
if jobRole != fullRecoveryJobName &&
jobRole != "snapshot-recovery" {
contextLogger.Debug("job is not a recovery job, skipping")
return nil, nil

View File

@ -139,10 +139,10 @@ var _ = Describe("LifecycleImplementation", func() {
Spec: batchv1.JobSpec{Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
utils.JobRoleLabelName: "full-recovery",
utils.JobRoleLabelName: fullRecoveryJobName,
},
},
Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "full-recovery"}}},
Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: fullRecoveryJobName}}},
}},
}
jobJSON, _ := json.Marshal(job)

View File

@ -47,6 +47,8 @@ func BuildRole(
}
// BuildRoleRules builds the RBAC PolicyRules for the given ObjectStores.
//
//nolint:goconst
func BuildRoleRules(barmanObjects []barmancloudv1.ObjectStore) []rbacv1.PolicyRule {
secretsSet := stringset.New()
barmanObjectsSet := stringset.New()