Skip to content

Commit f8bed5a

Browse files
author
Adi Shaull
committed
SLK-66308 - Add update default_prefix
1 parent 4019a68 commit f8bed5a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aquasec/resource_registry.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,12 @@ func resourceRegistryUpdate(d *schema.ResourceData, m interface{}) error {
434434
if d.HasChanges("name", "registry_scan_timeout", "username", "description", "pull_image_tag_pattern", "password", "url", "type", "auto_pull", "auto_pull_rescan", "auto_pull_max", "advanced_settings_cleanup", "auto_pull_time", "auto_pull_interval", "auto_cleanup", "image_creation_date_condition", "scanner_name", "prefixes", "pull_image_count", "pull_image_age", "options", "webhook", "always_pull_patterns", "pull_repo_patterns_excluded") {
435435

436436
prefixes := d.Get("prefixes").([]interface{})
437+
var defaultPrefix string
437438
// Add default_prefix to prefixes
438439
r, _ := c.GetRegistry(d.Id())
439440
if r.DefaultPrefix != "" {
440441
prefixes = append(prefixes, r.DefaultPrefix)
442+
defaultPrefix = r.DefaultPrefix
441443
}
442444
always_pull_patterns := d.Get("always_pull_patterns").([]interface{})
443445
pull_repo_patterns_excluded := d.Get("pull_repo_patterns_excluded").([]interface{})
@@ -474,6 +476,7 @@ func resourceRegistryUpdate(d *schema.ResourceData, m interface{}) error {
474476
ScannerNameRemoved: convertStringArr(scanner_name_removed),
475477
ExistingScanners: convertStringArr(existsing_scanners),
476478
Prefixes: convertStringArr(prefixes),
479+
DefaultPrefix: defaultPrefix,
477480
AlwaysPullPatterns: convertStringArr(always_pull_patterns),
478481
PullRepoPatternsExcluded: convertStringArr(pull_repo_patterns_excluded),
479482
PullImageTagPattern: convertStringArr(pull_image_tag_pattern),

0 commit comments

Comments
 (0)