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 (
"strconv"
"strings"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
snapshotv1api "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
@@ -119,7 +119,7 @@ func DescribeBackup(
}
// DescribeResourcePolicies describes resource policies in human-readable format
func DescribeResourcePolicies(d *Describer, resPolicies *v1.TypedLocalObjectReference) {
func DescribeResourcePolicies(d *Describer, resPolicies *corev1api.TypedLocalObjectReference) {
d.Printf("Resource policies:\n")
d.Printf("\tType:\t%s\n", resPolicies.Kind)
d.Printf("\tName:\t%s\n", resPolicies.Name)

View File

@@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
"github.com/vmware-tanzu/velero/internal/volume"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
@@ -50,7 +50,7 @@ func TestDescribeUploaderConfig(t *testing.T) {
}
func TestDescribeResourcePolicies(t *testing.T) {
input := &v1.TypedLocalObjectReference{
input := &corev1api.TypedLocalObjectReference{
Kind: "configmap",
Name: "test-resource-policy",
}

View File

@@ -23,7 +23,7 @@ import (
"fmt"
"strings"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kbclient "sigs.k8s.io/controller-runtime/pkg/client"
@@ -571,7 +571,7 @@ func DescribeBackupResultsInSF(ctx context.Context, kbClient kbclient.Client, d
}
// DescribeResourcePoliciesInSF describes resource policies in structured format.
func DescribeResourcePoliciesInSF(d *StructuredDescriber, resPolicies *v1.TypedLocalObjectReference) {
func DescribeResourcePoliciesInSF(d *StructuredDescriber, resPolicies *corev1api.TypedLocalObjectReference) {
policiesInfo := make(map[string]any)
policiesInfo["type"] = resPolicies.Kind
policiesInfo["name"] = resPolicies.Name

View File

@@ -23,7 +23,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
"github.com/vmware-tanzu/velero/internal/volume"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
@@ -523,7 +523,7 @@ func TestDescribeCSISnapshotsInSF(t *testing.T) {
}
func TestDescribeResourcePoliciesInSF(t *testing.T) {
input := &v1.TypedLocalObjectReference{
input := &corev1api.TypedLocalObjectReference{
Kind: "configmap",
Name: "resource-policy-1",
}

View File

@@ -27,7 +27,7 @@ import (
"github.com/vmware-tanzu/velero/internal/volume"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kbclient "sigs.k8s.io/controller-runtime/pkg/client"
@@ -488,7 +488,7 @@ func describeRestoreResourceList(ctx context.Context, kbClient kbclient.Client,
}
// DescribeResourceModifier describes resource policies in human-readable format
func DescribeResourceModifier(d *Describer, resModifier *v1.TypedLocalObjectReference) {
func DescribeResourceModifier(d *Describer, resModifier *corev1api.TypedLocalObjectReference) {
d.Printf("Resource modifier:\n")
d.Printf("\tType:\t%s\n", resModifier.Kind)
d.Printf("\tName:\t%s\n", resModifier.Name)

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
corev1api "k8s.io/api/core/v1"
"github.com/vmware-tanzu/velero/internal/volume"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
@@ -400,8 +400,8 @@ func TestDescribeResourceModifier(t *testing.T) {
d.out.Init(d.buf, 0, 8, 2, ' ', 0)
DescribeResourceModifier(d, &v1.TypedLocalObjectReference{
APIGroup: &v1.SchemeGroupVersion.Group,
DescribeResourceModifier(d, &corev1api.TypedLocalObjectReference{
APIGroup: &corev1api.SchemeGroupVersion.Group,
Kind: "ConfigMap",
Name: "resourceModifier",
})