Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Bojanowski <[email protected]>
  • Loading branch information
hidalgopl committed Feb 3, 2025
1 parent fa801a1 commit b47e3de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/syncer/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ func TestController(t *testing.T) {
syncer, err := NewMockSyncer(fakeContext)
assert.NilError(t, err)

assert.Check(t, fakeContext.Config.WorkloadConfig != nil)

syncController, err := NewSyncController(fakeContext, syncer)
assert.NilError(t, err)

Expand Down
6 changes: 6 additions & 0 deletions pkg/util/testing/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package testing
import (
vclusterconfig "github.com/loft-sh/vcluster/config"
"github.com/loft-sh/vcluster/pkg/config"
"k8s.io/client-go/rest"
)

const (
Expand Down Expand Up @@ -34,5 +35,10 @@ func NewFakeConfig() *config.VirtualClusterConfig {
panic(err.Error())
}

// SyncController builder expects non-nil WorkloadConfig
vConfig.WorkloadConfig = &rest.Config{
Host: "",
APIPath: "",
}
return vConfig
}

0 comments on commit b47e3de

Please sign in to comment.