Files
weave-scope/probe/kubernetes/namespace.go
Roberto Bruggemann 710d665c41 Upgrade k8s.io/client-go to kubernetes-1.9.1
Upgraded from 99c19923, branch release-3.0.

This required fetching or upgrading the following:
* k8s.io/api to kubernetes-1.9.1
* k8s.io/apimachinery to kubernetes-1.9.1
* github.com/juju/ratelimit to 1.0.1
* github.com/spf13/pflag to 4c012f6d

Also, update Scope's imports/function calls to be compatible with the new client.
2018-01-30 10:14:42 +00:00

29 lines
588 B
Go

package kubernetes
import (
"github.com/weaveworks/scope/report"
apiv1 "k8s.io/api/core/v1"
)
// NamespaceResource represents a Kubernetes namespace
// `Namespace` is already taken in meta.go
type NamespaceResource interface {
Meta
GetNode() report.Node
}
type namespace struct {
ns *apiv1.Namespace
Meta
}
// NewNamespace creates a new Namespace
func NewNamespace(ns *apiv1.Namespace) NamespaceResource {
return &namespace{ns: ns, Meta: namespaceMeta{ns.ObjectMeta}}
}
func (ns *namespace) GetNode() report.Node {
return ns.MetaNode(report.MakeNamespaceNodeID(ns.UID()))
}