Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Support inferring arn prefix. (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickburns authored and Joseph-Irving committed Aug 1, 2019
1 parent 02f63bc commit d999e61
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
pb "github.com/uswitch/kiam/proto"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -233,15 +233,16 @@ func NewServer(config *Config) (*KiamServer, error) {
server.namespaces = k8s.NewNamespaceCache(k8s.NewListWatch(client, k8s.ResourceNamespaces), time.Minute)
server.eventRecorder = eventRecorder(client)

stsGateway, err := sts.DefaultGateway(config.AssumeRoleArn, config.Region)
arnResolver, err := newRoleARNResolver(config)
if err != nil {
return nil, err
}

arnResolver, err := newRoleARNResolver(config)
stsGateway, err := sts.DefaultGateway(arnResolver.Resolve(config.AssumeRoleArn), config.Region)
if err != nil {
return nil, err
}

credentialsCache := sts.DefaultCache(
stsGateway, config.SessionName,
config.SessionDuration,
Expand Down

0 comments on commit d999e61

Please sign in to comment.