Skip to content

Commit

Permalink
PWX-39128: Adding env variable SKIP_AWS_DRIVER_INIT support to skip t…
Browse files Browse the repository at this point in the history
…he aws driver init in stork. (#1852)

(cherry picked from commit 4580c07)
  • Loading branch information
diptiranjanpx committed Sep 20, 2024
1 parent b1b1d8e commit 5209a01
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions drivers/volume/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aws

import (
"fmt"
"os"
"time"

aws_sdk "github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -672,13 +673,17 @@ func (a *aws) IsVirtualMachineSupported() bool {
}

func init() {
a := &aws{}
err := a.Init(nil)
if err != nil {
logrus.Debugf("Error init'ing aws driver: %v", err)
}
if err := storkvolume.Register(storkvolume.AWSDriverName, a); err != nil {
logrus.Panicf("Error registering aws volume driver: %v", err)
if os.Getenv("SKIP_AWS_DRIVER_INIT") == "true" {
logrus.Infof("Skipping aws driver init")
} else {
a := &aws{}
err := a.Init(nil)
if err != nil {
logrus.Debugf("Error init'ing aws driver: %v", err)
}
if err := storkvolume.Register(storkvolume.AWSDriverName, a); err != nil {
logrus.Panicf("Error registering aws volume driver: %v", err)
}
}
}

Expand Down

0 comments on commit 5209a01

Please sign in to comment.