Skip to content

Commit

Permalink
Update Vault API version constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
czembower committed Jul 24, 2023
1 parent f94405e commit 67323a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vault/resource_pki_secret_backend_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func pkiSecretBackendCertCreate(ctx context.Context, d *schema.ResourceData, met
}

// add UID if supported
if provider.IsAPISupported(meta, provider.VaultVersion111) {
if provider.IsAPISupported(meta, provider.VaultVersion113) {
if userIds, ok := d.GetOk(consts.FieldUserIds); ok {
m := util.ToStringArray(userIds.([]interface{}))
if len(m) > 0 {
Expand Down
6 changes: 3 additions & 3 deletions vault/resource_pki_secret_backend_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func pkiSecretBackendRoleCreate(ctx context.Context, d *schema.ResourceData, met
}
}

if provider.IsAPISupported(meta, provider.VaultVersion111) {
if provider.IsAPISupported(meta, provider.VaultVersion113) {
if allowedUserIds, ok := d.GetOk(consts.FieldAllowedUserIds); ok {
ifcList := allowedUserIds.([]interface{})
list := make([]string, 0, len(ifcList))
Expand Down Expand Up @@ -608,7 +608,7 @@ func pkiSecretBackendRoleRead(_ context.Context, d *schema.ResourceData, meta in
}
}

if provider.IsAPISupported(meta, provider.VaultVersion111) {
if provider.IsAPISupported(meta, provider.VaultVersion113) {
if allowedUserIds, ok := secret.Data[consts.FieldAllowedUserIds]; ok {
d.Set(consts.FieldAllowedUserIds, allowedUserIds)
}
Expand Down Expand Up @@ -667,7 +667,7 @@ func pkiSecretBackendRoleUpdate(ctx context.Context, d *schema.ResourceData, met
}
}

if provider.IsAPISupported(meta, provider.VaultVersion111) {
if provider.IsAPISupported(meta, provider.VaultVersion113) {
if allowedUserIds, ok := d.GetOk(consts.FieldAllowedUserIds); ok {
ifcList := allowedUserIds.([]interface{})
list := make([]string, 0, len(ifcList))
Expand Down
2 changes: 1 addition & 1 deletion vault/resource_pki_secret_backend_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func TestPkiSecretBackendRole_basic(t *testing.T) {
{
SkipFunc: func() (bool, error) {
meta := testProvider.Meta().(*provider.ProviderMeta)
return !meta.IsAPISupported(provider.VaultVersion111), nil
return !meta.IsAPISupported(provider.VaultVersion113), nil
},
Config: testPkiSecretBackendRoleConfig_basic(name, backend, 3600, 7200, `allowed_user_ids = ["test"]`),
Check: resource.TestCheckResourceAttr(resourceName, "allowed_user_ids.0", "test"),
Expand Down

0 comments on commit 67323a8

Please sign in to comment.