golangci-lint: use exclude-rules instead of skip-files and skip-dirs

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2024-03-27 20:17:34 +00:00
parent 3c704ba1b1
commit ef04ef6361
69 changed files with 39 additions and 117 deletions
-1
View File
@@ -58,7 +58,6 @@ func BackupRestoreRetainedPVWithRestic() {
}
func BackupRestoreTest(backupRestoreTestConfig BackupRestoreTestConfig) {
var (
backupName, restoreName, kibishiiNamespace string
err error
-1
View File
@@ -73,7 +73,6 @@ func BackupsSyncTest() {
Expect(VeleroUninstall(ctx, veleroCfg.VeleroCLI, veleroCfg.VeleroNamespace)).To(Succeed())
}
}
})
It("Backups in object storage should be synced to a new Velero successfully", func() {
-3
View File
@@ -51,7 +51,6 @@ func (b *TTL) Init() {
b.backupName = "backup-ttl-test-" + UUIDgen.String()
b.restoreName = "restore-ttl-test-" + UUIDgen.String()
b.ttl = 10 * time.Minute
}
func TTLTest() {
@@ -159,7 +158,6 @@ func TTLTest() {
veleroCfg.CloudCredentialsFile, veleroCfg.BSLBucket,
veleroCfg.BSLPrefix, veleroCfg.BSLConfig, test.restoreName,
RestoreObjectsPrefix)).NotTo(HaveOccurred(), "Fail to get restore object")
})
By("Check TTL was set correctly", func() {
@@ -198,7 +196,6 @@ func TTLTest() {
veleroCfg.CloudCredentialsFile, veleroCfg.BSLBucket,
veleroCfg.BSLPrefix, veleroCfg.BSLConfig, test.restoreName,
RestoreObjectsPrefix, 5)).NotTo(HaveOccurred(), "Fail to get restore object")
})
})
}
@@ -91,7 +91,6 @@ func APIExtensionsVersionsTest() {
veleroCfg.ClientToInstallVelero = veleroCfg.DefaultClient
})
}
})
Context("When EnableAPIGroupVersions flag is set", func() {
It("Enable API Group to B/R CRD APIExtensionsVersions", func() {
@@ -238,7 +238,6 @@ func runEnableAPIGroupVersionsTests(ctx context.Context, client TestClient, grou
fmt.Println(errors.Wrapf(err, "failed to delete crd %q", crdName))
}
}(fmt.Sprintf("rockband%ds.music.example.io.%d", i, i))
}
time.Sleep(6 * time.Minute)
@@ -328,7 +327,6 @@ func runEnableAPIGroupVersionsTests(ctx context.Context, client TestClient, grou
)
return errors.New(msg)
}
}
}
@@ -465,7 +463,6 @@ func resourceInfo(ctx context.Context, g, v, r string, index int) (map[string]ma
// are found in the haystack argument values.
func containsAll(haystack, needles map[string]string) bool {
for nkey, nval := range needles {
hval, ok := haystack[nkey]
if !ok {
return false
-1
View File
@@ -83,7 +83,6 @@ func (s *StorageClasssChanging) CreateResources() error {
})
By(fmt.Sprintf("Create a deployment in namespace %s", s.VeleroCfg.VeleroNamespace), func() {
pvc, err := CreatePVC(s.Client, s.namespace, s.pvcName, s.srcStorageClass, nil)
Expect(err).To(Succeed())
vols := CreateVolumes(pvc.Name, []string{s.volume})
-1
View File
@@ -321,7 +321,6 @@ func BslDeletionTest(useVolumeSnapshots bool) {
var snapshotCheckPoint SnapshotCheckPoint
snapshotCheckPoint.NamespaceBackedUp = bslDeletionTestNs
By(fmt.Sprintf("Snapshot should not be deleted in cloud object store after deleting bsl %s", backupLocation_1), func() {
snapshotCheckPoint, err = GetSnapshotCheckPoint(*veleroCfg.ClientToInstallVelero, veleroCfg, 1, bslDeletionTestNs, backupName_1, []string{podName_1})
Expect(err).NotTo(HaveOccurred(), "Fail to get Azure CSI snapshot checkpoint")
Expect(SnapshotsShouldBeCreatedInCloud(veleroCfg.CloudProvider,
-1
View File
@@ -101,7 +101,6 @@ func init() {
flag.StringVar(&VeleroCfg.EKSPolicyARN, "eks-policy-arn", "", "EKS plicy ARN for creating AWS IAM service account.")
flag.StringVar(&VeleroCfg.DefaultCLSServiceAccountName, "default-cls-service-account-name", "", "default cluster service account name.")
flag.StringVar(&VeleroCfg.StandbyCLSServiceAccountName, "standby-cls-service-account-name", "", "standby cluster service account name.")
}
// Add label [SkipVanillaZfs]:
-1
View File
@@ -108,7 +108,6 @@ func MigrationTest(useVolumeSnapshots bool, veleroCLI2Version VeleroCLI2Version)
veleroCfg.ClusterToInstallVelero = veleroCfg.DefaultClusterName
})
}
})
When("kibishii is the sample workload", func() {
It("should be successfully backed up and restored to the default BackupStorageLocation", func() {
-1
View File
@@ -55,7 +55,6 @@ func (p *PVBackupFiltering) Init() error {
// annotation will be ignored, so it's only set for opt-out test
if p.annotation == OPT_OUT_ANN {
p.BackupArgs = append(p.BackupArgs, "--default-volumes-to-fs-backup")
}
p.RestoreArgs = []string{
"create", "--namespace", p.VeleroCfg.VeleroNamespace, "restore", p.RestoreName,
@@ -90,7 +90,6 @@ func (e *ExcludeNamespaces) Init() error {
"create", "--namespace", e.VeleroCfg.VeleroNamespace, "restore", e.RestoreName,
"--from-backup", e.BackupName, "--wait",
}
} else {
*e.NSIncluded = append(*e.NSIncluded, *e.nsExcluded...)
e.BackupArgs = []string{
@@ -79,7 +79,6 @@ func (i *IncludeNamespaces) Init() error {
"create", "--namespace", i.VeleroCfg.VeleroNamespace, "restore", i.RestoreName,
"--from-backup", i.BackupName, "--wait",
}
} else {
i.BackupName = "backup-" + i.UUIDgen
i.RestoreName = "restore-" + i.CaseBaseName
@@ -177,7 +177,6 @@ func (r *ResourcePoliciesCase) Verify() error {
}
}
})
}
return nil
}
-1
View File
@@ -200,7 +200,6 @@ func (n *ScheduleBackup) Verify() error {
fmt.Printf("Restored configmap is %v\n", configmap)
Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed to list configmap in namespace: %q\n", ns))
}
})
return nil
}
-2
View File
@@ -123,7 +123,6 @@ func BackupUpgradeRestoreTest(useVolumeSnapshots bool, veleroCLI2Version VeleroC
veleroCfg.GCFrequency = ""
By(fmt.Sprintf("Install the expected old version Velero (%s) for upgrade",
veleroCLI2Version.VeleroVersion), func() {
//Set VeleroImage and RestoreHelperImage to blank
//VeleroImage and RestoreHelperImage should be the default value in originalCli
tmpCfgForOldVeleroInstall := veleroCfg
@@ -230,7 +229,6 @@ func BackupUpgradeRestoreTest(useVolumeSnapshots bool, veleroCLI2Version VeleroC
}
By(fmt.Sprintf("Upgrade Velero by CLI %s", tmpCfg.VeleroCLI), func() {
tmpCfg.GCFrequency = ""
tmpCfg.UseRestic = false
tmpCfg.UseNodeAgent = !useVolumeSnapshots