@@ -10,7 +10,6 @@ import (
1010 gosql "database/sql"
1111 "fmt"
1212 "net/url"
13- "os"
1413 "path"
1514 "time"
1615
@@ -34,21 +33,8 @@ import (
3433 "github.com/cockroachdb/cockroach/pkg/util/timeutil"
3534 "github.com/cockroachdb/errors"
3635 "github.com/stretchr/testify/require"
37- "gopkg.in/yaml.v3"
3836)
3937
40- // At the moment, Azure VMs do not have managed identities set up yet.
41- // Therefore, in order to use implicit authentication, we need to put a
42- // credentials file on each VM and point the
43- // `COCKROACH_AZURE_APPLICATION_CREDENTIALS_FILE` environment variable at the
44- // file.
45- // Currently, the only set of credentials that have write access to the storage
46- // buckets are the Teamcity credentials, so the Azure fixture roachtests cannot
47- // be run locally until those managed identities are set up.
48- // TODO (kev-cao): Once managed identities are set up, we can remove this file
49- // and rely on the managed identity to authenticate with Azure Blob Storage.
50- const azureCredentialsFilePath = "/home/ubuntu/azure-credentials.yaml"
51-
5238// Maps a fixture database name to the expected number of tables in the
5339// database, useful for verifying that the fingerprint of the fixture is as
5440// expected.
@@ -197,9 +183,6 @@ func (bd *backupDriver) prepareCluster(ctx context.Context) {
197183 "cloudstorage.s3.client_retry_token_bucket.enabled" : "false" ,
198184 "cloudstorage.azure.try.timeout" : "0s" ,
199185 },
200- install.EnvOption {
201- fmt .Sprintf ("COCKROACH_AZURE_APPLICATION_CREDENTIALS_FILE=%s" , azureCredentialsFilePath ),
202- },
203186 ))
204187}
205188
@@ -653,7 +636,6 @@ func registerBackupFixtures(r registry.Registry) {
653636 Suites : bf .suites ,
654637 Skip : bf .skip ,
655638 Run : func (ctx context.Context , t test.Test , c cluster.Cluster ) {
656- require .NoError (t , maybePutAzureCredentialsFile (ctx , c , azureCredentialsFilePath ))
657639 registry := GetFixtureRegistry (ctx , t , c .Cloud ())
658640
659641 handle , err := registry .Create (ctx , bf .fixture .Name , t .L ())
@@ -689,44 +671,6 @@ func registerBackupFixtures(r registry.Registry) {
689671 }
690672}
691673
692- func maybePutAzureCredentialsFile (ctx context.Context , c cluster.Cluster , path string ) error {
693- if c .Cloud () != spec .Azure {
694- return nil
695- }
696-
697- type azureCreds struct {
698- TenantID string `yaml:"azure_tenant_id"`
699- ClientID string `yaml:"azure_client_id"`
700- ClientSecret string `yaml:"azure_client_secret"`
701- }
702-
703- azureEnvVars := []string {AzureTenantIDEnvVar , AzureClientIDEnvVar , AzureClientSecretEnvVar }
704- azureEnvValues := make (map [string ]string )
705- for _ , envVar := range azureEnvVars {
706- val := os .Getenv (envVar )
707- if val == "" {
708- return errors .Newf ("environment variable %s is not set" , envVar )
709- }
710- azureEnvValues [envVar ] = val
711- }
712-
713- creds := azureCreds {
714- TenantID : azureEnvValues [AzureTenantIDEnvVar ],
715- ClientID : azureEnvValues [AzureClientIDEnvVar ],
716- ClientSecret : azureEnvValues [AzureClientSecretEnvVar ],
717- }
718-
719- credsYaml , err := yaml .Marshal (creds )
720- if err != nil {
721- return errors .Wrapf (err , "failed to marshal Azure credentials to YAML" )
722- }
723-
724- return errors .Wrap (
725- c .PutString (ctx , string (credsYaml ), path , 0700 ),
726- "failed to put Azure credentials file in cluster" ,
727- )
728- }
729-
730674func registerBlobFixtureGC (r registry.Registry ) {
731675 r .Add (registry.TestSpec {
732676 Name : "blobfixture/gc" ,
0 commit comments