Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support default_extensions_template in SSH #2361

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

radek-sprta
Copy link

Description

Support the default_extensions_template parameter in SSH backend role resource.

Relates OR Closes #0000

Checklist

  • Added CHANGELOG entry (only for user-facing changes)
  • Acceptance tests where run against all supported Vault Versions

Output from acceptance testing:

$ make testacc TESTARGS='--run SSHSecretBackendRole'
...
=== RUN   TestAccSSHSecretBackendRole_extensionsTemplate
--- PASS: TestAccSSHSecretBackendRole_extensionsTemplate (4.19s)

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Copy link
Contributor

@fairclothjm fairclothjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @radek-sprta ! I left some comments

@@ -243,6 +248,12 @@ func sshSecretBackendRoleWrite(d *schema.ResourceData, meta interface{}) error {
data["default_extensions"] = v
}

if provider.IsAPISupported(meta, provider.VaultVersion180) {
if v, ok := d.GetOk("default_extensions_template"); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use d.Get() for booleans. If you test the update path I think you may find that d.GetOk() does not update the field.

Comment on lines +38 to +39
VaultVersion180 = version.Must(version.NewSemver(consts.VaultVersion110))
VaultVersion190 = version.Must(version.NewSemver(consts.VaultVersion190))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are unsupported Vault versions. We need not add checks for them

@@ -243,6 +248,12 @@ func sshSecretBackendRoleWrite(d *schema.ResourceData, meta interface{}) error {
data["default_extensions"] = v
}

if provider.IsAPISupported(meta, provider.VaultVersion180) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unsupported Vault version. We need not add a check for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants