chore: define common aliases for k8s packages (#8672)
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m48s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 35s
Close stale issues and PRs / stale (push) Successful in 8s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m11s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 47s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 49s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 43s

* lchore: define common alias for k8s packages

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update .golangci.yaml

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update .golangci.yaml

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update .golangci.yaml

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2025-04-22 12:14:47 +02:00
committed by GitHub
parent f0fde6e1d4
commit c6a420bd3a
139 changed files with 1968 additions and 1954 deletions

View File

@@ -25,7 +25,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
. "github.com/vmware-tanzu/velero/test"
. "github.com/vmware-tanzu/velero/test/e2e/test"
@@ -113,7 +113,7 @@ func (v *BackupVolumeInfo) CreateResources() error {
pvcCount := 4
Expect(pvcCount).To(BeNumerically(">", 3))
var vols []*v1.Volume
var vols []*corev1api.Volume
for i := 0; i <= pvcCount-1; i++ {
pvcName := fmt.Sprintf("volume-info-pvc-%d", i)
pvc, err := CreatePVC(v.Client, createNSName, pvcName, StorageClassName, nil)

View File

@@ -7,7 +7,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
@@ -167,8 +167,8 @@ func (n *NodePort) Restore() error {
func createServiceWithNodeport(ctx context.Context, client TestClient, namespace string,
service string, labels map[string]string, nodePort int32) error {
serviceSpec := &v1.ServiceSpec{
Ports: []v1.ServicePort{
serviceSpec := &corev1api.ServiceSpec{
Ports: []corev1api.ServicePort{
{
Port: 80,
TargetPort: intstr.IntOrString{IntVal: 80},
@@ -176,7 +176,7 @@ func createServiceWithNodeport(ctx context.Context, client TestClient, namespace
},
},
Selector: nil,
Type: v1.ServiceTypeLoadBalancer,
Type: corev1api.ServiceTypeLoadBalancer,
}
return CreateService(ctx, client, namespace, service, labels, serviceSpec)
}

View File

@@ -23,7 +23,7 @@ import (
"time"
"github.com/pkg/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
. "github.com/vmware-tanzu/velero/test/e2e/test"
. "github.com/vmware-tanzu/velero/test/util/k8s"
@@ -61,7 +61,7 @@ func (m *MultiNSBackup) Init() error {
// Currently it's hard to build a large list of namespaces to include and wildcards do not work so instead
// we will exclude all of the namespaces that existed prior to the test from the backup
namespaces, err := m.Client.ClientGo.CoreV1().Namespaces().List(context.Background(), v1.ListOptions{})
namespaces, err := m.Client.ClientGo.CoreV1().Namespaces().List(context.Background(), metav1.ListOptions{})
if err != nil {
return errors.Wrap(err, "Could not retrieve namespaces")
}