File tree 11 files changed +20
-4
lines changed
11 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ kubeclient::generator::generate_client() {
41
41
42
42
SWAGGER_CODEGEN_COMMIT=" ${SWAGGER_CODEGEN_COMMIT:- v2.2.3} "
43
43
USERNAME=" ${USERNAME:- kubernetes} "
44
+ REPOSITORY=" ${REPOSITORY:- kubernetes} "
44
45
45
46
local output_dir=$1
46
47
pushd " ${output_dir} " > /dev/null
@@ -55,9 +56,9 @@ kubeclient::generator::generate_client() {
55
56
56
57
echo " --- Building docker image..."
57
58
if [ " ${USERNAME} " != " kubernetes" ]; then
58
- image_name=" kubernetes- ${USERNAME} -${CLIENT_LANGUAGE} -client-gen:v1"
59
+ image_name=" ${USERNAME} - ${REPOSITORY } -${CLIENT_LANGUAGE} -client-gen:v1"
59
60
else
60
- image_name=" kubernetes -${CLIENT_LANGUAGE} -client-gen:v1"
61
+ image_name=" ${REPOSITORY} -${CLIENT_LANGUAGE} -client-gen:v1"
61
62
fi
62
63
docker build " ${SCRIPT_ROOT} " -t " ${image_name} " \
63
64
--build-arg SWAGGER_CODEGEN_COMMIT=" ${SWAGGER_CODEGEN_COMMIT} " \
@@ -76,6 +77,7 @@ kubeclient::generator::generate_client() {
76
77
-e PACKAGE_NAME=" ${PACKAGE_NAME} " \
77
78
-e SWAGGER_CODEGEN_COMMIT=" ${SWAGGER_CODEGEN_COMMIT} " \
78
79
-e USERNAME=" ${USERNAME} " \
80
+ -e REPOSITORY=" ${REPOSITORY} " \
79
81
-v " ${output_dir} :/output_dir" \
80
82
" ${image_name} " " /output_dir"
81
83
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ if [ $# -ne 2 ]; then
28
28
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
29
29
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
30
30
echo " Setting file can define an optional USERNAME if you're working on a fork"
31
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
31
32
exit 1
32
33
fi
33
34
Original file line number Diff line number Diff line change 79
79
mkdir -p " ${output_dir} "
80
80
81
81
echo " --- Downloading and pre-processing OpenAPI spec"
82
- python " ${SCRIPT_ROOT} /preprocess_spec.py" " ${CLIENT_LANGUAGE} " " ${KUBERNETES_BRANCH} " " ${output_dir} /swagger.json" " ${USERNAME} "
82
+ python " ${SCRIPT_ROOT} /preprocess_spec.py" " ${CLIENT_LANGUAGE} " " ${KUBERNETES_BRANCH} " " ${output_dir} /swagger.json" " ${USERNAME} " " ${REPOSITORY} "
83
83
84
84
echo " --- Cleaning up previously generated folders"
85
85
for i in ${CLEANUP_DIRS} ; do
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ if [ $# -ne 2 ]; then
25
25
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
26
26
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
27
27
echo " Setting file can define an optional USERNAME if you're working on a fork"
28
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
28
29
exit 1
29
30
fi
30
31
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ if [ $# -ne 2 ]; then
25
25
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
26
26
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
27
27
echo " Setting file can define an optional USERNAME if you're working on a fork"
28
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
28
29
exit 1
29
30
fi
30
31
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ if [ $# -ne 2 ]; then
28
28
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
29
29
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
30
30
echo " Setting file can define an optional USERNAME if you're working on a fork"
31
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
31
32
exit 1
32
33
fi
33
34
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ if [ $# -ne 2 ]; then
25
25
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
26
26
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
27
27
echo " Setting file can define an optional USERNAME if you're working on a fork"
28
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
28
29
exit 1
29
30
fi
30
31
Original file line number Diff line number Diff line change @@ -302,10 +302,16 @@ def main():
302
302
help = 'Optional username if working on forks' ,
303
303
default = 'kubernetes'
304
304
)
305
+ argparser .add_argument (
306
+ 'repository' ,
307
+ help = 'Optional repository name if working with kubernetes ecosystem projects' ,
308
+ default = 'kubernetes'
309
+ )
305
310
args = argparser .parse_args ()
306
311
307
- spec_url = 'https://raw.githubusercontent.com/%s/kubernetes /' \
312
+ spec_url = 'https://raw.githubusercontent.com/%s/%s /' \
308
313
'%s/api/openapi-spec/swagger.json' % (args .username ,
314
+ args .repository ,
309
315
args .kubernetes_branch )
310
316
311
317
pool = urllib3 .PoolManager ()
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ if [ $# -ne 2 ]; then
25
25
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
26
26
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
27
27
echo " Setting file can define an optional USERNAME if you're working on a fork"
28
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
28
29
exit 1
29
30
fi
30
31
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ if [ $# -ne 2 ]; then
25
25
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
26
26
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
27
27
echo " Setting file can define an optional USERNAME if you're working on a fork"
28
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
28
29
exit 1
29
30
fi
30
31
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ if [ $# -ne 2 ]; then
25
25
echo " $( basename ${0} ) OUTPUT_DIR SETTING_FILE_PATH"
26
26
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
27
27
echo " Setting file can define an optional USERNAME if you're working on a fork"
28
+ echo " Setting file can define an optional REPOSITORY if you're working on a ecosystem project"
28
29
exit 1
29
30
fi
30
31
You can’t perform that action at this time.
0 commit comments