Linter fixes PR 3 (#4415)

* Linter fixes

* fix(bsr): update test to register TEST protocol once

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
This commit is contained in:
Jeff MitchellandDamian Debkowski authored and GitHub committed 2024-02-16 08:30:16 -05:00
1 parent e95eda7ca2
commit 35cef97bd4
119 files changed
+365 -300

No files matched your search

@@ -92,7 +92,9 @@ func setupEnvironment(t testing.TB, ctx context.Context, c *config, boundaryRepo
// Start Vault
v, vaultToken := infra.StartVault(t, pool, network, "hashicorp/vault", "latest")
t.Cleanup(func() {
pool.Purge(v.Resource)
if err := pool.Purge(v.Resource); err != nil {
t.Logf("error purging pool: %v", err)
}
})
os.Setenv("VAULT_ADDR", v.UriLocalhost)
os.Setenv("VAULT_TOKEN", vaultToken)
@@ -115,7 +117,9 @@ func setupEnvironment(t testing.TB, ctx context.Context, c *config, boundaryRepo
// Start a Boundary database and wait until it's ready
db := infra.StartBoundaryDatabase(t, pool, network, "library/postgres", "latest")
t.Cleanup(func() {
pool.Purge(db.Resource)
if err := pool.Purge(db.Resource); err != nil {
t.Logf("error purging pool: %v", err)
}
})
t.Log("Waiting for database to load...")
err = pool.Retry(func() error {
@@ -138,7 +142,9 @@ func setupEnvironment(t testing.TB, ctx context.Context, c *config, boundaryRepo
c.TargetSshKeyPath,
)
t.Cleanup(func() {
pool.Purge(target.Resource)
if err := pool.Purge(target.Resource); err != nil {
t.Logf("error purging pool: %v", err)
}
})
// Initialize the database and extract resulting information
@@ -151,7 +157,9 @@ func setupEnvironment(t testing.TB, ctx context.Context, c *config, boundaryRepo
db.UriNetwork,
)
t.Cleanup(func() {
pool.Purge(dbInit.Resource)
if err := pool.Purge(dbInit.Resource); err != nil {
t.Logf("error purging pool: %v", err)
}
})
dbInitInfo := infra.GetDbInitInfoFromContainer(t, pool, dbInit)
@@ -371,7 +379,9 @@ func populateBoundaryDatabase(t testing.TB, ctx context.Context, c *config, te T
newTargetId,
)
t.Cleanup(func() {
te.Pool.Purge(connectTarget.Resource)
if err := te.Pool.Purge(connectTarget.Resource); err != nil {
t.Logf("error purging pool: %v", err)
}
})
_, err = te.Pool.Client.WaitContainer(connectTarget.Resource.Container.ID)
require.NoError(t, err)