-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bab01e1
commit ff45832
Showing
15 changed files
with
223 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package fakes | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/weaveworks/weave-gitops/pkg/kube" | ||
"github.com/weaveworks/weave-gitops/pkg/services/applicationv2" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
var _ applicationv2.FetcherFactory = &FakeFetcherFactory{} | ||
var _ kube.ClientGetter = &FakeClientGetter{} | ||
var _ kube.KubeGetter = &FakeKubeGetter{} | ||
|
||
type FakeFetcherFactory struct { | ||
fake applicationv2.Fetcher | ||
} | ||
|
||
func NewFakeFetcherFactory(fake applicationv2.Fetcher) applicationv2.FetcherFactory { | ||
return &FakeFetcherFactory{ | ||
fake: fake, | ||
} | ||
} | ||
|
||
func (f *FakeFetcherFactory) Create(client client.Client) applicationv2.Fetcher { | ||
return f.fake | ||
} | ||
|
||
type FakeClientGetter struct { | ||
client client.Client | ||
} | ||
|
||
func NewFakeClientGetter(client client.Client) kube.ClientGetter { | ||
return &FakeClientGetter{ | ||
client: client, | ||
} | ||
} | ||
|
||
func (g *FakeClientGetter) Client(ctx context.Context) (client.Client, error) { | ||
return g.client, nil | ||
} | ||
|
||
type FakeKubeGetter struct { | ||
kube kube.Kube | ||
} | ||
|
||
func NewFakeKubeGetter(kube kube.Kube) kube.KubeGetter { | ||
return &FakeKubeGetter{ | ||
kube: kube, | ||
} | ||
} | ||
|
||
func (g *FakeKubeGetter) Kube(ctx context.Context) (kube.Kube, error) { | ||
return g.kube, nil | ||
} |
Oops, something went wrong.