fix: data error

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2018-12-06 17:14:15 +08:00
parent e40833c2a7
commit 7b1cbabb4f
7 changed files with 93 additions and 29 deletions

View File

@@ -280,7 +280,13 @@ func Namespaces(workspaceName string) ([]*core.Namespace, error) {
return make([]*core.Namespace, 0), nil
}
return namespaces, nil
out := make([]*core.Namespace, len(namespaces))
for i, v := range namespaces {
out[i] = v.DeepCopy()
}
return out, nil
}
func BindingDevopsProject(workspace string, devops string) error {
@@ -841,6 +847,8 @@ func Roles(workspace *Workspace) ([]*v1.ClusterRole, error) {
return nil, err
}
clusterRole = clusterRole.DeepCopy()
clusterRole.Name = name
roles = append(roles, clusterRole)
}