Skip to content

Commit 52780ef

Browse files
committed
fix controller test
1 parent df7b7b8 commit 52780ef

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

cmd/tortoisectl/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package main
1+
package tortoisectl
22

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

internal/controller/tortoise_controller_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import (
1616
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1717
autoscalingv1 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
1818
"k8s.io/client-go/tools/record"
19+
"k8s.io/utils/ptr"
1920
ctrl "sigs.k8s.io/controller-runtime"
2021
"sigs.k8s.io/controller-runtime/pkg/client"
22+
"sigs.k8s.io/controller-runtime/pkg/config"
2123
"sigs.k8s.io/yaml"
2224

2325
"github.com/mercari/tortoise/api/v1beta3"
@@ -235,6 +237,9 @@ func startController(ctx context.Context) func() {
235237
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
236238
Scheme: scheme,
237239
LeaderElection: false,
240+
Controller: config.Controller{
241+
SkipNameValidation: ptr.To(true),
242+
},
238243
})
239244
Expect(err).ShouldNot(HaveOccurred())
240245

@@ -289,6 +294,7 @@ var _ = Describe("Test TortoiseController", func() {
289294
if err != nil {
290295
Expect(apierrors.IsNotFound(err)).To(Equal(true))
291296
}
297+
292298
}
293299

294300
generateTestCases := func(path string) {

test/e2e/e2e_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ import (
2727
// Run e2e tests using the Ginkgo runner.
2828
func TestE2E(t *testing.T) {
2929
RegisterFailHandler(Fail)
30-
_, _ = fmt.Fprintf(GinkgoWriter, "Starting tortoise-migration-2 suite\n")
30+
_, _ = fmt.Fprintf(GinkgoWriter, "Starting tortoise suite\n")
3131
RunSpecs(t, "e2e suite")
3232
}

test/e2e/e2e_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import (
2424
. "github.com/onsi/ginkgo/v2"
2525
. "github.com/onsi/gomega"
2626

27-
"mercari.com/tortoise/test/utils"
27+
"github.com/mercari/tortoise/test/utils"
2828
)
2929

30-
const namespace = "tortoise-migration-2-system"
30+
const namespace = "tortoise-system"
3131

3232
var _ = Describe("controller", Ordered, func() {
3333
BeforeAll(func() {

0 commit comments

Comments
 (0)