Skip to content

Commit

Permalink
Allow getting public images (#11)
Browse files Browse the repository at this point in the history
* allow getting public images
  • Loading branch information
fishnix authored Sep 14, 2021
1 parent 00f5fc7 commit 51c3bb6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
1 change: 0 additions & 1 deletion ec2/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func (e *Ec2) GetImage(ctx context.Context, ids ...string) ([]*ec2.Image, error)
log.Infof("getting details about image ids %+v", ids)

input := ec2.DescribeImagesInput{
Owners: aws.StringSlice([]string{"self"}),
ImageIds: aws.StringSlice(ids),
}

Expand Down
29 changes: 28 additions & 1 deletion ec2/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,21 @@ func TestEc2_GetImage(t *testing.T) {
ctx: context.TODO(),
ids: []string{"i-00000005"},
},
want: []*ec2.Image{},
want: []*ec2.Image{
{
ImageId: aws.String("i-00000005"),
Name: aws.String("Image_00000005"),
OwnerId: aws.String("aws"),
Public: aws.Bool(false),
State: aws.String("available"),
Tags: []*ec2.Tag{
{
Key: aws.String("yale:org"),
Value: aws.String("dev"),
},
},
},
},
},
{
name: "multiple ids",
Expand Down Expand Up @@ -508,6 +522,19 @@ func TestEc2_GetImage(t *testing.T) {
},
},
},
{
ImageId: aws.String("i-00000005"),
Name: aws.String("Image_00000005"),
OwnerId: aws.String("aws"),
Public: aws.Bool(false),
State: aws.String("available"),
Tags: []*ec2.Tag{
{
Key: aws.String("yale:org"),
Value: aws.String("dev"),
},
},
},
},
},
}
Expand Down

0 comments on commit 51c3bb6

Please sign in to comment.