1. change glog to klog

2. move types to api package to avoid cyclic import
This commit is contained in:
Jeff
2019-09-16 12:46:53 +08:00
committed by zryfish
parent 79735c4543
commit 97c9a1786a
109 changed files with 1076 additions and 552 deletions

View File

@@ -14,11 +14,12 @@ limitations under the License.
package devops
import (
"kubesphere.io/kubesphere/pkg/api/devops/v1alpha2"
"kubesphere.io/kubesphere/pkg/utils/idutils"
"time"
)
var DevOpsProjectColumns = GetColumnsFromStruct(&DevOpsProject{})
var DevOpsProjectColumns = GetColumnsFromStruct(&v1alpha2.DevOpsProject{})
const (
DevOpsProjectTableName = "project"
@@ -31,33 +32,8 @@ const (
DevOpsProjectCreateTimeColumn = "project.create_time"
)
type PageableDevOpsProject struct {
Items []*DevOpsProject `json:"items"`
TotalCount int `json:"total_count"`
}
type DevOpsProject struct {
ProjectId string `json:"project_id" db:"project_id" description:"ProjectId must be unique within a workspace, it is generated by kubesphere."`
Name string `json:"name" description:"DevOps Projects's Name"`
Description string `json:"description,omitempty" description:"DevOps Projects's Description, used to describe the DevOps Project"`
Creator string `json:"creator" description:"Creator's username"`
CreateTime time.Time `json:"create_time" description:"DevOps Project's Creation time"`
Status string `json:"status" description:"DevOps project's status. e.g. active"`
Visibility string `json:"visibility,omitempty" description:"Deprecated Field"`
Extra string `json:"extra,omitempty" description:"Internal Use"`
Workspace string `json:"workspace" description:"The workspace to which the devops project belongs"`
}
func NewDevOpsProject(name, description, creator, extra, workspace string) *DevOpsProject {
return &DevOpsProject{
func NewDevOpsProject(name, description, creator, extra, workspace string) *v1alpha2.DevOpsProject {
return &v1alpha2.DevOpsProject{
ProjectId: idutils.GetUuid(DevOpsProjectPrefix),
Name: name,
Description: description,