Skip to content

Commit cde450b

Browse files
committed
move tags to more generic dir
1 parent f854be8 commit cde450b

File tree

5 files changed

+31
-32
lines changed

5 files changed

+31
-32
lines changed

test/helper/cloud/aws/vpc.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ package aws
1616

1717
import (
1818
"fmt"
19+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
1920

2021
"github.com/aws/aws-sdk-go/aws"
2122
"github.com/aws/aws-sdk-go/service/ec2"
22-
23-
awshelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/aws"
2423
)
2524

2625
func CreateVPC(name, cidr, region string) (string, error) {
@@ -36,9 +35,9 @@ func CreateVPC(name, cidr, region string) (string, error) {
3635
ResourceType: aws.String(ec2.ResourceTypeVpc),
3736
Tags: []*ec2.Tag{
3837
{Key: aws.String("Name"), Value: aws.String(name)},
39-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
40-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
41-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
38+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
39+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
40+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
4241
},
4342
}},
4443
})

test/helper/e2e/actions/cloud/aws.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"encoding/json"
1919
"errors"
2020
"fmt"
21+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
2122
"os"
2223
"strings"
2324
"time"
@@ -31,7 +32,6 @@ import (
3132
"github.com/onsi/ginkgo/v2/dsl/core"
3233

3334
"github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/pointer"
34-
awshelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/aws"
3535
)
3636

3737
type AwsAction struct {
@@ -86,10 +86,10 @@ func (a *AwsAction) CreateKMS(alias, region, atlasAccountArn, assumedRoleArn str
8686
Origin: aws.String("AWS_KMS"),
8787
Policy: aws.String(policyString),
8888
Tags: []*kms.Tag{
89-
{TagKey: aws.String(awshelper.OwnerTag), TagValue: aws.String(awshelper.AKOTeam)},
90-
{TagKey: aws.String(awshelper.OwnerEmailTag), TagValue: aws.String(awshelper.AKOEmail)},
91-
{TagKey: aws.String(awshelper.CostCenterTag), TagValue: aws.String(awshelper.AKOCostCenter)},
92-
{TagKey: aws.String(awshelper.EnvironmentTag), TagValue: aws.String(awshelper.AKOEnvTest)},
89+
{TagKey: aws.String(taghelper.OwnerTag), TagValue: aws.String(taghelper.AKOTeam)},
90+
{TagKey: aws.String(taghelper.OwnerEmailTag), TagValue: aws.String(taghelper.AKOEmail)},
91+
{TagKey: aws.String(taghelper.CostCenterTag), TagValue: aws.String(taghelper.AKOCostCenter)},
92+
{TagKey: aws.String(taghelper.EnvironmentTag), TagValue: aws.String(taghelper.AKOEnvTest)},
9393
},
9494
})
9595

@@ -414,10 +414,10 @@ func (a *AwsAction) createVPC(name, cidr, region string) (string, error) {
414414
ResourceType: aws.String(ec2.ResourceTypeVpc),
415415
Tags: []*ec2.Tag{
416416
{Key: aws.String("Name"), Value: aws.String(name)},
417-
{Key: aws.String(awshelper.OwnerTag), Value: aws.String(awshelper.AKOTeam)},
418-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
419-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
420-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
417+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
418+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
419+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
420+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
421421
},
422422
}},
423423
}
@@ -496,10 +496,10 @@ func (a *AwsAction) createSubnet(vpcID, name, cidr, region, az string) (*string,
496496
ResourceType: aws.String(ec2.ResourceTypeSubnet),
497497
Tags: []*ec2.Tag{
498498
{Key: aws.String("Name"), Value: aws.String(name)},
499-
{Key: aws.String(awshelper.OwnerTag), Value: aws.String(awshelper.AKOTeam)},
500-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
501-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
502-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
499+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
500+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
501+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
502+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
503503
},
504504
}},
505505
VpcId: aws.String(vpcID),

test/helper/e2e/actions/cloudaccess/aws_roles.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ package cloudaccess
1616

1717
import (
1818
"encoding/json"
19+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
1920
"strings"
2021

2122
"github.com/aws/aws-sdk-go/aws"
2223
"github.com/aws/aws-sdk-go/aws/session"
2324
"github.com/aws/aws-sdk-go/service/iam"
24-
25-
awshelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/aws"
2625
)
2726

2827
type AssumeRolePolicyDocument struct {
@@ -105,10 +104,10 @@ func CreateAWSIAMRole(roleName string) (string, error) {
105104
roleInput.SetRoleName(roleName)
106105
roleInput.SetAssumeRolePolicyDocument(policy)
107106
roleInput.Tags = []*iam.Tag{
108-
{Key: aws.String(awshelper.OwnerTag), Value: aws.String(awshelper.AKOTeam)},
109-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
110-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
111-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
107+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
108+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
109+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
110+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
112111
}
113112
//roleInput.SetTags([]*iam.Tag{
114113
// {

test/helper/e2e/api/aws/aws_resources_generator.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package helper
1616

1717
import (
1818
"fmt"
19+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
1920

2021
"github.com/aws/aws-sdk-go/aws"
2122
"github.com/aws/aws-sdk-go/aws/session"
@@ -104,10 +105,10 @@ func (g *AwsResourcesGenerator) CreatePolicy(name string, policy func() IAMPolic
104105
PolicyDocument: policy(),
105106
PolicyName: aws.String(name),
106107
Tags: []*iam.Tag{
107-
{Key: aws.String(OwnerTag), Value: aws.String(AKOTeam)},
108-
{Key: aws.String(OwnerEmailTag), Value: aws.String(AKOEmail)},
109-
{Key: aws.String(CostCenterTag), Value: aws.String(AKOCostCenter)},
110-
{Key: aws.String(EnvironmentTag), Value: aws.String(AKOEnvTest)},
108+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
109+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
110+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
111+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
111112
},
112113
}
113114

@@ -185,10 +186,10 @@ func (g *AwsResourcesGenerator) CreateBucket(name string) error {
185186

186187
tagSet := &s3.Tagging{
187188
TagSet: []*s3.Tag{
188-
{Key: aws.String(OwnerTag), Value: aws.String(AKOTeam)},
189-
{Key: aws.String(OwnerEmailTag), Value: aws.String(AKOEmail)},
190-
{Key: aws.String(CostCenterTag), Value: aws.String(AKOCostCenter)},
191-
{Key: aws.String(EnvironmentTag), Value: aws.String(AKOEnvTest)},
189+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
190+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
191+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
192+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
192193
},
193194
}
194195

File renamed without changes.

0 commit comments

Comments
 (0)