diff --git a/go/kubernetes/kind.go b/go/kubernetes/kind.go index 3f8464b..1bc0bb3 100644 --- a/go/kubernetes/kind.go +++ b/go/kubernetes/kind.go @@ -20,6 +20,7 @@ const ( Ingresss NamespaceKind = "ingresses" ResourceQuotas NamespaceKind = "resourcequotas" LimitRanges NamespaceKind = "limitranges" + Secrets NamespaceKind = "secrets" ) const ( @@ -58,6 +59,7 @@ func GetNamespaceKinds() []NamespaceKind { Ingresss, ResourceQuotas, LimitRanges, + Secrets, } } diff --git a/go/kubernetes/structed.go b/go/kubernetes/structed.go index 76300d7..a8b74bf 100644 --- a/go/kubernetes/structed.go +++ b/go/kubernetes/structed.go @@ -34,6 +34,15 @@ func StructedNode(data []byte) (*coreV1.Node, error) { return node, nil } +func StructedSecret(data []byte) (*coreV1.Secret, error) { + secret := &coreV1.Secret{} + err := json.Unmarshal(data, secret) + if err != nil { + return nil, err + } + return secret, nil +} + func StructedRole(data []byte) (*rbacV1.Role, error) { role := &rbacV1.Role{} err := json.Unmarshal(data, role)