mirror of
https://github.com/zalando-incubator/kube-metrics-adapter.git
synced 2025-10-24 16:07:39 +00:00
UPDATED to use NewSessionWithConfig instead of NewSession (#230)
NewSession is being deprecated, NewSessionWithConfig handles things such as role arns. This fixes permissions issues for users using role arns for service accounts. Signed-off-by: Ewan Valentine <ewan.valentine89@gmail.com>
This commit is contained in:
@@ -229,7 +229,11 @@ func (o AdapterServerOptions) RunCustomMetricsAdapterServer(stopCh <-chan struct
|
||||
|
||||
awsSessions := make(map[string]*session.Session, len(o.AWSRegions))
|
||||
for _, region := range o.AWSRegions {
|
||||
awsSessions[region], err = session.NewSession(&aws.Config{Region: aws.String(region)})
|
||||
awsSessions[region], err = session.NewSessionWithOptions(session.Options{
|
||||
Config: aws.Config{
|
||||
Region: aws.String(region),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unabled to create aws session for region: %s", region)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user