fix group in create clusterrolebinding

This commit is contained in:
xilabao
2016-12-20 11:12:22 +08:00
parent f87edaacac
commit 6b19a711ec
2 changed files with 12 additions and 0 deletions

View File

@@ -123,6 +123,13 @@ func (s ClusterRoleBindingGeneratorV1) StructuredGenerate() (runtime.Object, err
Name: user,
})
}
for _, group := range s.Groups {
clusterRoleBinding.Subjects = append(clusterRoleBinding.Subjects, rbac.Subject{
Kind: rbac.GroupKind,
APIVersion: "rbac/v1alpha1",
Name: group,
})
}
for _, sa := range s.ServiceAccounts {
tokens := strings.Split(sa, ":")
if len(tokens) != 2 {