Skip to content

Commit

Permalink
add ut and fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Rookie committed Nov 16, 2023
1 parent 4ccd59e commit e993f7c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package component
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"

Expand Down Expand Up @@ -456,9 +457,9 @@ var _ = Describe("Component Definition Convertor", func() {
AccessMode: appsv1alpha1.ReadWrite,
},
}
res2, err := convertor.convert(clusterCompDef, clusterName)
services2, ok := res2.([]appsv1alpha1.Service)
Expect(ok).Should(BeTrue())
res2, _ := convertor.convert(clusterCompDef, clusterName)
services2, ok2 := res2.([]appsv1alpha1.Service)
Expect(ok2).Should(BeTrue())
Expect(services2).Should(HaveLen(2))
Expect(services2[0].RoleSelector).Should(BeEquivalentTo(constant.Primary))
})
Expand Down

0 comments on commit e993f7c

Please sign in to comment.