@@ -54,7 +54,14 @@ type DeleteOptions struct {
54
54
Providers []string
55
55
}
56
56
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.
58
65
type Client interface {
59
66
// GetProvidersConfig returns the list of providers configured for this instance of clusterctl.
60
67
GetProvidersConfig () ([]Provider , error )
@@ -70,6 +77,9 @@ type Client interface {
70
77
71
78
// Delete deletes providers from a management cluster.
72
79
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
73
83
}
74
84
75
85
// clusterctlClient implements Client.
@@ -85,7 +95,7 @@ type ClusterClientFactory func(string) (cluster.Client, error)
85
95
// Ensure clusterctlClient implements Client.
86
96
var _ Client = & clusterctlClient {}
87
97
88
- // NewOptions carries the options supported by New
98
+ // NewOptions carries the options supported by New.
89
99
type NewOptions struct {
90
100
injectConfig config.Client
91
101
injectRepositoryFactory RepositoryClientFactory
@@ -130,7 +140,7 @@ func newClusterctlClient(path string, options ...Option) (*clusterctlClient, err
130
140
}
131
141
132
142
// 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.
134
144
configClient := cfg .injectConfig
135
145
if configClient == nil {
136
146
c , err := config .New (path )
@@ -140,13 +150,13 @@ func newClusterctlClient(path string, options ...Option) (*clusterctlClient, err
140
150
configClient = c
141
151
}
142
152
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.
144
154
repositoryClientFactory := cfg .injectRepositoryFactory
145
155
if repositoryClientFactory == nil {
146
156
repositoryClientFactory = defaultRepositoryFactory (configClient )
147
157
}
148
158
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.
150
160
clusterClientFactory := cfg .injectClusterFactory
151
161
if clusterClientFactory == nil {
152
162
clusterClientFactory = defaultClusterFactory ()
@@ -159,14 +169,14 @@ func newClusterctlClient(path string, options ...Option) (*clusterctlClient, err
159
169
}, nil
160
170
}
161
171
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.
163
173
func defaultClusterFactory () func (kubeconfig string ) (cluster.Client , error ) {
164
174
return func (kubeconfig string ) (cluster.Client , error ) {
165
175
return cluster .New (kubeconfig , cluster.Options {}), nil
166
176
}
167
177
}
168
178
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.
170
180
func defaultRepositoryFactory (configClient config.Client ) func (providerConfig config.Provider ) (repository.Client , error ) {
171
181
return func (providerConfig config.Provider ) (repository.Client , error ) {
172
182
return repository .New (providerConfig , configClient .Variables (), repository.Options {})
0 commit comments