Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/controller/proxmoxcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (r *ProxmoxClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reque
if err := r.Update(ctx, &cluster); err != nil {
return ctrl.Result{}, err
}
return ctrl.Result{Requeue: true}, nil
return ctrl.Result{RequeueAfter: time.Millisecond}, nil
}

return r.onChange(ctx, req, &cluster)
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/vrouterbinding_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (r *VRouterBindingReconciler) Reconcile(ctx context.Context, req ctrl.Reque
if err := r.Update(ctx, &binding); err != nil {
return ctrl.Result{}, err
}
return ctrl.Result{Requeue: true}, nil
return ctrl.Result{RequeueAfter: time.Millisecond}, nil
}

return r.onChange(ctx, req, &binding)
Expand Down
10 changes: 5 additions & 5 deletions internal/controller/vrouterbinding_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ var _ = Describe("VRouterBinding Controller", func() {
Namespace: "default",
},
Spec: vrouterv1.VRouterBindingSpec{
TemplateRef: &vrouterv1.NameRef{Name: "test-template"},
TargetRefs: []vrouterv1.NameRef{{Name: "test-target"}},
TemplateRefs: []vrouterv1.NameRef{{Name: "test-template"}},
TargetRefs: []vrouterv1.NameRef{{Name: "test-target"}},
},
}
Expect(k8sClient.Create(ctx, resource)).To(Succeed())
Expand Down Expand Up @@ -106,7 +106,7 @@ var _ = Describe("VRouterBinding Controller", func() {
It("should prepend templateRef when set", func() {
binding := &vrouterv1.VRouterBinding{
Spec: vrouterv1.VRouterBindingSpec{
TemplateRef: &vrouterv1.NameRef{Name: "tmpl-priority"},
TemplateRef: &vrouterv1.NameRef{Name: "tmpl-priority"}, //nolint:staticcheck // deliberately exercises deprecated TemplateRef
TemplateRefs: []vrouterv1.NameRef{
{Name: "tmpl-a"},
{Name: "tmpl-b"},
Expand All @@ -123,7 +123,7 @@ var _ = Describe("VRouterBinding Controller", func() {
It("should return single-element list when only templateRef is set", func() {
binding := &vrouterv1.VRouterBinding{
Spec: vrouterv1.VRouterBindingSpec{
TemplateRef: &vrouterv1.NameRef{Name: "tmpl-only"},
TemplateRef: &vrouterv1.NameRef{Name: "tmpl-only"}, //nolint:staticcheck // deliberately exercises deprecated TemplateRef
},
}
refs := effectiveTemplateRefs(binding)
Expand All @@ -140,7 +140,7 @@ var _ = Describe("VRouterBinding Controller", func() {
It("should preserve namespace from templateRef", func() {
binding := &vrouterv1.VRouterBinding{
Spec: vrouterv1.VRouterBindingSpec{
TemplateRef: &vrouterv1.NameRef{Namespace: "ns-a", Name: "tmpl-a"},
TemplateRef: &vrouterv1.NameRef{Namespace: "ns-a", Name: "tmpl-a"}, //nolint:staticcheck // deliberately exercises deprecated TemplateRef
TemplateRefs: []vrouterv1.NameRef{{Namespace: "ns-b", Name: "tmpl-b"}},
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/vrouterconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (r *VRouterConfigReconciler) Reconcile(ctx context.Context, req ctrl.Reques
if err := r.Update(ctx, &cfg); err != nil {
return ctrl.Result{}, err
}
return ctrl.Result{Requeue: true}, nil
return ctrl.Result{RequeueAfter: time.Millisecond}, nil
}

return r.onChange(ctx, req, &cfg)
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ var _ = Describe("Manager", Ordered, Label("manager-e2e"), func() {
// enforce the restricted security policy to the namespace, installing CRDs,
// and deploying the controller.
BeforeAll(func() {
// Idempotent create: kubevirt-e2e/rollout-e2e may have already deployed
// the operator (make deploy creates this namespace), and Ginkgo
// randomizes top-level suite order.
By("creating manager namespace")
cmd := exec.Command("kubectl", "create", "ns", namespace)
cmd := exec.Command("sh", "-c",
"kubectl create ns "+namespace+" --dry-run=client -o yaml | kubectl apply -f -")
_, err := utils.Run(cmd)
Expect(err).NotTo(HaveOccurred(), "Failed to create namespace")

Expand Down