@@ -54,7 +54,14 @@ type DeleteOptions struct {
5454	Providers             []string 
5555}
5656
57- // Client is exposes the clusterctl high-level client library 
57+ // MoveOptions carries the options supported by move. 
58+ type  MoveOptions  struct  {
59+ 	FromKubeconfig  string 
60+ 	ToKubeconfig    string 
61+ 	Namespace       string 
62+ }
63+ 
64+ // Client is exposes the clusterctl high-level client library. 
5865type  Client  interface  {
5966	// GetProvidersConfig returns the list of providers configured for this instance of clusterctl. 
6067	GetProvidersConfig () ([]Provider , error )
@@ -70,6 +77,9 @@ type Client interface {
7077
7178	// Delete deletes providers from a management cluster. 
7279	Delete (options  DeleteOptions ) error 
80+ 
81+ 	// Move moves all the Cluster API objects existing in a namespace (or from all the namespaces if empty) to a target management cluster. 
82+ 	Move (options  MoveOptions ) error 
7383}
7484
7585// clusterctlClient implements Client. 
@@ -85,7 +95,7 @@ type ClusterClientFactory func(string) (cluster.Client, error)
8595// Ensure clusterctlClient implements Client. 
8696var  _  Client  =  & clusterctlClient {}
8797
88- // NewOptions carries the options supported by New 
98+ // NewOptions carries the options supported by New.  
8999type  NewOptions  struct  {
90100	injectConfig             config.Client 
91101	injectRepositoryFactory  RepositoryClientFactory 
@@ -130,7 +140,7 @@ func newClusterctlClient(path string, options ...Option) (*clusterctlClient, err
130140	}
131141
132142	// if there is an injected config, use it, otherwise use the default one 
133- 	// provided by the config low level library 
143+ 	// provided by the config low level library.  
134144	configClient  :=  cfg .injectConfig 
135145	if  configClient  ==  nil  {
136146		c , err  :=  config .New (path )
@@ -140,13 +150,13 @@ func newClusterctlClient(path string, options ...Option) (*clusterctlClient, err
140150		configClient  =  c 
141151	}
142152
143- 	// if there is an injected RepositoryFactory, use it, otherwise use a default one 
153+ 	// if there is an injected RepositoryFactory, use it, otherwise use a default one.  
144154	repositoryClientFactory  :=  cfg .injectRepositoryFactory 
145155	if  repositoryClientFactory  ==  nil  {
146156		repositoryClientFactory  =  defaultRepositoryFactory (configClient )
147157	}
148158
149- 	// if there is an injected ClusterFactory, use it, otherwise use a default one 
159+ 	// if there is an injected ClusterFactory, use it, otherwise use a default one.  
150160	clusterClientFactory  :=  cfg .injectClusterFactory 
151161	if  clusterClientFactory  ==  nil  {
152162		clusterClientFactory  =  defaultClusterFactory ()
@@ -159,14 +169,14 @@ func newClusterctlClient(path string, options ...Option) (*clusterctlClient, err
159169	}, nil 
160170}
161171
162- // defaultClusterFactory is a ClusterClientFactory func the uses the default client provided by the cluster low level library 
172+ // defaultClusterFactory is a ClusterClientFactory func the uses the default client provided by the cluster low level library.  
163173func  defaultClusterFactory () func (kubeconfig  string ) (cluster.Client , error ) {
164174	return  func (kubeconfig  string ) (cluster.Client , error ) {
165175		return  cluster .New (kubeconfig , cluster.Options {}), nil 
166176	}
167177}
168178
169- // defaultRepositoryFactory is a RepositoryClientFactory func the uses the default client provided by the repository low level library 
179+ // defaultRepositoryFactory is a RepositoryClientFactory func the uses the default client provided by the repository low level library.  
170180func  defaultRepositoryFactory (configClient  config.Client ) func (providerConfig  config.Provider ) (repository.Client , error ) {
171181	return  func (providerConfig  config.Provider ) (repository.Client , error ) {
172182		return  repository .New (providerConfig , configClient .Variables (), repository.Options {})
0 commit comments