Skip to content

Commit 6150c90

Browse files
roothorpigor-karpukhin
authored andcommitted
move tags to more generic dir
1 parent 3a29c59 commit 6150c90

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
@@ -17,13 +17,12 @@ package aws
1717
import (
1818
"context"
1919
"fmt"
20+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
2021

2122
"github.com/aws/aws-sdk-go-v2/aws"
2223
"github.com/aws/aws-sdk-go-v2/config"
2324
"github.com/aws/aws-sdk-go-v2/service/ec2"
2425
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
25-
26-
awshelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/aws"
2726
)
2827

2928
func CreateVPC(ctx context.Context, name, cidr, region string) (string, error) {
@@ -43,9 +42,9 @@ func CreateVPC(ctx context.Context, name, cidr, region string) (string, error) {
4342
ResourceType: types.ResourceTypeVpc,
4443
Tags: []types.Tag{
4544
{Key: aws.String("Name"), Value: aws.String(name)},
46-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
47-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
48-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
45+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
46+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
47+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
4948
},
5049
}},
5150
})

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"encoding/json"
2020
"errors"
2121
"fmt"
22+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
2223
"os"
2324
"strings"
2425
"time"
@@ -35,7 +36,6 @@ import (
3536
. "github.com/onsi/gomega"
3637

3738
"github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/pointer"
38-
awshelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/aws"
3939
)
4040

4141
type AwsAction struct {
@@ -91,10 +91,10 @@ func (a *AwsAction) CreateKMS(ctx context.Context, alias, region, atlasAccountAr
9191
Origin: kmstypes.OriginTypeAwsKms,
9292
Policy: aws.String(policyString),
9393
Tags: []kmstypes.Tag{
94-
{TagKey: aws.String(awshelper.OwnerTag), TagValue: aws.String(awshelper.AKOTeam)},
95-
{TagKey: aws.String(awshelper.OwnerEmailTag), TagValue: aws.String(awshelper.AKOEmail)},
96-
{TagKey: aws.String(awshelper.CostCenterTag), TagValue: aws.String(awshelper.AKOCostCenter)},
97-
{TagKey: aws.String(awshelper.EnvironmentTag), TagValue: aws.String(awshelper.AKOEnvTest)},
94+
{TagKey: aws.String(taghelper.OwnerTag), TagValue: aws.String(taghelper.AKOTeam)},
95+
{TagKey: aws.String(taghelper.OwnerEmailTag), TagValue: aws.String(taghelper.AKOEmail)},
96+
{TagKey: aws.String(taghelper.CostCenterTag), TagValue: aws.String(taghelper.AKOCostCenter)},
97+
{TagKey: aws.String(taghelper.EnvironmentTag), TagValue: aws.String(taghelper.AKOEnvTest)},
9898
},
9999
})
100100

@@ -406,10 +406,10 @@ func (a *AwsAction) createVPC(ctx context.Context, name, cidr, region string) (s
406406
ResourceType: ec2types.ResourceTypeVpc,
407407
Tags: []ec2types.Tag{
408408
{Key: aws.String("Name"), Value: aws.String(name)},
409-
{Key: aws.String(awshelper.OwnerTag), Value: aws.String(awshelper.AKOTeam)},
410-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
411-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
412-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
409+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
410+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
411+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
412+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
413413
},
414414
}},
415415
}
@@ -486,10 +486,10 @@ func (a *AwsAction) createSubnet(ctx context.Context, vpcID, name, cidr, region,
486486
ResourceType: ec2types.ResourceTypeSubnet,
487487
Tags: []ec2types.Tag{
488488
{Key: aws.String("Name"), Value: aws.String(name)},
489-
{Key: aws.String(awshelper.OwnerTag), Value: aws.String(awshelper.AKOTeam)},
490-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
491-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
492-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
489+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
490+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
491+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
492+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
493493
},
494494
}},
495495
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
@@ -18,14 +18,13 @@ import (
1818
"context"
1919
"encoding/json"
2020
"fmt"
21+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
2122
"strings"
2223

2324
"github.com/aws/aws-sdk-go-v2/aws"
2425
"github.com/aws/aws-sdk-go-v2/config"
2526
"github.com/aws/aws-sdk-go-v2/service/iam"
2627
"github.com/aws/aws-sdk-go-v2/service/iam/types"
27-
28-
awshelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/aws"
2928
)
3029

3130
type AssumeRolePolicyDocument struct {
@@ -113,10 +112,10 @@ func CreateAWSIAMRole(ctx context.Context, roleName string) (string, error) {
113112
AssumeRolePolicyDocument: &policy,
114113
}
115114
roleInput.Tags = []types.Tag{
116-
{Key: aws.String(awshelper.OwnerTag), Value: aws.String(awshelper.AKOTeam)},
117-
{Key: aws.String(awshelper.OwnerEmailTag), Value: aws.String(awshelper.AKOEmail)},
118-
{Key: aws.String(awshelper.CostCenterTag), Value: aws.String(awshelper.AKOCostCenter)},
119-
{Key: aws.String(awshelper.EnvironmentTag), Value: aws.String(awshelper.AKOEnvTest)},
115+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
116+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
117+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
118+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
120119
}
121120
role, err := IAMClient.CreateRole(ctx, &roleInput)
122121
if err != nil {

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"encoding/json"
2020
"fmt"
21+
taghelper "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper"
2122

2223
"github.com/aws/aws-sdk-go-v2/aws"
2324
"github.com/aws/aws-sdk-go-v2/config"
@@ -108,10 +109,10 @@ func (g *AwsResourcesGenerator) CreatePolicy(ctx context.Context, name string, p
108109
PolicyDocument: policy(),
109110
PolicyName: aws.String(name),
110111
Tags: []iamtypes.Tag{
111-
{Key: aws.String(OwnerTag), Value: aws.String(AKOTeam)},
112-
{Key: aws.String(OwnerEmailTag), Value: aws.String(AKOEmail)},
113-
{Key: aws.String(CostCenterTag), Value: aws.String(AKOCostCenter)},
114-
{Key: aws.String(EnvironmentTag), Value: aws.String(AKOEnvTest)},
112+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
113+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
114+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
115+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
115116
},
116117
}
117118

@@ -194,10 +195,10 @@ func (g *AwsResourcesGenerator) CreateBucket(ctx context.Context, name string) e
194195

195196
tagSet := &s3types.Tagging{
196197
TagSet: []s3types.Tag{
197-
{Key: aws.String(OwnerTag), Value: aws.String(AKOTeam)},
198-
{Key: aws.String(OwnerEmailTag), Value: aws.String(AKOEmail)},
199-
{Key: aws.String(CostCenterTag), Value: aws.String(AKOCostCenter)},
200-
{Key: aws.String(EnvironmentTag), Value: aws.String(AKOEnvTest)},
198+
{Key: aws.String(taghelper.OwnerTag), Value: aws.String(taghelper.AKOTeam)},
199+
{Key: aws.String(taghelper.OwnerEmailTag), Value: aws.String(taghelper.AKOEmail)},
200+
{Key: aws.String(taghelper.CostCenterTag), Value: aws.String(taghelper.AKOCostCenter)},
201+
{Key: aws.String(taghelper.EnvironmentTag), Value: aws.String(taghelper.AKOEnvTest)},
201202
},
202203
}
203204

File renamed without changes.

0 commit comments

Comments
 (0)