Closed gabriel-farache closed 10 months ago
Thanks for making a pull request! 😃 One of the maintainers will review and advise on the next steps.
Attention: 1 lines
in your changes are missing coverage. Please review.
Comparison is base (
2e2bd55
) 14.55% compared to head (f895e95
) 14.48%.
Files | Patch % | Lines |
---|---|---|
internal/common/utils.go | 0.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@gabriel-farache Thanks for making the PR! A couple of questions:
max-upload-size
flag https://github.com/konveyor/move2kube-api/blob/2e2bd550826fb1bc60a2224abcb154fb60b2c05d/cmd/main/move2kubeapi.go#L60 ?It might require some changes in https://github.com/konveyor/move2kube to use something like https://confluence.atlassian.com/bbkb/how-to-check-your-repository-s-size-and-identify-large-files-1178867192.html $ git count-objects -vH
to limit the size.
We can return an error message if the size is too large.
@gabriel-farache Thanks for making the PR! A couple of questions:
- Is there a way to sanitize the remote source URL and make sure that it is a real git URL?
- Is there a way to limit the size of the cloned repo to respect the
max-upload-size flag
https://github.com/konveyor/move2kube-api/blob/2e2bd550826fb1bc60a2224abcb154fb60b2c05d/cmd/main/move2kubeapi.go#L60 ?It might require some changes in https://github.com/konveyor/move2kube to use something like https://confluence.atlassian.com/bbkb/how-to-check-your-repository-s-size-and-identify-large-files-1178867192.html
$ git count-objects -vH
to limit the size
@HarikrishnanBalagopal For the 1st point, yes it's doable
For the 2nd point it would be more complicated
To do it we would have to clone the repo then compute its size; so the storage will be taken for that amount of time.
If I am not wrong, the CLI is cloning the repo in /tmp then it deletes it.
So what is the requirements behind max-upload-size
?
@gabriel-farache The DCO for the PR has failed. To pass this test, could you please sign your commits?
@seshapad Sorry, I forgot the -s
in my commit command, it's done
@seshapad Sorry, I forgot the
-s
in my commit command, it's done
No worries. Thank you for addressing it.
@gabriel-farache Have implemented the size limit in CLI https://github.com/konveyor/move2kube/pull/1111
Added a --max-clone-size
flag to both the plan
and transform
commands.
It is the maximum size in bytes. Default is -1 where negative values mean infinite bytes.
In order to allow users to run Move2Kube with the API in a non-interactive mode, I added the
remote-source
query parameter in theplan
endpoint and theskip-qa
query parameter in theoutputs
endpoints.remote-source
is expected a git URL that will be used by the cmd.skip-qa
will set the the flagqa-skip
totrue
when executing the transformation cmd.This will allow CI pipeline to test the usage of M2K without any interaction or pre-configured file.
Needs https://github.com/konveyor/move2kube/pull/1109 to be merged as it fixes a missing default value for SSHKeys; when skipping the QA, it causes an error.