In the updateconfig plugin, we need to fetch the content of files before we upload them to the cluster inside of ConfigMaps. To encapsulate this behavior, we have an interface:
The implementation of this interface used by the plugin, however, uses GitHub to fetch the file contents:
It is possible, however, to simply load the files from disk if the appropriate version of the repository is checked out, as is done in the config-bootstrapper:
The current behavior of updateconfig is problematic as its token use scales linearly with the number of files changed that need to be uploaded. This allows for inadvertent DoS of the system by changing a large number of configuration files at once. The updateconfig plugin should be updated to clone the repository at the version that was pushed and use the local checkout to populate file contents.
/cc @cjwagner
/area prow/hook
/good-first-issue
@stevekuznetsov:
This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
/good-first-issue
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/help
/assign rajibmitra
@rajibmitra: GitHub didn't allow me to assign the following users: me.
Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide
In response to this:
/assign me
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/assign rajibmitra
@stevekuznetsov if I change the /updateconfig's gitHubFileGetter to osFileGetter , will it be able to
use the local checkout to populate file contents ?
You'll need to call git.Clone() first to populate the filesystem, then use the osFileGetter@
Most helpful comment
/assign rajibmitra