Skip to content

Commit

Permalink
chore: pkg imported more than once (#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Jul 12, 2023
1 parent dc06add commit 2d2746a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions internal/dao/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/derailed/k9s/internal/client"
"github.com/rs/zerolog/log"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -134,7 +133,7 @@ func (m *Meta) AllGVRs() client.GVRs {
}

// IsCRD checks if resource represents a CRD
func IsCRD(r v1.APIResource) bool {
func IsCRD(r metav1.APIResource) bool {
for _, c := range r.Categories {
if c == CRD {
return true
Expand Down
7 changes: 3 additions & 4 deletions internal/dao/rs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/derailed/k9s/internal/client"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -23,7 +22,7 @@ type ReplicaSet struct {
}

// Load returns a given instance.
func (r *ReplicaSet) Load(f Factory, path string) (*v1.ReplicaSet, error) {
func (r *ReplicaSet) Load(f Factory, path string) (*appsv1.ReplicaSet, error) {
o, err := f.Get("apps/v1/replicasets", path, true, labels.Everything())
if err != nil {
return nil, err
Expand All @@ -38,7 +37,7 @@ func (r *ReplicaSet) Load(f Factory, path string) (*v1.ReplicaSet, error) {
return &rs, nil
}

func getRSRevision(rs *v1.ReplicaSet) (int64, error) {
func getRSRevision(rs *appsv1.ReplicaSet) (int64, error) {
revision := rs.ObjectMeta.Annotations["deployment.kubernetes.io/revision"]
if rs.Status.Replicas != 0 {
return 0, errors.New("can not rollback current replica")
Expand All @@ -51,7 +50,7 @@ func getRSRevision(rs *v1.ReplicaSet) (int64, error) {
return int64(vers), nil
}

func controllerInfo(rs *v1.ReplicaSet) (string, string, string, error) {
func controllerInfo(rs *appsv1.ReplicaSet) (string, string, string, error) {
for _, ref := range rs.ObjectMeta.OwnerReferences {
if ref.Controller == nil {
continue
Expand Down

0 comments on commit 2d2746a

Please sign in to comment.