From ccc786c06e1951dcee7c1116c70ff5639b2ce7c0 Mon Sep 17 00:00:00 2001 From: zionwu Date: Sun, 11 Feb 2018 23:06:45 +0800 Subject: [PATCH] add project to managerment context as helm controller is using it --- config/context.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/config/context.go b/config/context.go index 0242e8c1..affb65c5 100644 --- a/config/context.go +++ b/config/context.go @@ -48,10 +48,10 @@ type ManagementContext struct { Schemas *types.Schemas Scheme *runtime.Scheme AccessControl types.AccessControl - - Management managementv3.Interface - RBAC rbacv1.Interface - Core corev1.Interface + Project projectv3.Interface + Management managementv3.Interface + RBAC rbacv1.Interface + Core corev1.Interface } func (c *ManagementContext) controllers() []controller.Starter { @@ -59,6 +59,7 @@ func (c *ManagementContext) controllers() []controller.Starter { c.Management, c.RBAC, c.Core, + c.Project, } } @@ -153,6 +154,10 @@ func NewManagementContext(config rest.Config) (*ManagementContext, error) { if err != nil { return nil, err } + context.Project, err = projectv3.NewForConfig(config) + if err != nil { + return nil, err + } dynamicConfig := config if dynamicConfig.NegotiatedSerializer == nil {