Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature. disable default snr rules #376

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions api/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11266,12 +11266,21 @@ const docTemplate = `{
},
"github_com_openinfradev_tks-api_pkg_domain.CreatePolicyRequest": {
"type": "object",
"required": [
"enforcementAction",
"policyName"
],
"properties": {
"description": {
"type": "string"
},
"enforcementAction": {
"type": "string",
"enum": [
"deny",
"dryrun",
"warn"
],
"example": "deny"
},
"mandatory": {
Expand Down Expand Up @@ -11333,7 +11342,9 @@ const docTemplate = `{
"type": "object",
"required": [
"kind",
"rego"
"rego",
"severity",
"templateName"
],
"properties": {
"deprecated": {
Expand Down Expand Up @@ -15068,12 +15079,22 @@ const docTemplate = `{
},
"github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyRequest": {
"type": "object",
"required": [
"enforcementAction",
"policyName"
],
"properties": {
"description": {
"type": "string"
},
"enforcementAction": {
"type": "string"
"type": "string",
"enum": [
"deny",
"dryrun",
"warn"
],
"example": "deny"
},
"mandatory": {
"type": "boolean"
Expand Down Expand Up @@ -15110,6 +15131,9 @@ const docTemplate = `{
},
"github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyTemplateRequest": {
"type": "object",
"required": [
"templateName"
],
"properties": {
"deprecated": {
"type": "boolean",
Expand Down Expand Up @@ -15633,7 +15657,9 @@ const docTemplate = `{
"type": "object",
"required": [
"kind",
"rego"
"rego",
"severity",
"templateName"
],
"properties": {
"deprecated": {
Expand Down Expand Up @@ -15987,6 +16013,9 @@ const docTemplate = `{
},
"github_com_openinfradev_tks-api_pkg_domain_admin.UpdatePolicyTemplateRequest": {
"type": "object",
"required": [
"templateName"
],
"properties": {
"deprecated": {
"type": "boolean",
Expand Down
35 changes: 32 additions & 3 deletions api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -11260,12 +11260,21 @@
},
"github_com_openinfradev_tks-api_pkg_domain.CreatePolicyRequest": {
"type": "object",
"required": [
"enforcementAction",
"policyName"
],
"properties": {
"description": {
"type": "string"
},
"enforcementAction": {
"type": "string",
"enum": [
"deny",
"dryrun",
"warn"
],
"example": "deny"
},
"mandatory": {
Expand Down Expand Up @@ -11327,7 +11336,9 @@
"type": "object",
"required": [
"kind",
"rego"
"rego",
"severity",
"templateName"
],
"properties": {
"deprecated": {
Expand Down Expand Up @@ -15062,12 +15073,22 @@
},
"github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyRequest": {
"type": "object",
"required": [
"enforcementAction",
"policyName"
],
"properties": {
"description": {
"type": "string"
},
"enforcementAction": {
"type": "string"
"type": "string",
"enum": [
"deny",
"dryrun",
"warn"
],
"example": "deny"
},
"mandatory": {
"type": "boolean"
Expand Down Expand Up @@ -15104,6 +15125,9 @@
},
"github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyTemplateRequest": {
"type": "object",
"required": [
"templateName"
],
"properties": {
"deprecated": {
"type": "boolean",
Expand Down Expand Up @@ -15627,7 +15651,9 @@
"type": "object",
"required": [
"kind",
"rego"
"rego",
"severity",
"templateName"
],
"properties": {
"deprecated": {
Expand Down Expand Up @@ -15981,6 +16007,9 @@
},
"github_com_openinfradev_tks-api_pkg_domain_admin.UpdatePolicyTemplateRequest": {
"type": "object",
"required": [
"templateName"
],
"properties": {
"deprecated": {
"type": "boolean",
Expand Down
23 changes: 23 additions & 0 deletions api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,10 @@ definitions:
description:
type: string
enforcementAction:
enum:
- deny
- dryrun
- warn
example: deny
type: string
mandatory:
Expand Down Expand Up @@ -993,6 +997,9 @@ definitions:
templateId:
example: d98ef5f1-4a68-4047-a446-2207787ce3ff
type: string
required:
- enforcementAction
- policyName
type: object
github_com_openinfradev_tks-api_pkg_domain.CreatePolicyResponse:
properties:
Expand Down Expand Up @@ -1046,6 +1053,8 @@ definitions:
required:
- kind
- rego
- severity
- templateName
type: object
github_com_openinfradev_tks-api_pkg_domain.CreatePolicyTemplateVersionRequest:
properties:
Expand Down Expand Up @@ -3492,6 +3501,11 @@ definitions:
description:
type: string
enforcementAction:
enum:
- deny
- dryrun
- warn
example: deny
type: string
mandatory:
type: boolean
Expand All @@ -3515,6 +3529,9 @@ definitions:
templateId:
example: d98ef5f1-4a68-4047-a446-2207787ce3ff
type: string
required:
- enforcementAction
- policyName
type: object
github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyTemplateRequest:
properties:
Expand All @@ -3537,6 +3554,8 @@ definitions:
templateName:
example: 필수 Label 검사
type: string
required:
- templateName
type: object
github_com_openinfradev_tks-api_pkg_domain.UpdatePrimaryClusterRequest:
properties:
Expand Down Expand Up @@ -3906,6 +3925,8 @@ definitions:
required:
- kind
- rego
- severity
- templateName
type: object
github_com_openinfradev_tks-api_pkg_domain_admin.CreatePolicyTemplateVersionRequest:
properties:
Expand Down Expand Up @@ -4129,6 +4150,8 @@ definitions:
templateName:
example: 필수 Label 검사
type: string
required:
- templateName
type: object
github_com_openinfradev_tks-api_pkg_httpErrors.RestError:
properties:
Expand Down
18 changes: 11 additions & 7 deletions internal/delivery/http/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,17 @@ func (h *OrganizationHandler) Admin_CreateOrganization(w http.ResponseWriter, r
}
organization.AdminId = &admin.ID

// Default systemNotificationRules 생성
err = h.systemNotificationRuleUsecase.MakeDefaultSystemNotificationRules(r.Context(), organizationId, &organization)
if err != nil {
log.Errorf(r.Context(), "error is :%s(%T)", err.Error(), err)
ErrorJSON(w, r, err)
return
}
/*
0415 팀미팅의 결과, 기본 시스템 알림은 decapod 시스템을 사용한다.

// Default systemNotificationRules 생성
err = h.systemNotificationRuleUsecase.MakeDefaultSystemNotificationRules(r.Context(), organizationId, &organization)
if err != nil {
log.Errorf(r.Context(), "error is :%s(%T)", err.Error(), err)
ErrorJSON(w, r, err)
return
}
*/

var out domain.CreateOrganizationResponse
if err = serializer.Map(r.Context(), organization, &out); err != nil {
Expand Down
Loading