Skip to content

Commit

Permalink
fix: upgrade issue with limit_by_labels (#428)
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Murray <darren.murray@lacework.net>
  • Loading branch information
dmurray-lacework authored Dec 7, 2022
1 parent 1e7b662 commit 6c06a3c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lacework/resource_lacework_integration_docker_hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ func resourceLaceworkIntegrationDockerHubRead(d *schema.ResourceData, meta inter
d.Set("limit_num_imgs", response.Data.Data.LimitNumImg)
d.Set("limit_by_tags", response.Data.Data.LimitByTag)
d.Set("limit_by_repositories", response.Data.Data.LimitByRep)
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
if limitByLabelsLength(response.Data.Data.LimitByLabel) != 0 {
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
}

log.Printf("[INFO] Read %s registry type with guid: %v\n", api.DockerhubContainerRegistry.String(), integration.IntgGuid)
return nil
Expand Down
4 changes: 3 additions & 1 deletion lacework/resource_lacework_integration_docker_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ func resourceLaceworkIntegrationDockerV2Read(d *schema.ResourceData, meta interf
d.Set("non_os_package_support", integration.Data.NonOSPackageEval)
d.Set("notifications", integration.Data.RegistryNotifications)
d.Set("limit_by_tags", response.Data.Data.LimitByTag)
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
if limitByLabelsLength(response.Data.Data.LimitByLabel) != 0 {
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
}

log.Printf("[INFO] Read %s registry type with guid: %v\n", api.DockerhubV2ContainerRegistry.String(), integration.IntgGuid)
return nil
Expand Down
4 changes: 3 additions & 1 deletion lacework/resource_lacework_integration_gar.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ func resourceLaceworkIntegrationGarRead(d *schema.ResourceData, meta interface{}
d.Set("limit_num_imgs", response.Data.Data.LimitNumImg)
d.Set("limit_by_tags", response.Data.Data.LimitByTag)
d.Set("limit_by_repositories", response.Data.Data.LimitByRep)
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
if limitByLabelsLength(response.Data.Data.LimitByLabel) != 0 {
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
}

log.Printf("[INFO] Read ContVulnCfg integration for %s registry type with guid %s\n",
api.GcpGarContainerRegistry.String(), response.Data.IntgGuid)
Expand Down
4 changes: 3 additions & 1 deletion lacework/resource_lacework_integration_gcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func resourceLaceworkIntegrationGcrRead(d *schema.ResourceData, meta interface{}
d.Set("non_os_package_support", integration.Data.NonOSPackageEval)
d.Set("limit_by_tags", response.Data.Data.LimitByTag)
d.Set("limit_by_repositories", response.Data.Data.LimitByRep)
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
if limitByLabelsLength(response.Data.Data.LimitByLabel) != 0 {
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
}

log.Printf("[INFO] Read %s registry type with guid: %v\n", api.GcpGcrContainerRegistry.String(), integration.IntgGuid)
return nil
Expand Down
4 changes: 3 additions & 1 deletion lacework/resource_lacework_integration_ghcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ func resourceLaceworkIntegrationGhcrRead(d *schema.ResourceData, meta interface{
d.Set("limit_num_imgs", response.Data.Data.LimitNumImg)
d.Set("limit_by_tags", response.Data.Data.LimitByTag)
d.Set("limit_by_repositories", response.Data.Data.LimitByRep)
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
if limitByLabelsLength(response.Data.Data.LimitByLabel) != 0 {
d.Set("limit_by_label", castArrayOfStringKeyMapOfStringsToLimitByLabelSet(response.Data.Data.LimitByLabel))
}

log.Printf("[INFO] Read ContVulnCfg integration for %s registry type with guid %s\n",
api.GhcrContainerRegistry.String(), response.Data.IntgGuid)
Expand Down

0 comments on commit 6c06a3c

Please sign in to comment.