Skip to content

Commit 83747c6

Browse files
committed
utils.Pointer
1 parent cbf9e44 commit 83747c6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

internal/elasticsearch/security/api_key_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/elastic/terraform-provider-elasticstack/internal/clients/elasticsearch"
1616
"github.com/elastic/terraform-provider-elasticstack/internal/elasticsearch/security"
1717
"github.com/elastic/terraform-provider-elasticstack/internal/models"
18+
"github.com/elastic/terraform-provider-elasticstack/internal/utils"
1819
"github.com/elastic/terraform-provider-elasticstack/internal/versionutils"
1920
sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
2021
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -41,21 +42,19 @@ func TestAccResourceSecurityApiKey(t *testing.T) {
4142
return err
4243
}
4344

44-
allowRestrictedIndicesF := false
45-
allowRestrictedIndicesT := true
4645
expectedRoleDescriptor := map[string]models.ApiKeyRoleDescriptor{
4746
"role-a": {
4847
Cluster: []string{"all"},
4948
Indices: []models.IndexPerms{{
5049
Names: []string{"index-a*"},
5150
Privileges: []string{"read"},
52-
AllowRestrictedIndices: &allowRestrictedIndicesF,
51+
AllowRestrictedIndices: utils.Pointer(false),
5352
}},
5453
RemoteIndices: []models.RemoteIndexPerms{{
5554
Clusters: []string{"*"},
5655
Names: []string{"index-a*"},
5756
Privileges: []string{"read"},
58-
AllowRestrictedIndices: &allowRestrictedIndicesT,
57+
AllowRestrictedIndices: utils.Pointer(true),
5958
}},
6059
},
6160
}
@@ -204,8 +203,8 @@ resource "elasticstack_elasticsearch_security_api_key" "test" {
204203
privileges = ["read"]
205204
allow_restricted_indices = false
206205
}],
207-
restriction = {
208-
workflows = [ "search_application_query"]
206+
restriction = {
207+
workflows = [ "search_application_query"]
209208
}
210209
}
211210
})

0 commit comments

Comments
 (0)