Skip to content

Commit

Permalink
OCM-10017 | fix: revert adding EC2 policy to worker role
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwu08 committed Oct 21, 2024
1 parent 44e58e0 commit 8f41ad7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions pkg/aws/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,9 +961,6 @@ func GetAccountRolePolicyKeys(roleType string) []string {
// GetAccountRolePolicyKeys returns the policy key for fetching the managed policy ARN
func GetHcpAccountRolePolicyKeys(roleType string) []string {
policyKeys := []string{fmt.Sprintf("sts_hcp_%s_permission_policy", roleType)}
if roleType == HCPWorkerRole {
policyKeys = append(policyKeys, WorkerEC2RegistryKey)
}

return policyKeys
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/aws/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,8 @@ var _ = Describe("GetHcpAccountRolePolicyKeys", func() {
When("role_type contains instance_worker", func() {
It("should return correct policy keys", func() {
policyKeys := GetHcpAccountRolePolicyKeys("instance_worker")
Expect(len(policyKeys)).To(Equal(2))
Expect(len(policyKeys)).To(Equal(1))
Expect(policyKeys[0]).To(Equal("sts_hcp_instance_worker_permission_policy"))
Expect(policyKeys[1]).To(Equal("sts_hcp_ec2_registry_permission_policy"))
})
})
When("role_type contains installer", func() {
Expand Down

0 comments on commit 8f41ad7

Please sign in to comment.