Skip to content

Commit

Permalink
OCM-3963 | feat: removing unecessary pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
den-rgb committed Dec 20, 2023
1 parent 2bb7985 commit d5cc53c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions pkg/aws/validations/iam_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func GetRoleName(prefix string, role string) string {
return name
}

func IsManagedRole(roleTags []*iamtypes.Tag) bool {
func IsManagedRole(roleTags []iamtypes.Tag) bool {
for _, tag := range roleTags {
if aws.ToString(tag.Key) == ManagedPolicies && aws.ToString(tag.Value) == "true" {
return true
Expand All @@ -27,7 +27,7 @@ func IsManagedRole(roleTags []*iamtypes.Tag) bool {
return false
}

func HasCompatibleVersionTags(iamTags []*iamtypes.Tag, version string) (bool, error) {
func HasCompatibleVersionTags(iamTags []iamtypes.Tag, version string) (bool, error) {
if len(iamTags) == 0 {
return false, nil
}
Expand All @@ -53,7 +53,7 @@ func HasCompatibleVersionTags(iamTags []*iamtypes.Tag, version string) (bool, er
return false, nil
}

func IamResourceHasTag(iamTags []*iamtypes.Tag, tagKey string, tagValue string) bool {
func IamResourceHasTag(iamTags []iamtypes.Tag, tagKey string, tagValue string) bool {
for _, tag := range iamTags {
if aws.ToString(tag.Key) == tagKey && aws.ToString(tag.Value) == tagValue {
return true
Expand Down
16 changes: 8 additions & 8 deletions pkg/aws/validations/iam_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var _ = Describe("AWS iamtypes Functions", func() {

Describe("isManagedRole", func() {
It("should return true if the 'ManagedPolicies' tag has the value 'true'", func() {
roleTags := []*iamtypes.Tag{
roleTags := []iamtypes.Tag{
{Key: aws.String(ManagedPolicies), Value: aws.String("true")},
}

Expand All @@ -44,7 +44,7 @@ var _ = Describe("AWS iamtypes Functions", func() {
})

It("should return false if the 'ManagedPolicies' tag does not have the value 'true'", func() {
roleTags := []*iamtypes.Tag{
roleTags := []iamtypes.Tag{
{Key: aws.String(ManagedPolicies), Value: aws.String("false")},
}

Expand All @@ -54,7 +54,7 @@ var _ = Describe("AWS iamtypes Functions", func() {
})

It("should return false if the 'ManagedPolicies' tag is not present", func() {
roleTags := []*iamtypes.Tag{
roleTags := []iamtypes.Tag{
{Key: aws.String("SomeOtherTag"), Value: aws.String("true")},
}

Expand All @@ -65,10 +65,10 @@ var _ = Describe("AWS iamtypes Functions", func() {
})

var _ = Describe("HasCompatibleVersionTags", func() {
var iamtypesTags []*iamtypes.Tag
var iamtypesTags []iamtypes.Tag

BeforeEach(func() {
iamtypesTags = []*iamtypes.Tag{
iamtypesTags = []iamtypes.Tag{
{Key: aws.String(OpenShiftVersion), Value: aws.String("1.2.3")},
{Key: aws.String("SomeOtherTag"), Value: aws.String("value")},
}
Expand All @@ -94,7 +94,7 @@ var _ = Describe("AWS iamtypes Functions", func() {

It("should return false if the version tag is not present", func() {
version := "1.2.3"
iamtypesTags = []*iamtypes.Tag{
iamtypesTags = []iamtypes.Tag{
{Key: aws.String("SomeOtherTag"), Value: aws.String("value")},
}

Expand All @@ -116,7 +116,7 @@ var _ = Describe("AWS iamtypes Functions", func() {

var _ = Describe("iamtypesResourceHasTag", func() {
It("should return true if the tag with the specified key and value exists", func() {
iamtypesTags := []*iamtypes.Tag{
iamtypesTags := []iamtypes.Tag{
{Key: aws.String("Tag1"), Value: aws.String("Value1")},
{Key: aws.String("Tag2"), Value: aws.String("Value2")},
}
Expand All @@ -129,7 +129,7 @@ var _ = Describe("AWS iamtypes Functions", func() {
})

It("should return false if the tag with the specified key and value does not exist", func() {
iamtypesTags := []*iamtypes.Tag{
iamtypesTags := []iamtypes.Tag{
{Key: aws.String("Tag1"), Value: aws.String("Value1")},
{Key: aws.String("Tag2"), Value: aws.String("Value2")},
}
Expand Down

0 comments on commit d5cc53c

Please sign in to comment.