refactor: remove StateDeleted from map keys

since it is a map value, not a key.
This commit is contained in:
Matthias Radestock
2018-04-02 09:49:06 +01:00
parent 3090cdcfe5
commit 27fb3571e1
3 changed files with 4 additions and 4 deletions

View File

@@ -13,10 +13,11 @@ const (
State = report.KubernetesState
IsInHostNetwork = report.KubernetesIsInHostNetwork
RestartCount = report.KubernetesRestartCount
StateDeleted = "deleted"
)
// Pod states we handle specially
const StateDeleted = "deleted"
// Pod represents a Kubernetes pod
type Pod interface {
Meta

View File

@@ -69,7 +69,6 @@ const (
KubernetesSuspended = "kubernetes_suspended"
KubernetesLastScheduled = "kubernetes_last_scheduled"
KubernetesActiveJobs = "kubernetes_active_jobs"
KubernetesStateDeleted = "deleted"
KubernetesType = "kubernetes_type"
KubernetesPorts = "kubernetes_ports"
// probe/awsecs

View File

@@ -454,7 +454,7 @@ func (r Report) upgradeNamespaces() Report {
namespaces := map[string]struct{}{}
for _, t := range []Topology{r.Pod, r.Service, r.Deployment, r.DaemonSet, r.StatefulSet, r.CronJob} {
for _, n := range t.Nodes {
if state, ok := n.Latest.Lookup(KubernetesState); ok && state == KubernetesStateDeleted {
if state, ok := n.Latest.Lookup(KubernetesState); ok && state == "deleted" {
continue
}
if namespace, ok := n.Latest.Lookup(KubernetesNamespace); ok {