Skip to content

Commit

Permalink
Merge pull request #300 from sangkenlee/policy-k8s
Browse files Browse the repository at this point in the history
정책 관리 기본 기능 구현
  • Loading branch information
ktkfree authored Mar 27, 2024
2 parents 6277b59 + 89351b0 commit e230fe3
Show file tree
Hide file tree
Showing 20 changed files with 3,485 additions and 184 deletions.
775 changes: 763 additions & 12 deletions api/swagger/docs.go

Large diffs are not rendered by default.

774 changes: 762 additions & 12 deletions api/swagger/swagger.json

Large diffs are not rendered by default.

472 changes: 471 additions & 1 deletion api/swagger/swagger.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions internal/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ func migrateSchema(db *gorm.DB) error {
return err
}

if err := db.AutoMigrate(&model.Policy{}); err != nil {
return err
}

if err := db.AutoMigrate(&model.Dashboard{}); err != nil {
return err
}
Expand Down
26 changes: 13 additions & 13 deletions internal/delivery/api/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,19 @@ const (
Admin_GetProjects

// PolicyTemplate
ListPolicyTemplate
CreatePolicyTemplate
DeletePolicyTemplate
GetPolicyTemplate
UpdatePolicyTemplate
GetPolicyTemplateDeploy
ListPolicyTemplateStatistics
ListPolicyTemplateVersions
CreatePolicyTemplateVersion
DeletePolicyTemplateVersion
GetPolicyTemplateVersion
ExistsPolicyTemplateKind
ExistsPolicyTemplateName
Admin_ListPolicyTemplate
Admin_CreatePolicyTemplate
Admin_DeletePolicyTemplate
Admin_GetPolicyTemplate
Admin_UpdatePolicyTemplate
Admin_GetPolicyTemplateDeploy
Admin_ListPolicyTemplateStatistics
Admin_ListPolicyTemplateVersions
Admin_CreatePolicyTemplateVersion
Admin_DeletePolicyTemplateVersion
Admin_GetPolicyTemplateVersion
Admin_ExistsPolicyTemplateKind
Admin_ExistsPolicyTemplateName

// ClusterPolicyStatus
ListClusterPolicyStatus
Expand Down
156 changes: 78 additions & 78 deletions internal/delivery/api/generated_endpoints.go.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,56 +635,56 @@ var ApiMap = map[Endpoint]EndpointInfo{
Name: "Admin_GetProjects",
Group: "Admin Project",
},
ListPolicyTemplate: {
Name: "ListPolicyTemplate",
Admin_ListPolicyTemplate: {
Name: "Admin_ListPolicyTemplate",
Group: "PolicyTemplate",
},
CreatePolicyTemplate: {
Name: "CreatePolicyTemplate",
Admin_CreatePolicyTemplate: {
Name: "Admin_CreatePolicyTemplate",
Group: "PolicyTemplate",
},
DeletePolicyTemplate: {
Name: "DeletePolicyTemplate",
Admin_DeletePolicyTemplate: {
Name: "Admin_DeletePolicyTemplate",
Group: "PolicyTemplate",
},
GetPolicyTemplate: {
Name: "GetPolicyTemplate",
Admin_GetPolicyTemplate: {
Name: "Admin_GetPolicyTemplate",
Group: "PolicyTemplate",
},
UpdatePolicyTemplate: {
Name: "UpdatePolicyTemplate",
Admin_UpdatePolicyTemplate: {
Name: "Admin_UpdatePolicyTemplate",
Group: "PolicyTemplate",
},
GetPolicyTemplateDeploy: {
Name: "GetPolicyTemplateDeploy",
Admin_GetPolicyTemplateDeploy: {
Name: "Admin_GetPolicyTemplateDeploy",
Group: "PolicyTemplate",
},
ListPolicyTemplateStatistics: {
Name: "ListPolicyTemplateStatistics",
Admin_ListPolicyTemplateStatistics: {
Name: "Admin_ListPolicyTemplateStatistics",
Group: "PolicyTemplate",
},
ListPolicyTemplateVersions: {
Name: "ListPolicyTemplateVersions",
Admin_ListPolicyTemplateVersions: {
Name: "Admin_ListPolicyTemplateVersions",
Group: "PolicyTemplate",
},
CreatePolicyTemplateVersion: {
Name: "CreatePolicyTemplateVersion",
Admin_CreatePolicyTemplateVersion: {
Name: "Admin_CreatePolicyTemplateVersion",
Group: "PolicyTemplate",
},
DeletePolicyTemplateVersion: {
Name: "DeletePolicyTemplateVersion",
Admin_DeletePolicyTemplateVersion: {
Name: "Admin_DeletePolicyTemplateVersion",
Group: "PolicyTemplate",
},
GetPolicyTemplateVersion: {
Name: "GetPolicyTemplateVersion",
Admin_GetPolicyTemplateVersion: {
Name: "Admin_GetPolicyTemplateVersion",
Group: "PolicyTemplate",
},
ExistsPolicyTemplateKind: {
Name: "ExistsPolicyTemplateKind",
Admin_ExistsPolicyTemplateKind: {
Name: "Admin_ExistsPolicyTemplateKind",
Group: "PolicyTemplate",
},
ExistsPolicyTemplateName: {
Name: "ExistsPolicyTemplateName",
Admin_ExistsPolicyTemplateName: {
Name: "Admin_ExistsPolicyTemplateName",
Group: "PolicyTemplate",
},
ListClusterPolicyStatus: {
Expand Down Expand Up @@ -1126,32 +1126,32 @@ func (e Endpoint) String() string {
return "Admin_GetTksRole"
case Admin_GetProjects:
return "Admin_GetProjects"
case ListPolicyTemplate:
return "ListPolicyTemplate"
case CreatePolicyTemplate:
return "CreatePolicyTemplate"
case DeletePolicyTemplate:
return "DeletePolicyTemplate"
case GetPolicyTemplate:
return "GetPolicyTemplate"
case UpdatePolicyTemplate:
return "UpdatePolicyTemplate"
case GetPolicyTemplateDeploy:
return "GetPolicyTemplateDeploy"
case ListPolicyTemplateStatistics:
return "ListPolicyTemplateStatistics"
case ListPolicyTemplateVersions:
return "ListPolicyTemplateVersions"
case CreatePolicyTemplateVersion:
return "CreatePolicyTemplateVersion"
case DeletePolicyTemplateVersion:
return "DeletePolicyTemplateVersion"
case GetPolicyTemplateVersion:
return "GetPolicyTemplateVersion"
case ExistsPolicyTemplateKind:
return "ExistsPolicyTemplateKind"
case ExistsPolicyTemplateName:
return "ExistsPolicyTemplateName"
case Admin_ListPolicyTemplate:
return "Admin_ListPolicyTemplate"
case Admin_CreatePolicyTemplate:
return "Admin_CreatePolicyTemplate"
case Admin_DeletePolicyTemplate:
return "Admin_DeletePolicyTemplate"
case Admin_GetPolicyTemplate:
return "Admin_GetPolicyTemplate"
case Admin_UpdatePolicyTemplate:
return "Admin_UpdatePolicyTemplate"
case Admin_GetPolicyTemplateDeploy:
return "Admin_GetPolicyTemplateDeploy"
case Admin_ListPolicyTemplateStatistics:
return "Admin_ListPolicyTemplateStatistics"
case Admin_ListPolicyTemplateVersions:
return "Admin_ListPolicyTemplateVersions"
case Admin_CreatePolicyTemplateVersion:
return "Admin_CreatePolicyTemplateVersion"
case Admin_DeletePolicyTemplateVersion:
return "Admin_DeletePolicyTemplateVersion"
case Admin_GetPolicyTemplateVersion:
return "Admin_GetPolicyTemplateVersion"
case Admin_ExistsPolicyTemplateKind:
return "Admin_ExistsPolicyTemplateKind"
case Admin_ExistsPolicyTemplateName:
return "Admin_ExistsPolicyTemplateName"
case ListClusterPolicyStatus:
return "ListClusterPolicyStatus"
case GetClusterPolicyTemplateStatus:
Expand Down Expand Up @@ -1534,32 +1534,32 @@ func GetEndpoint(name string) Endpoint {
return Admin_GetTksRole
case "Admin_GetProjects":
return Admin_GetProjects
case "ListPolicyTemplate":
return ListPolicyTemplate
case "CreatePolicyTemplate":
return CreatePolicyTemplate
case "DeletePolicyTemplate":
return DeletePolicyTemplate
case "GetPolicyTemplate":
return GetPolicyTemplate
case "UpdatePolicyTemplate":
return UpdatePolicyTemplate
case "GetPolicyTemplateDeploy":
return GetPolicyTemplateDeploy
case "ListPolicyTemplateStatistics":
return ListPolicyTemplateStatistics
case "ListPolicyTemplateVersions":
return ListPolicyTemplateVersions
case "CreatePolicyTemplateVersion":
return CreatePolicyTemplateVersion
case "DeletePolicyTemplateVersion":
return DeletePolicyTemplateVersion
case "GetPolicyTemplateVersion":
return GetPolicyTemplateVersion
case "ExistsPolicyTemplateKind":
return ExistsPolicyTemplateKind
case "ExistsPolicyTemplateName":
return ExistsPolicyTemplateName
case "Admin_ListPolicyTemplate":
return Admin_ListPolicyTemplate
case "Admin_CreatePolicyTemplate":
return Admin_CreatePolicyTemplate
case "Admin_DeletePolicyTemplate":
return Admin_DeletePolicyTemplate
case "Admin_GetPolicyTemplate":
return Admin_GetPolicyTemplate
case "Admin_UpdatePolicyTemplate":
return Admin_UpdatePolicyTemplate
case "Admin_GetPolicyTemplateDeploy":
return Admin_GetPolicyTemplateDeploy
case "Admin_ListPolicyTemplateStatistics":
return Admin_ListPolicyTemplateStatistics
case "Admin_ListPolicyTemplateVersions":
return Admin_ListPolicyTemplateVersions
case "Admin_CreatePolicyTemplateVersion":
return Admin_CreatePolicyTemplateVersion
case "Admin_DeletePolicyTemplateVersion":
return Admin_DeletePolicyTemplateVersion
case "Admin_GetPolicyTemplateVersion":
return Admin_GetPolicyTemplateVersion
case "Admin_ExistsPolicyTemplateKind":
return Admin_ExistsPolicyTemplateKind
case "Admin_ExistsPolicyTemplateName":
return Admin_ExistsPolicyTemplateName
case "ListClusterPolicyStatus":
return ListClusterPolicyStatus
case "GetClusterPolicyTemplateStatus":
Expand Down
Loading

0 comments on commit e230fe3

Please sign in to comment.