Skip to content

Commit

Permalink
fix controller test
Browse files Browse the repository at this point in the history
  • Loading branch information
randytqwjp committed Oct 22, 2024
1 parent df7b7b8 commit 52780ef
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/tortoisectl/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package tortoisectl

import "github.com/mercari/tortoise/cmd/tortoisectl/commands"

Expand Down
6 changes: 6 additions & 0 deletions internal/controller/tortoise_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
autoscalingv1 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
"k8s.io/client-go/tools/record"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/config"
"sigs.k8s.io/yaml"

"github.com/mercari/tortoise/api/v1beta3"
Expand Down Expand Up @@ -235,6 +237,9 @@ func startController(ctx context.Context) func() {
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme,
LeaderElection: false,
Controller: config.Controller{
SkipNameValidation: ptr.To(true),
},
})
Expect(err).ShouldNot(HaveOccurred())

Expand Down Expand Up @@ -289,6 +294,7 @@ var _ = Describe("Test TortoiseController", func() {
if err != nil {
Expect(apierrors.IsNotFound(err)).To(Equal(true))
}

}

generateTestCases := func(path string) {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ import (
// Run e2e tests using the Ginkgo runner.
func TestE2E(t *testing.T) {
RegisterFailHandler(Fail)
_, _ = fmt.Fprintf(GinkgoWriter, "Starting tortoise-migration-2 suite\n")
_, _ = fmt.Fprintf(GinkgoWriter, "Starting tortoise suite\n")
RunSpecs(t, "e2e suite")
}
4 changes: 2 additions & 2 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"mercari.com/tortoise/test/utils"
"github.com/mercari/tortoise/test/utils"
)

const namespace = "tortoise-migration-2-system"
const namespace = "tortoise-system"

var _ = Describe("controller", Ordered, func() {
BeforeAll(func() {
Expand Down

0 comments on commit 52780ef

Please sign in to comment.