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

Additional changes like those in #1305/#1479 #1583

Merged
merged 1 commit into from
Aug 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions vault/resource_azure_auth_backend_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func azureAuthBackendConfigResource() *schema.Resource {
}

func azureAuthBackendWrite(d *schema.ResourceData, meta interface{}) error {
config := meta.(*provider.ProviderMeta).GetClient()
config, e := provider.GetClient(d, meta)
if e != nil {
return e
}

// if backend comes from the config, it won't have the StateFunc
// applied yet, so we need to apply it again.
Expand Down Expand Up @@ -100,8 +103,10 @@ func azureAuthBackendWrite(d *schema.ResourceData, meta interface{}) error {
}

func azureAuthBackendRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*provider.ProviderMeta).GetClient()

config, e := provider.GetClient(d, meta)
if e != nil {
return e
}
log.Printf("[DEBUG] Reading Azure auth backend config")
secret, err := config.Logical().Read(d.Id())
if err != nil {
Expand Down Expand Up @@ -130,8 +135,10 @@ func azureAuthBackendRead(d *schema.ResourceData, meta interface{}) error {
}

func azureAuthBackendDelete(d *schema.ResourceData, meta interface{}) error {
config := meta.(*provider.ProviderMeta).GetClient()

config, e := provider.GetClient(d, meta)
if e != nil {
return e
}
log.Printf("[DEBUG] Deleting Azure auth backend config from %q", d.Id())
_, err := config.Logical().Delete(d.Id())
if err != nil {
Expand All @@ -143,8 +150,10 @@ func azureAuthBackendDelete(d *schema.ResourceData, meta interface{}) error {
}

func azureAuthBackendExists(d *schema.ResourceData, meta interface{}) (bool, error) {
config := meta.(*provider.ProviderMeta).GetClient()

config, e := provider.GetClient(d, meta)
if e != nil {
return false, e
}
log.Printf("[DEBUG] Checking if Azure auth backend is configured at %q", d.Id())
secret, err := config.Logical().Read(d.Id())
if err != nil {
Expand Down