mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-07-07 02:02:21 +02:00
chore: make linter happy
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
This commit is contained in:
parent
58a6a7a328
commit
ff426a651e
@ -41,6 +41,9 @@ import (
|
|||||||
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/operator/config"
|
"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
|
// LifecycleImplementation is the implementation of the lifecycle handler
|
||||||
type LifecycleImplementation struct {
|
type LifecycleImplementation struct {
|
||||||
lifecycle.UnimplementedOperatorLifecycleServer
|
lifecycle.UnimplementedOperatorLifecycleServer
|
||||||
@ -48,6 +51,8 @@ type LifecycleImplementation struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetCapabilities exposes the lifecycle capabilities
|
// GetCapabilities exposes the lifecycle capabilities
|
||||||
|
//
|
||||||
|
//nolint:goconst
|
||||||
func (impl LifecycleImplementation) GetCapabilities(
|
func (impl LifecycleImplementation) GetCapabilities(
|
||||||
_ context.Context,
|
_ context.Context,
|
||||||
_ *lifecycle.OperatorLifecycleCapabilitiesRequest,
|
_ *lifecycle.OperatorLifecycleCapabilitiesRequest,
|
||||||
@ -186,7 +191,7 @@ func reconcileJob(
|
|||||||
contextLogger.Debug("starting job reconciliation")
|
contextLogger.Debug("starting job reconciliation")
|
||||||
|
|
||||||
jobRole := getCNPGJobRole(&job)
|
jobRole := getCNPGJobRole(&job)
|
||||||
if jobRole != "full-recovery" &&
|
if jobRole != fullRecoveryJobName &&
|
||||||
jobRole != "snapshot-recovery" {
|
jobRole != "snapshot-recovery" {
|
||||||
contextLogger.Debug("job is not a recovery job, skipping")
|
contextLogger.Debug("job is not a recovery job, skipping")
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|||||||
@ -139,10 +139,10 @@ var _ = Describe("LifecycleImplementation", func() {
|
|||||||
Spec: batchv1.JobSpec{Template: corev1.PodTemplateSpec{
|
Spec: batchv1.JobSpec{Template: corev1.PodTemplateSpec{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Labels: map[string]string{
|
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)
|
jobJSON, _ := json.Marshal(job)
|
||||||
|
|||||||
@ -47,6 +47,8 @@ func BuildRole(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// BuildRoleRules builds the RBAC PolicyRules for the given ObjectStores.
|
// BuildRoleRules builds the RBAC PolicyRules for the given ObjectStores.
|
||||||
|
//
|
||||||
|
//nolint:goconst
|
||||||
func BuildRoleRules(barmanObjects []barmancloudv1.ObjectStore) []rbacv1.PolicyRule {
|
func BuildRoleRules(barmanObjects []barmancloudv1.ObjectStore) []rbacv1.PolicyRule {
|
||||||
secretsSet := stringset.New()
|
secretsSet := stringset.New()
|
||||||
barmanObjectsSet := stringset.New()
|
barmanObjectsSet := stringset.New()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user