Skip to content
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
1 change: 1 addition & 0 deletions client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func GetConfigSystem(d *schema.ResourceData) models.ConfigBodySystemPost {
AuditLogForwardEndpoint: d.Get("audit_log_forward_endpoint").(string),
SkipAuditLogDatabase: d.Get("skip_audit_log_database").(bool),
BannerMessage: bannerMessage,
NotificationEnable: d.Get("notification_enable").(bool),
}
log.Printf("[DEBUG] %+v\n ", body)
return body
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/config_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resource "harbor_config_system" "main" {
robot_token_expiration = 30
robot_name_prefix = "harbor@"
storage_per_project = 100
notification_enable = true
}
```

Expand All @@ -33,6 +34,7 @@ resource "harbor_config_system" "main" {
- `storage_per_project` (Number) Default quota space per project in GIB. Default is -1 (unlimited).
- `audit_log_forward_endpoint` (String) The endpoint to forward audit logs to.
- `skip_audit_log_database` (Boolean) Whether or not to skip audit log database.
- `notification_enable` (Boolean) Whether or not webhook/notification functionality is enabled globally. When `false`, all project-level webhook policies are silently ignored. Defaults to `true`.
- `banner_message` (Block Set) (see [below for nested schema](#nestedblock--banner_message))

<a id="nestedblock--banner_message"></a>
Expand Down
5 changes: 5 additions & 0 deletions models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type ConfigBodySystemPost struct {
AuditLogForwardEndpoint string `json:"audit_log_forward_endpoint,omitempty"`
SkipAuditLogDatabase bool `json:"skip_audit_log_database"`
BannerMessage string `json:"banner_message"`
NotificationEnable bool `json:"notification_enable"`
}

type ConfigBodyResponse struct {
Expand Down Expand Up @@ -227,6 +228,10 @@ type ConfigBodyResponse struct {
Editable bool `json:"editable,omitempty"`
Value string `json:"value,omitempty"`
} `json:"banner_message,omitempty"`
NotificationEnable struct {
Editable bool `json:"editable,omitempty"`
Value bool `json:"value,omitempty"`
} `json:"notification_enable,omitempty"`
}

type BannerMessage struct {
Expand Down
6 changes: 6 additions & 0 deletions provider/resource_config_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func resourceConfigSystem() *schema.Resource {
},
},
},
"notification_enable": {
Type: schema.TypeBool,
Optional: true,
Default: true,
},
},
Create: resourceConfigSystemCreate,
Read: resourceConfigSystemRead,
Expand Down Expand Up @@ -173,6 +178,7 @@ func resourceConfigSystemRead(d *schema.ResourceData, m interface{}) error {
d.Set("storage_per_project", storage)
d.Set("audit_log_forward_endpoint", jsonData.AuditLogForwardEndpoint.Value)
d.Set("skip_audit_log_database", jsonData.SkipAuditLogDatabase.Value)
d.Set("notification_enable", jsonData.NotificationEnable.Value)

d.SetId("configuration/system")
return nil
Expand Down
Loading