deps: update Go to v1.24.2 (#3750)

* deps: update Go to v1.24.2
* tests: replace context.Background() with t.Context()

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2025-04-09 10:54:28 +02:00 committed by GitHub
parent a7f9561a3d
commit 4e5c213b4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
112 changed files with 287 additions and 316 deletions

View file

@ -185,14 +185,14 @@ func TestApplier(t *testing.T) {
out: &bytes.Buffer{},
}
diff, err := applier.Plan(context.Background(), tc.config)
diff, err := applier.Plan(t.Context(), tc.config)
if err != nil {
assert.True(tc.wantErr, "unexpected error: %s", err)
return
}
assert.False(diff)
idFile, err := applier.Apply(context.Background(), tc.provider, tc.config.GetAttestationConfig().GetVariant(), true)
idFile, err := applier.Apply(t.Context(), tc.provider, tc.config.GetAttestationConfig().GetVariant(), true)
if tc.wantErr {
assert.Error(err)
@ -303,7 +303,7 @@ func TestPlan(t *testing.T) {
cfg := config.Default()
cfg.RemoveProviderAndAttestationExcept(cloudprovider.Azure)
diff, err := u.Plan(context.Background(), cfg)
diff, err := u.Plan(t.Context(), cfg)
if tc.wantErr {
require.Error(err)
} else {
@ -352,7 +352,7 @@ func TestApply(t *testing.T) {
out: io.Discard,
}
_, err := u.Apply(context.Background(), cloudprovider.QEMU, variant.QEMUVTPM{}, WithoutRollbackOnError)
_, err := u.Apply(t.Context(), cloudprovider.QEMU, variant.QEMUVTPM{}, WithoutRollbackOnError)
if tc.wantErr {
assert.Error(err)
} else {

View file

@ -128,7 +128,7 @@ func TestIAMCreator(t *testing.T) {
},
}
idFile, err := creator.Create(context.Background(), tc.provider, tc.config)
idFile, err := creator.Create(t.Context(), tc.provider, tc.config)
if tc.wantErr {
assert.Error(err)
@ -184,7 +184,7 @@ func TestDestroyIAMConfiguration(t *testing.T) {
return tc.tfClient, nil
}}
err := destroyer.DestroyIAMConfiguration(context.Background(), "", terraform.LogLevelNone)
err := destroyer.DestroyIAMConfiguration(t.Context(), "", terraform.LogLevelNone)
if tc.wantErr {
assert.Error(err)
@ -278,7 +278,7 @@ func TestGetTfstateServiceAccountKey(t *testing.T) {
return tc.cl, nil
}}
saKey, err := destroyer.GetTfStateServiceAccountKey(context.Background(), "")
saKey, err := destroyer.GetTfStateServiceAccountKey(t.Context(), "")
if tc.wantErr {
assert.Error(err)

View file

@ -8,7 +8,6 @@ package cloudcmd
import (
"bytes"
"context"
"errors"
"testing"
@ -46,7 +45,7 @@ func TestRollbackTerraform(t *testing.T) {
}
destroyClusterErrOutput := &bytes.Buffer{}
err := rollbacker.rollback(context.Background(), destroyClusterErrOutput, terraform.LogLevelNone)
err := rollbacker.rollback(t.Context(), destroyClusterErrOutput, terraform.LogLevelNone)
if tc.wantCleanupErr {
assert.Error(err)
if tc.tfClient.cleanUpWorkspaceErr == nil {
@ -107,7 +106,7 @@ func TestRollbackQEMU(t *testing.T) {
destroyClusterErrOutput := &bytes.Buffer{}
err := rollbacker.rollback(context.Background(), destroyClusterErrOutput, terraform.LogLevelNone)
err := rollbacker.rollback(t.Context(), destroyClusterErrOutput, terraform.LogLevelNone)
if tc.wantErr {
assert.Error(err)
if tc.tfClient.cleanUpWorkspaceErr == nil {

View file

@ -63,7 +63,7 @@ func TestTerminator(t *testing.T) {
},
}
err := terminator.Terminate(context.Background(), "", terraform.LogLevelNone)
err := terminator.Terminate(t.Context(), "", terraform.LogLevelNone)
if tc.wantErr {
assert.Error(err)

View file

@ -101,7 +101,7 @@ func TestTFPlan(t *testing.T) {
fs := tc.prepareFs(require.New(t))
hasDiff, planErr := plan(
context.Background(), tc.tf, fs, io.Discard, terraform.LogLevelDebug,
t.Context(), tc.tf, fs, io.Discard, terraform.LogLevelDebug,
&terraform.QEMUVariables{},
templateDir, existingWorkspace, backupDir,
)