Skip to content

Commit

Permalink
Fixes issue with secrets not being populated when updating custom domain
Browse files Browse the repository at this point in the history
  • Loading branch information
AButler committed Mar 14, 2024
1 parent b54f052 commit d406858
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ func (a ContainerAppCustomDomainResource) Create() sdk.ResourceFunc {
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

0 comments on commit d406858

Please sign in to comment.