Skip to content

Commit

Permalink
improve appsv1 package import statement (istio#42946)
Browse files Browse the repository at this point in the history
Signed-off-by: xin.li <xin.li@daocloud.io>

Signed-off-by: xin.li <xin.li@daocloud.io>
  • Loading branch information
my-git9 authored Jan 23, 2023
1 parent ef56f95 commit f9d4287
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/test/util/yml/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"reflect"

v1 "k8s.io/api/apps/v1"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"sigs.k8s.io/yaml"

Expand All @@ -45,7 +45,7 @@ func ApplyNamespace(yamlText, ns string) (string, error) {

// ApplyPullSecrets applies the given pullsecret to the deployment resource
func ApplyPullSecret(deploymentYaml string, pullSecret string) (string, error) {
var deploymentMerge v1.Deployment
var deploymentMerge appsv1.Deployment

mainYaml, err := yaml.YAMLToJSON([]byte(deploymentYaml))
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/pilot/cni_race_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"
"time"

v1 "k8s.io/api/apps/v1"
appsv1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

istioKube "istio.io/istio/pkg/kube"
Expand Down Expand Up @@ -85,7 +85,7 @@ func TestCNIRaceRepair(t *testing.T) {
})
}

func getCNIDaemonSet(ctx framework.TestContext, c cluster.Cluster) *v1.DaemonSet {
func getCNIDaemonSet(ctx framework.TestContext, c cluster.Cluster) *appsv1.DaemonSet {
cniDaemonSet, err := c.(istioKube.CLIClient).
Kube().AppsV1().DaemonSets("kube-system").
Get(context.Background(), "istio-cni-node", metav1.GetOptions{})
Expand Down Expand Up @@ -119,8 +119,8 @@ func deleteCNIDaemonset(ctx framework.TestContext, c cluster.Cluster) {
}, retry.Delay(1*time.Second), retry.Timeout(80*time.Second))
}

func deployCNIDaemonset(ctx framework.TestContext, c cluster.Cluster, cniDaemonSet *v1.DaemonSet) {
deployDaemonSet := v1.DaemonSet{}
func deployCNIDaemonset(ctx framework.TestContext, c cluster.Cluster, cniDaemonSet *appsv1.DaemonSet) {
deployDaemonSet := appsv1.DaemonSet{}
deployDaemonSet.Spec = cniDaemonSet.Spec
deployDaemonSet.ObjectMeta = metav1.ObjectMeta{
Name: cniDaemonSet.ObjectMeta.Name,
Expand Down
4 changes: 2 additions & 2 deletions tools/bug-report/pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"regexp"
"strings"

v1 "k8s.io/api/apps/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -303,7 +303,7 @@ func PodKey(namespace, pod string) string {
return path.Path{namespace, pod}.String()
}

func getOwnerDeployment(pod *corev1.Pod, replicasets []v1.ReplicaSet) string {
func getOwnerDeployment(pod *corev1.Pod, replicasets []appsv1.ReplicaSet) string {
for _, o := range pod.OwnerReferences {
if o.Kind == "ReplicaSet" {
for _, rs := range replicasets {
Expand Down

0 comments on commit f9d4287

Please sign in to comment.