Skip to content

Commit

Permalink
Address minor comments from review
Browse files Browse the repository at this point in the history
  • Loading branch information
timuthy committed Jun 4, 2021
1 parent dde320b commit 82fce48
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 47 deletions.
23 changes: 23 additions & 0 deletions pkg/health/condition/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,26 @@ var _ = Describe("Builder", func() {
})
})
})

type result struct {
ConType druidv1alpha1.ConditionType
ConStatus druidv1alpha1.ConditionStatus
ConReason string
ConMessage string
}

func (r *result) ConditionType() druidv1alpha1.ConditionType {
return r.ConType
}

func (r *result) Status() druidv1alpha1.ConditionStatus {
return r.ConStatus
}

func (r *result) Reason() string {
return r.ConReason
}

func (r *result) Message() string {
return r.ConMessage
}
4 changes: 2 additions & 2 deletions pkg/health/condition/check_ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ func (r *readyCheck) Check(status druidv1alpha1.EtcdStatus) Result {
conType: druidv1alpha1.ConditionTypeReady,
status: druidv1alpha1.ConditionFalse,
reason: "QuorumLost",
message: "The majority of ETCD nodes are not ready",
message: "The majority of ETCD members is not ready",
}
}

return &result{
conType: druidv1alpha1.ConditionTypeReady,
status: druidv1alpha1.ConditionTrue,
reason: "Quorate",
message: "The majority of ETCD nodes is ready",
message: "The majority of ETCD members is ready",
}
}

Expand Down
25 changes: 0 additions & 25 deletions pkg/health/condition/condition_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,9 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1"
)

func TestCondition(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Condition Suite")
}

type result struct {
ConType druidv1alpha1.ConditionType
ConStatus druidv1alpha1.ConditionStatus
ConReason string
ConMessage string
}

func (r *result) ConditionType() druidv1alpha1.ConditionType {
return r.ConType
}

func (r *result) Status() druidv1alpha1.ConditionStatus {
return r.ConStatus
}

func (r *result) Reason() string {
return r.ConReason
}

func (r *result) Message() string {
return r.ConMessage
}
18 changes: 18 additions & 0 deletions pkg/health/etcdmember/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,21 @@ var _ = Describe("Builder", func() {
})
})
})

type result struct {
MemberID string
MemberStatus druidv1alpha1.EtcdMemberConditionStatus
MemberReason string
}

func (r *result) ID() string {
return r.MemberID
}

func (r *result) Reason() string {
return r.MemberReason
}

func (r *result) Status() druidv1alpha1.EtcdMemberConditionStatus {
return r.MemberStatus
}
20 changes: 0 additions & 20 deletions pkg/health/etcdmember/etcdmember_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,9 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1"
)

func TestEtcdMember(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Etcd Member Suite")
}

type result struct {
MemberID string
MemberStatus druidv1alpha1.EtcdMemberConditionStatus
MemberReason string
}

func (r *result) ID() string {
return r.MemberID
}

func (r *result) Reason() string {
return r.MemberReason
}

func (r *result) Status() druidv1alpha1.EtcdMemberConditionStatus {
return r.MemberStatus
}

0 comments on commit 82fce48

Please sign in to comment.