-
Notifications
You must be signed in to change notification settings - Fork 90
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
Migration source and target implementations #124
Conversation
type FileSystemSourceOption func(*FileSystemSource) | ||
|
||
// FsWithFileSystem configures the filesystem to use. Used mostly for testing. | ||
func FsWithFileSystem(f afero.Fs) FileSystemSourceOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any fields other than the Fs
that we might configure (so that we may prefer to use an afero.Afero
as a parameter instead of an afero.Fs
in the functional option)?
// we need to add plural appendix to end of kind name | ||
Resource: strings.ToLower(gvk.Kind) + "s", | ||
}) | ||
unstructuredList, err := ri.List(context.TODO(), metav1.ListOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had better have an active context here. We should consider revising the Source & Target interfaces.
} | ||
|
||
// InitializeDynamicClient returns a dynamic client | ||
func InitializeDynamicClient(kubeconfigPath string) (dynamic.Interface, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We consider this as a utility to construct dynamic clients, is this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is correct!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sergenyalcin for the implementations. I think we are ready to merge them and do some further iterations as we gain more experience on the migration use cases and corner cases.
Because you are busy with support rotation, I can take care of rebasing the branch and merging it as is. Also the PR #119 that contains the base commit of this PR's feature branch has been merged.
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
9006a51
to
42eac94
Compare
Hi @sergenyalcin,
fs, err := NewFileSystemSource("testdata/source", FsWithFileSystem(files))
if err != nil {
t.Fatalf("Failed to initialize a new FileSystemSource: %v", err)
}
|
Description of your changes
Depends on #119
Related https://github.com/upbound/team-extensions/issues/29
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
Tested as part of upbound/team-control-planes#119