Skip to content

✨clusterctl: move shared objects #2161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
21 changes: 6 additions & 15 deletions cmd/clusterctl/pkg/client/cluster/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ type Client interface {

// clusterClient implements Client.
type clusterClient struct {
kubeconfig string
proxy Proxy
machineWaiter MachineWaiter
kubeconfig string
proxy Proxy
}

// ensure clusterClient implements Client.
Expand Down Expand Up @@ -107,7 +106,7 @@ func (c *clusterClient) ProviderInstaller() ProviderInstaller {
func (c *clusterClient) ObjectMover() ObjectMover {
//TODO: make the logger to flow down all the chain
log := klogr.New()
return newObjectMover(c.proxy, c.machineWaiter, log)
return newObjectMover(c.proxy, log)
}

// New returns a cluster.Client.
Expand All @@ -122,23 +121,15 @@ func newClusterClient(kubeconfig string, options Options) *clusterClient {
proxy = newProxy(kubeconfig)
}

// if there is an injected machineWaiter, use it, otherwise use the default one
machineWaiter := options.InjectMachineWaiter
if machineWaiter == nil {
machineWaiter = waitForMachineReady
}

return &clusterClient{
kubeconfig: kubeconfig,
proxy: proxy,
machineWaiter: machineWaiter,
kubeconfig: kubeconfig,
proxy: proxy,
}
}

// Options allow to set ConfigClient options
type Options struct {
InjectProxy Proxy
InjectMachineWaiter MachineWaiter
InjectProxy Proxy
}

type Proxy interface {
Expand Down
Loading