Skip to content

Commit f05f8f8

Browse files
author
Yuvaraj Kakaraparthi
committed
fix test bug
1 parent ae2d194 commit f05f8f8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

internal/controllers/topology/cluster/conditions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
5555
s: &scope.Scope{
5656
HookResponseTracker: func() *scope.HookResponseTracker {
5757
hrt := scope.NewHookResponseTracker()
58-
hrt.Add("BeforeClusterUpgrade", &runtimehooksv1.BeforeClusterUpgradeResponse{
58+
hrt.Add(runtimehooksv1.BeforeClusterUpgrade, &runtimehooksv1.BeforeClusterUpgradeResponse{
5959
CommonRetryResponse: runtimehooksv1.CommonRetryResponse{
6060
RetryAfterSeconds: int32(10),
6161
},

internal/runtime/catalog/test/catalog_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"k8s.io/apimachinery/pkg/runtime"
2929
"k8s.io/apimachinery/pkg/runtime/schema"
3030

31+
"sigs.k8s.io/cluster-api/internal/runtime/catalog"
3132
runtimecatalog "sigs.k8s.io/cluster-api/internal/runtime/catalog"
3233
"sigs.k8s.io/cluster-api/internal/runtime/test/v1alpha1"
3334
"sigs.k8s.io/cluster-api/internal/runtime/test/v1alpha2"
@@ -175,6 +176,13 @@ func TestValidateResponse(t *testing.T) {
175176
}
176177
}
177178

179+
func TestHookName(t *testing.T) {
180+
g := NewWithT(t)
181+
expected := "FakeHook"
182+
actual := catalog.HookName(v1alpha1.FakeHook)
183+
g.Expect(actual).To(Equal(expected))
184+
}
185+
178186
type GoodRequest struct {
179187
metav1.TypeMeta `json:",inline"`
180188

0 commit comments

Comments
 (0)