Skip to content

Commit d78226c

Browse files
Listell McLeanclaude
andcommitted
feat: add notification_enable to harbor_config_system
✨ Add support for notification_enable system configuration 🔧 Expose global webhook/notification feature gate in Terraform 📝 Enable declarative management of notification settings Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 67cfed5 commit d78226c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

client/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func GetConfigSystem(d *schema.ResourceData) models.ConfigBodySystemPost {
3838
AuditLogForwardEndpoint: d.Get("audit_log_forward_endpoint").(string),
3939
SkipAuditLogDatabase: d.Get("skip_audit_log_database").(bool),
4040
BannerMessage: bannerMessage,
41+
NotificationEnable: d.Get("notification_enable").(bool),
4142
}
4243
log.Printf("[DEBUG] %+v\n ", body)
4344
return body

models/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ type ConfigBodySystemPost struct {
5454
AuditLogForwardEndpoint string `json:"audit_log_forward_endpoint,omitempty"`
5555
SkipAuditLogDatabase bool `json:"skip_audit_log_database"`
5656
BannerMessage string `json:"banner_message"`
57+
NotificationEnable bool `json:"notification_enable"`
5758
}
5859

5960
type ConfigBodyResponse struct {
@@ -227,6 +228,10 @@ type ConfigBodyResponse struct {
227228
Editable bool `json:"editable,omitempty"`
228229
Value string `json:"value,omitempty"`
229230
} `json:"banner_message,omitempty"`
231+
NotificationEnable struct {
232+
Editable bool `json:"editable,omitempty"`
233+
Value bool `json:"value,omitempty"`
234+
} `json:"notification_enable,omitempty"`
230235
}
231236

232237
type BannerMessage struct {

provider/resource_config_system.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ func resourceConfigSystem() *schema.Resource {
9797
},
9898
},
9999
},
100+
"notification_enable": {
101+
Type: schema.TypeBool,
102+
Optional: true,
103+
Default: true,
104+
},
100105
},
101106
Create: resourceConfigSystemCreate,
102107
Read: resourceConfigSystemRead,
@@ -173,6 +178,7 @@ func resourceConfigSystemRead(d *schema.ResourceData, m interface{}) error {
173178
d.Set("storage_per_project", storage)
174179
d.Set("audit_log_forward_endpoint", jsonData.AuditLogForwardEndpoint.Value)
175180
d.Set("skip_audit_log_database", jsonData.SkipAuditLogDatabase.Value)
181+
d.Set("notification_enable", jsonData.NotificationEnable.Value)
176182

177183
d.SetId("configuration/system")
178184
return nil

0 commit comments

Comments
 (0)