allow specifying a github username if working on forks (#58)

This commit is contained in:
Alessandro Ogier
2018-05-03 07:10:16 +02:00
committed by Brendan Burns
parent df8b843fb9
commit da2c88defb
11 changed files with 39 additions and 16 deletions

View File

@@ -297,10 +297,16 @@ def main():
'output_spec_path',
help='Path to otput spec file to'
)
argparser.add_argument(
'username',
help='Optional username if working on forks',
default='kubernetes'
)
args = argparser.parse_args()
spec_url = 'https://raw.githubusercontent.com/kubernetes/kubernetes/' \
'%s/api/openapi-spec/swagger.json' % args.kubernetes_branch
spec_url = 'https://raw.githubusercontent.com/%s/kubernetes/' \
'%s/api/openapi-spec/swagger.json' % (args.username,
args.kubernetes_branch)
pool = urllib3.PoolManager()
with pool.request('GET', spec_url, preload_content=False) as response: