Skip to content

Commit

Permalink
Merge pull request #2050 from alrs/lint-test-staticcheck
Browse files Browse the repository at this point in the history
Fix staticcheck Lint Failures in Tests
  • Loading branch information
martina-if authored Apr 22, 2020
2 parents 91b05e0 + 57e82b5 commit 3202735
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pkg/authconfigmap/authconfigmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,22 +343,22 @@ var _ = Describe("AuthConfigMap{}", func() {
}

It("should add a role and a user", func() {
cm := addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
cm = addAndSave(userA, userAUsername, userAGroups)
_ = addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
cm := addAndSave(userA, userAUsername, userAGroups)
Expect(cm.Data["mapRoles"]).To(MatchYAML(expectedRoleA))
Expect(cm.Data["mapUsers"]).To(MatchYAML(expectedUserA))
})
It("should append a second role and user", func() {
cm := addAndSave(roleB, RoleNodeGroupUsername, []string{groupB})
cm = addAndSave(userB, userBUsername, userBGroups)
_ = addAndSave(roleB, RoleNodeGroupUsername, []string{groupB})
cm := addAndSave(userB, userBUsername, userBGroups)
Expect(cm.Data["mapRoles"]).To(MatchYAML(expectedRoleA + expectedRoleB))
Expect(cm.Data["mapUsers"]).To(MatchYAML(expectedUserA + expectedUserB))
})
It("should append a duplicate role", func() {
cm := addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
_ = addAndSave(roleA, RoleNodeGroupUsername, RoleNodeGroupGroups)
expectedRoles := expectedRoleA + expectedRoleB + expectedRoleA

cm = addAndSave(userA, userAUsername, userAGroups)
cm := addAndSave(userA, userAUsername, userAGroups)
expectedUsers := expectedUserA + expectedUserB + expectedUserA

Expect(cm.Data["mapRoles"]).To(MatchYAML(expectedRoles))
Expand Down
2 changes: 1 addition & 1 deletion pkg/az/az_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var _ = Describe("AZ", func() {
)

BeforeEach(func() {
avoidedZones(ec2.AvailabilityZoneStateAvailable)
_ = avoidedZones(ec2.AvailabilityZoneStateAvailable)
})

Context("with a region that has no zones to avoid", func() {
Expand Down

0 comments on commit 3202735

Please sign in to comment.