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

azurerm_container_app_custom_domain - fix when azurerm_container_app has secret specified (#25196) #25251

Merged
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) HashiCorp, Inc.

Check failure on line 1 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / golint

: # github.com/hashicorp/terraform-provider-azurerm/internal/services/containerapps
// SPDX-License-Identifier: MPL-2.0

package containerapps
Expand Down Expand Up @@ -124,6 +124,15 @@
return fmt.Errorf("specified Container App (%s) has no Ingress configuration for Custom Domains", containerAppId)
}

// Delta-updates need the secrets back from the list API, or we'll end up removing them or erroring out.
secretsResp, err := client.ListSecrets(ctx, *containerAppId)
if err != nil || secretsResp.Model == nil {
if !response.WasStatusCode(secretsResp.HttpResponse, http.StatusNoContent) {

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

undefined: http

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / detect

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / detect

undefined: http

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

undefined: http

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: http

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: http

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / test

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / test

undefined: http

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / golint

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / golint

undefined: http

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / golint

undefined: response

Check failure on line 130 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / golint

undefined: http
return fmt.Errorf("retrieving secrets for update for %s: %+v", *containerAppId, err)
}
}
config.Secrets = helpers.UnpackContainerSecretsCollection(secretsResp.Model)

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

undefined: helpers

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / detect

undefined: helpers

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

undefined: helpers

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: helpers

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: helpers

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / test

undefined: helpers

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / golint

undefined: helpers (typecheck)

Check failure on line 134 in internal/services/containerapps/container_app_custom_domain_resource.go

View workflow job for this annotation

GitHub Actions / golint

undefined: helpers) (typecheck)

ingress := *config.Ingress

customDomains := make([]containerapps.CustomDomain, 0)
Expand Down
Loading