Skip to content

STACKITLB-1837 | add ALB certificates to provider#1296

Open
david-mey-STACKIT wants to merge 18 commits intostackitcloud:mainfrom
david-mey-STACKIT:main
Open

STACKITLB-1837 | add ALB certificates to provider#1296
david-mey-STACKIT wants to merge 18 commits intostackitcloud:mainfrom
david-mey-STACKIT:main

Conversation

@david-mey-STACKIT
Copy link
Copy Markdown
Contributor

@david-mey-STACKIT david-mey-STACKIT commented Mar 13, 2026

Description

STACKITLB-1837

Add ALB TLS certificates provider (API: https://docs.api.stackit.cloud/documentation/certificates/version/v2)

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@david-mey-STACKIT david-mey-STACKIT force-pushed the main branch 4 times, most recently from 289b525 to f74a895 Compare March 16, 2026 14:10
@david-mey-STACKIT david-mey-STACKIT marked this pull request as ready for review March 16, 2026 14:15
@david-mey-STACKIT david-mey-STACKIT requested a review from a team as a code owner March 16, 2026 14:15
@github-actions
Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions bot added the Stale PR is marked as stale due to inactivity. label Mar 28, 2026
@marceljk marceljk removed the Stale PR is marked as stale due to inactivity. label Mar 31, 2026
Comment on lines +262 to +274
// Avoid race condition: k8s API needs a bit to actually delete the secret
time.Sleep(300 * time.Millisecond)

certificateResp, err = client.DefaultAPI.ListCertificates(ctx, testutil.ProjectId, region).Execute()
if err != nil {
return fmt.Errorf("getting certificateResp after destroy: %w", err)
}
for i := range certificateResp.Items {
if utils.Contains(certificatesToDestroy, *certificateResp.Items[i].Id) {
return fmt.Errorf("certificate %s has not been destroyed", *certificateResp.Items[i].Id)
}
}
return nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When I run the acc tests, it fails here that some certificates has not been destroyed. When I increase the time.Sleep it works.

But actually in the current function the delete should only be triggered in case some certificates still exists. The Terraform Testing framework calls at the end the Delete method of the resource.

When the method was successful executed, it calls the testAccCheckCertDestroy() function, which only checks if the deletion works as expected and no resources are pending. So when testAccCheckCertDestroy() is called, the certificates should be already deleted.

To fix this, the delete method of the resource should wait until the deletion was successful, the certificate is really removed.

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.

3 participants