mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-16 06:07:41 +00:00
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.
29 lines
588 B
Go
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()))
|
|
}
|