Skip to content

Commit

Permalink
Merge pull request #125 from yossig-aquasec/none_agent_run_time
Browse files Browse the repository at this point in the history
Fixing kube-enforcer group creation issue:
  • Loading branch information
semyonmor authored May 22, 2022
2 parents bc6414b + 6c8d565 commit e69af59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HOSTNAME := github.com
NAMESPACE := aquasec
NAME := aquasec
BINARY := terraform-provider-${NAME}
VERSION := 0.8.10
VERSION := 0.8.11
OS_ARCH := $(shell go env GOOS)_$(shell go env GOARCH)

default: build
Expand Down
15 changes: 10 additions & 5 deletions aquasec/resource_enforcer_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,16 @@ func expandEnforcerGroup(d *schema.ResourceData) client.EnforcerGroup {
enforcerType, ok := d.GetOk("type")
if ok {
enforcerGroup.Type = enforcerType.(string)
if enforcerType != "agent" {
enforcerGroup.RuntimeType = "docker"
} else {
runtimeType, ok := d.GetOk("runtime_type")
if ok {
enforcerGroup.RuntimeType = runtimeType.(string)
} else {
enforcerGroup.RuntimeType = "docker"
}
}
}

admissionControl, ok := d.GetOk("admission_control")
Expand Down Expand Up @@ -677,11 +687,6 @@ func expandEnforcerGroup(d *schema.ResourceData) client.EnforcerGroup {
enforcerGroup.RiskExplorerAutoDiscovery = riskExplorerAutoDiscovery.(bool)
}

runtimeType, ok := d.GetOk("runtime_type")
if ok {
enforcerGroup.RuntimeType = runtimeType.(string)
}

syncHostImages, ok := d.GetOk("sync_host_images")
if ok {
enforcerGroup.SyncHostImages = syncHostImages.(bool)
Expand Down

0 comments on commit e69af59

Please sign in to comment.