Skip to content

Commit

Permalink
chore: Remove usages of k8s.io/kubernetes (#4055) (#5434)
Browse files Browse the repository at this point in the history
* chore:Remove usages of k8s.io/kubernetes

Signed-off-by: Mark Pim <j.mark.pim@gmail.com>

* Linting fix

Signed-off-by: Mark Pim <j.mark.pim@gmail.com>
  • Loading branch information
jMarkP authored Feb 10, 2021
1 parent 137ff39 commit c540b71
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
10 changes: 7 additions & 3 deletions controller/cache/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
resourcehelper "k8s.io/kubernetes/pkg/api/v1/resource"
k8snode "k8s.io/kubernetes/pkg/util/node"
resourcehelper "k8s.io/kubectl/pkg/util/resource"

"github.com/argoproj/argo-cd/common"
"github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
Expand Down Expand Up @@ -309,7 +308,12 @@ func populatePodInfo(un *unstructured.Unstructured, res *ResourceInfo) {
}
}

if pod.DeletionTimestamp != nil && pod.Status.Reason == k8snode.NodeUnreachablePodReason {
// "NodeLost" = https://github.com/kubernetes/kubernetes/blob/cb8ad64243d48d9a3c26b11b2e0945c098457282/pkg/util/node/node.go#L46
// But depending on the k8s.io/kubernetes package just for a constant
// is not worth it.
// See https://github.com/argoproj/argo-cd/issues/5173
// and https://github.com/kubernetes/kubernetes/issues/90358#issuecomment-617859364
if pod.DeletionTimestamp != nil && pod.Status.Reason == "NodeLost" {
reason = "Unknown"
} else if pod.DeletionTimestamp != nil {
reason = "Terminating"
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ require (
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
k8s.io/kubectl v0.20.1
k8s.io/kubernetes v1.20.1
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
layeh.com/gopher-json v0.0.0-20190114024228-97fed8db8427
sigs.k8s.io/yaml v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion server/account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"k8s.io/kubernetes/pkg/util/slice"
"k8s.io/kubectl/pkg/util/slice"

"github.com/argoproj/argo-cd/common"
"github.com/argoproj/argo-cd/pkg/apiclient/account"
Expand Down

0 comments on commit c540b71

Please sign in to comment.