Moved jenkins code to its own package to fix import loop. Switch from
Disabled to Enabled (we preserve positive flags). Fix config tests.
Fix validation test.
... | ... |
@@ -885,7 +885,7 @@ |
885 | 885 |
"type": "string", |
886 | 886 |
"paramType": "query", |
887 | 887 |
"name": "asFile", |
888 |
- "description": "AsFile determines if the binary should be created as a file within the source rather than extracted as an archive", |
|
888 |
+ "description": "asFile determines if the binary should be created as a file within the source rather than extracted as an archive", |
|
889 | 889 |
"required": false, |
890 | 890 |
"allowMultiple": false |
891 | 891 |
}, |
... | ... |
@@ -893,7 +893,7 @@ |
893 | 893 |
"type": "string", |
894 | 894 |
"paramType": "query", |
895 | 895 |
"name": "revision.commit", |
896 |
- "description": "Commit is the value identifying a specific commit", |
|
896 |
+ "description": "revision.commit is the value identifying a specific commit", |
|
897 | 897 |
"required": false, |
898 | 898 |
"allowMultiple": false |
899 | 899 |
}, |
... | ... |
@@ -901,7 +901,7 @@ |
901 | 901 |
"type": "string", |
902 | 902 |
"paramType": "query", |
903 | 903 |
"name": "revision.message", |
904 |
- "description": "Message is the description of a specific commit", |
|
904 |
+ "description": "revision.message is the description of a specific commit", |
|
905 | 905 |
"required": false, |
906 | 906 |
"allowMultiple": false |
907 | 907 |
}, |
... | ... |
@@ -909,7 +909,7 @@ |
909 | 909 |
"type": "string", |
910 | 910 |
"paramType": "query", |
911 | 911 |
"name": "revision.authorName", |
912 |
- "description": "AuthorName of the source control user", |
|
912 |
+ "description": "revision.authorName of the source control user", |
|
913 | 913 |
"required": false, |
914 | 914 |
"allowMultiple": false |
915 | 915 |
}, |
... | ... |
@@ -917,7 +917,7 @@ |
917 | 917 |
"type": "string", |
918 | 918 |
"paramType": "query", |
919 | 919 |
"name": "revision.authorEmail", |
920 |
- "description": "AuthorEmail of the source control user", |
|
920 |
+ "description": "revision.authorEmail of the source control user", |
|
921 | 921 |
"required": false, |
922 | 922 |
"allowMultiple": false |
923 | 923 |
}, |
... | ... |
@@ -925,7 +925,7 @@ |
925 | 925 |
"type": "string", |
926 | 926 |
"paramType": "query", |
927 | 927 |
"name": "revision.committerName", |
928 |
- "description": "CommitterName of the source control user", |
|
928 |
+ "description": "revision.committerName of the source control user", |
|
929 | 929 |
"required": false, |
930 | 930 |
"allowMultiple": false |
931 | 931 |
}, |
... | ... |
@@ -933,7 +933,7 @@ |
933 | 933 |
"type": "string", |
934 | 934 |
"paramType": "query", |
935 | 935 |
"name": "revision.committerEmail", |
936 |
- "description": "CommitterEmail of the source control user", |
|
936 |
+ "description": "revision.committerEmail of the source control user", |
|
937 | 937 |
"required": false, |
938 | 938 |
"allowMultiple": false |
939 | 939 |
}, |
... | ... |
@@ -2004,7 +2004,7 @@ |
2004 | 2004 |
"type": "string", |
2005 | 2005 |
"paramType": "query", |
2006 | 2006 |
"name": "container", |
2007 |
- "description": "The container for which to stream logs. Defaults to only container if there is one container in the pod.", |
|
2007 |
+ "description": "cointainer for which to stream logs. Defaults to only container if there is one container in the pod.", |
|
2008 | 2008 |
"required": false, |
2009 | 2009 |
"allowMultiple": false |
2010 | 2010 |
}, |
... | ... |
@@ -2012,7 +2012,7 @@ |
2012 | 2012 |
"type": "boolean", |
2013 | 2013 |
"paramType": "query", |
2014 | 2014 |
"name": "follow", |
2015 |
- "description": "Follow if true indicates that the build log should be streamed until the build terminates.", |
|
2015 |
+ "description": "follow if true indicates that the build log should be streamed until the build terminates.", |
|
2016 | 2016 |
"required": false, |
2017 | 2017 |
"allowMultiple": false |
2018 | 2018 |
}, |
... | ... |
@@ -2020,7 +2020,7 @@ |
2020 | 2020 |
"type": "boolean", |
2021 | 2021 |
"paramType": "query", |
2022 | 2022 |
"name": "previous", |
2023 |
- "description": "Return previous build logs. Defaults to false.", |
|
2023 |
+ "description": "previous returns previous build logs. Defaults to false.", |
|
2024 | 2024 |
"required": false, |
2025 | 2025 |
"allowMultiple": false |
2026 | 2026 |
}, |
... | ... |
@@ -2028,7 +2028,7 @@ |
2028 | 2028 |
"type": "integer", |
2029 | 2029 |
"paramType": "query", |
2030 | 2030 |
"name": "sinceSeconds", |
2031 |
- "description": "A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", |
|
2031 |
+ "description": "sinceSeconds is a relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", |
|
2032 | 2032 |
"required": false, |
2033 | 2033 |
"allowMultiple": false |
2034 | 2034 |
}, |
... | ... |
@@ -2036,7 +2036,7 @@ |
2036 | 2036 |
"type": "string", |
2037 | 2037 |
"paramType": "query", |
2038 | 2038 |
"name": "sinceTime", |
2039 |
- "description": "An RFC3339 timestamp from which to show logs. If this value preceeds the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", |
|
2039 |
+ "description": "sinceTime is an RFC3339 timestamp from which to show logs. If this value preceeds the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", |
|
2040 | 2040 |
"required": false, |
2041 | 2041 |
"allowMultiple": false |
2042 | 2042 |
}, |
... | ... |
@@ -2044,7 +2044,7 @@ |
2044 | 2044 |
"type": "boolean", |
2045 | 2045 |
"paramType": "query", |
2046 | 2046 |
"name": "timestamps", |
2047 |
- "description": "If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.", |
|
2047 |
+ "description": "timestamps, If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.", |
|
2048 | 2048 |
"required": false, |
2049 | 2049 |
"allowMultiple": false |
2050 | 2050 |
}, |
... | ... |
@@ -2052,7 +2052,7 @@ |
2052 | 2052 |
"type": "integer", |
2053 | 2053 |
"paramType": "query", |
2054 | 2054 |
"name": "tailLines", |
2055 |
- "description": "If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime", |
|
2055 |
+ "description": "tailLines, If set, is the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime", |
|
2056 | 2056 |
"required": false, |
2057 | 2057 |
"allowMultiple": false |
2058 | 2058 |
}, |
... | ... |
@@ -2060,7 +2060,7 @@ |
2060 | 2060 |
"type": "integer", |
2061 | 2061 |
"paramType": "query", |
2062 | 2062 |
"name": "limitBytes", |
2063 |
- "description": "If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.", |
|
2063 |
+ "description": "limitBytes, If set, is the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.", |
|
2064 | 2064 |
"required": false, |
2065 | 2065 |
"allowMultiple": false |
2066 | 2066 |
}, |
... | ... |
@@ -2068,7 +2068,7 @@ |
2068 | 2068 |
"type": "boolean", |
2069 | 2069 |
"paramType": "query", |
2070 | 2070 |
"name": "nowait", |
2071 |
- "description": "NoWait if true causes the call to return immediately even if the build is not available yet. Otherwise the server will wait until the build has started.", |
|
2071 |
+ "description": "noWait if true causes the call to return immediately even if the build is not available yet. Otherwise the server will wait until the build has started.", |
|
2072 | 2072 |
"required": false, |
2073 | 2073 |
"allowMultiple": false |
2074 | 2074 |
}, |
... | ... |
@@ -2076,7 +2076,7 @@ |
2076 | 2076 |
"type": "integer", |
2077 | 2077 |
"paramType": "query", |
2078 | 2078 |
"name": "version", |
2079 |
- "description": "Version of the build for which to view logs.", |
|
2079 |
+ "description": "version of the build for which to view logs.", |
|
2080 | 2080 |
"required": false, |
2081 | 2081 |
"allowMultiple": false |
2082 | 2082 |
}, |
... | ... |
@@ -13365,7 +13365,7 @@ |
13365 | 13365 |
{ |
13366 | 13366 |
"type": "v1.ProjectList", |
13367 | 13367 |
"method": "GET", |
13368 |
- "summary": "list objects of kind Project", |
|
13368 |
+ "summary": "list or watch objects of kind Project", |
|
13369 | 13369 |
"nickname": "listProject", |
13370 | 13370 |
"parameters": [ |
13371 | 13371 |
{ |
... | ... |
@@ -13473,6 +13473,81 @@ |
13473 | 13473 |
] |
13474 | 13474 |
}, |
13475 | 13475 |
{ |
13476 |
+ "path": "/oapi/v1/watch/projects", |
|
13477 |
+ "description": "OpenShift REST API, version v1", |
|
13478 |
+ "operations": [ |
|
13479 |
+ { |
|
13480 |
+ "type": "json.WatchEvent", |
|
13481 |
+ "method": "GET", |
|
13482 |
+ "summary": "watch individual changes to a list of Project", |
|
13483 |
+ "nickname": "watchProjectList", |
|
13484 |
+ "parameters": [ |
|
13485 |
+ { |
|
13486 |
+ "type": "string", |
|
13487 |
+ "paramType": "query", |
|
13488 |
+ "name": "pretty", |
|
13489 |
+ "description": "If 'true', then the output is pretty printed.", |
|
13490 |
+ "required": false, |
|
13491 |
+ "allowMultiple": false |
|
13492 |
+ }, |
|
13493 |
+ { |
|
13494 |
+ "type": "string", |
|
13495 |
+ "paramType": "query", |
|
13496 |
+ "name": "labelSelector", |
|
13497 |
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", |
|
13498 |
+ "required": false, |
|
13499 |
+ "allowMultiple": false |
|
13500 |
+ }, |
|
13501 |
+ { |
|
13502 |
+ "type": "string", |
|
13503 |
+ "paramType": "query", |
|
13504 |
+ "name": "fieldSelector", |
|
13505 |
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", |
|
13506 |
+ "required": false, |
|
13507 |
+ "allowMultiple": false |
|
13508 |
+ }, |
|
13509 |
+ { |
|
13510 |
+ "type": "boolean", |
|
13511 |
+ "paramType": "query", |
|
13512 |
+ "name": "watch", |
|
13513 |
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", |
|
13514 |
+ "required": false, |
|
13515 |
+ "allowMultiple": false |
|
13516 |
+ }, |
|
13517 |
+ { |
|
13518 |
+ "type": "string", |
|
13519 |
+ "paramType": "query", |
|
13520 |
+ "name": "resourceVersion", |
|
13521 |
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", |
|
13522 |
+ "required": false, |
|
13523 |
+ "allowMultiple": false |
|
13524 |
+ }, |
|
13525 |
+ { |
|
13526 |
+ "type": "integer", |
|
13527 |
+ "paramType": "query", |
|
13528 |
+ "name": "timeoutSeconds", |
|
13529 |
+ "description": "Timeout for the list/watch call.", |
|
13530 |
+ "required": false, |
|
13531 |
+ "allowMultiple": false |
|
13532 |
+ } |
|
13533 |
+ ], |
|
13534 |
+ "responseMessages": [ |
|
13535 |
+ { |
|
13536 |
+ "code": 200, |
|
13537 |
+ "message": "OK", |
|
13538 |
+ "responseModel": "json.WatchEvent" |
|
13539 |
+ } |
|
13540 |
+ ], |
|
13541 |
+ "produces": [ |
|
13542 |
+ "application/json" |
|
13543 |
+ ], |
|
13544 |
+ "consumes": [ |
|
13545 |
+ "*/*" |
|
13546 |
+ ] |
|
13547 |
+ } |
|
13548 |
+ ] |
|
13549 |
+ }, |
|
13550 |
+ { |
|
13476 | 13551 |
"path": "/oapi/v1/projects/{name}", |
13477 | 13552 |
"description": "OpenShift REST API, version v1", |
13478 | 13553 |
"operations": [ |
... | ... |
@@ -13649,6 +13724,89 @@ |
13649 | 13649 |
] |
13650 | 13650 |
}, |
13651 | 13651 |
{ |
13652 |
+ "path": "/oapi/v1/watch/projects/{name}", |
|
13653 |
+ "description": "OpenShift REST API, version v1", |
|
13654 |
+ "operations": [ |
|
13655 |
+ { |
|
13656 |
+ "type": "json.WatchEvent", |
|
13657 |
+ "method": "GET", |
|
13658 |
+ "summary": "watch changes to an object of kind Project", |
|
13659 |
+ "nickname": "watchProject", |
|
13660 |
+ "parameters": [ |
|
13661 |
+ { |
|
13662 |
+ "type": "string", |
|
13663 |
+ "paramType": "query", |
|
13664 |
+ "name": "pretty", |
|
13665 |
+ "description": "If 'true', then the output is pretty printed.", |
|
13666 |
+ "required": false, |
|
13667 |
+ "allowMultiple": false |
|
13668 |
+ }, |
|
13669 |
+ { |
|
13670 |
+ "type": "string", |
|
13671 |
+ "paramType": "query", |
|
13672 |
+ "name": "labelSelector", |
|
13673 |
+ "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", |
|
13674 |
+ "required": false, |
|
13675 |
+ "allowMultiple": false |
|
13676 |
+ }, |
|
13677 |
+ { |
|
13678 |
+ "type": "string", |
|
13679 |
+ "paramType": "query", |
|
13680 |
+ "name": "fieldSelector", |
|
13681 |
+ "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", |
|
13682 |
+ "required": false, |
|
13683 |
+ "allowMultiple": false |
|
13684 |
+ }, |
|
13685 |
+ { |
|
13686 |
+ "type": "boolean", |
|
13687 |
+ "paramType": "query", |
|
13688 |
+ "name": "watch", |
|
13689 |
+ "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", |
|
13690 |
+ "required": false, |
|
13691 |
+ "allowMultiple": false |
|
13692 |
+ }, |
|
13693 |
+ { |
|
13694 |
+ "type": "string", |
|
13695 |
+ "paramType": "query", |
|
13696 |
+ "name": "resourceVersion", |
|
13697 |
+ "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.", |
|
13698 |
+ "required": false, |
|
13699 |
+ "allowMultiple": false |
|
13700 |
+ }, |
|
13701 |
+ { |
|
13702 |
+ "type": "integer", |
|
13703 |
+ "paramType": "query", |
|
13704 |
+ "name": "timeoutSeconds", |
|
13705 |
+ "description": "Timeout for the list/watch call.", |
|
13706 |
+ "required": false, |
|
13707 |
+ "allowMultiple": false |
|
13708 |
+ }, |
|
13709 |
+ { |
|
13710 |
+ "type": "string", |
|
13711 |
+ "paramType": "path", |
|
13712 |
+ "name": "name", |
|
13713 |
+ "description": "name of the Project", |
|
13714 |
+ "required": true, |
|
13715 |
+ "allowMultiple": false |
|
13716 |
+ } |
|
13717 |
+ ], |
|
13718 |
+ "responseMessages": [ |
|
13719 |
+ { |
|
13720 |
+ "code": 200, |
|
13721 |
+ "message": "OK", |
|
13722 |
+ "responseModel": "json.WatchEvent" |
|
13723 |
+ } |
|
13724 |
+ ], |
|
13725 |
+ "produces": [ |
|
13726 |
+ "application/json" |
|
13727 |
+ ], |
|
13728 |
+ "consumes": [ |
|
13729 |
+ "*/*" |
|
13730 |
+ ] |
|
13731 |
+ } |
|
13732 |
+ ] |
|
13733 |
+ }, |
|
13734 |
+ { |
|
13652 | 13735 |
"path": "/oapi/v1/namespaces/{namespace}/resourceaccessreviews", |
13653 | 13736 |
"description": "OpenShift REST API, version v1", |
13654 | 13737 |
"operations": [ |
... | ... |
@@ -17228,14 +17386,14 @@ |
17228 | 17228 |
}, |
17229 | 17229 |
"metadata": { |
17230 | 17230 |
"$ref": "unversioned.ListMeta", |
17231 |
- "description": "Standard object's metadata." |
|
17231 |
+ "description": "metadata for BuildConfigList." |
|
17232 | 17232 |
}, |
17233 | 17233 |
"items": { |
17234 | 17234 |
"type": "array", |
17235 | 17235 |
"items": { |
17236 | 17236 |
"$ref": "v1.BuildConfig" |
17237 | 17237 |
}, |
17238 |
- "description": "Items is a list of build configs" |
|
17238 |
+ "description": "items is a list of build configs" |
|
17239 | 17239 |
} |
17240 | 17240 |
} |
17241 | 17241 |
}, |
... | ... |
@@ -17271,15 +17429,15 @@ |
17271 | 17271 |
}, |
17272 | 17272 |
"metadata": { |
17273 | 17273 |
"$ref": "v1.ObjectMeta", |
17274 |
- "description": "Standard object's metadata." |
|
17274 |
+ "description": "metadata for BuildConfig." |
|
17275 | 17275 |
}, |
17276 | 17276 |
"spec": { |
17277 | 17277 |
"$ref": "v1.BuildConfigSpec", |
17278 |
- "description": "Spec holds all the input necessary to produce a new build, and the conditions when to trigger them." |
|
17278 |
+ "description": "spec holds all the input necessary to produce a new build, and the conditions when to trigger them." |
|
17279 | 17279 |
}, |
17280 | 17280 |
"status": { |
17281 | 17281 |
"$ref": "v1.BuildConfigStatus", |
17282 |
- "description": "Status holds any relevant information about a build config" |
|
17282 |
+ "description": "status holds any relevant information about a build config" |
|
17283 | 17283 |
} |
17284 | 17284 |
} |
17285 | 17285 |
}, |
... | ... |
@@ -17352,40 +17510,40 @@ |
17352 | 17352 |
"items": { |
17353 | 17353 |
"$ref": "v1.BuildTriggerPolicy" |
17354 | 17354 |
}, |
17355 |
- "description": "Triggers determine how new Builds can be launched from a BuildConfig. If no triggers are defined, a new build can only occur as a result of an explicit client build creation." |
|
17355 |
+ "description": "triggers determine how new Builds can be launched from a BuildConfig. If no triggers are defined, a new build can only occur as a result of an explicit client build creation." |
|
17356 | 17356 |
}, |
17357 | 17357 |
"serviceAccount": { |
17358 | 17358 |
"type": "string", |
17359 |
- "description": "ServiceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount" |
|
17359 |
+ "description": "serviceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount" |
|
17360 | 17360 |
}, |
17361 | 17361 |
"source": { |
17362 | 17362 |
"$ref": "v1.BuildSource", |
17363 |
- "description": "Source describes the SCM in use." |
|
17363 |
+ "description": "source describes the SCM in use." |
|
17364 | 17364 |
}, |
17365 | 17365 |
"revision": { |
17366 | 17366 |
"$ref": "v1.SourceRevision", |
17367 |
- "description": "Revision is the information from the source for a specific repo snapshot. This is optional." |
|
17367 |
+ "description": "revision is the information from the source for a specific repo snapshot. This is optional." |
|
17368 | 17368 |
}, |
17369 | 17369 |
"strategy": { |
17370 | 17370 |
"$ref": "v1.BuildStrategy", |
17371 |
- "description": "Strategy defines how to perform a build." |
|
17371 |
+ "description": "strategy defines how to perform a build." |
|
17372 | 17372 |
}, |
17373 | 17373 |
"output": { |
17374 | 17374 |
"$ref": "v1.BuildOutput", |
17375 |
- "description": "Output describes the Docker image the Strategy should produce." |
|
17375 |
+ "description": "output describes the Docker image the Strategy should produce." |
|
17376 | 17376 |
}, |
17377 | 17377 |
"resources": { |
17378 | 17378 |
"$ref": "v1.ResourceRequirements", |
17379 |
- "description": "Compute resource requirements to execute the build" |
|
17379 |
+ "description": "resource requirements to execute the build" |
|
17380 | 17380 |
}, |
17381 | 17381 |
"postCommit": { |
17382 | 17382 |
"$ref": "v1.BuildPostCommitSpec", |
17383 |
- "description": "PostCommit is a build hook executed after the build output image is committed, before it is pushed to a registry." |
|
17383 |
+ "description": "postCommit is a build hook executed after the build output image is committed, before it is pushed to a registry." |
|
17384 | 17384 |
}, |
17385 | 17385 |
"completionDeadlineSeconds": { |
17386 | 17386 |
"type": "integer", |
17387 | 17387 |
"format": "int64", |
17388 |
- "description": "Optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer" |
|
17388 |
+ "description": "completionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer" |
|
17389 | 17389 |
} |
17390 | 17390 |
} |
17391 | 17391 |
}, |
... | ... |
@@ -17398,19 +17556,19 @@ |
17398 | 17398 |
"properties": { |
17399 | 17399 |
"type": { |
17400 | 17400 |
"type": "string", |
17401 |
- "description": "Type is the type of build trigger" |
|
17401 |
+ "description": "type is the type of build trigger" |
|
17402 | 17402 |
}, |
17403 | 17403 |
"github": { |
17404 | 17404 |
"$ref": "v1.WebHookTrigger", |
17405 |
- "description": "GitHubWebHook contains the parameters for a GitHub webhook type of trigger" |
|
17405 |
+ "description": "github contains the parameters for a GitHub webhook type of trigger" |
|
17406 | 17406 |
}, |
17407 | 17407 |
"generic": { |
17408 | 17408 |
"$ref": "v1.WebHookTrigger", |
17409 |
- "description": "GenericWebHook contains the parameters for a Generic webhook type of trigger" |
|
17409 |
+ "description": "generic contains the parameters for a Generic webhook type of trigger" |
|
17410 | 17410 |
}, |
17411 | 17411 |
"imageChange": { |
17412 | 17412 |
"$ref": "v1.ImageChangeTrigger", |
17413 |
- "description": "ImageChange contains parameters for an ImageChange type of trigger" |
|
17413 |
+ "description": "imageChange contains parameters for an ImageChange type of trigger" |
|
17414 | 17414 |
} |
17415 | 17415 |
} |
17416 | 17416 |
}, |
... | ... |
@@ -17420,7 +17578,11 @@ |
17420 | 17420 |
"properties": { |
17421 | 17421 |
"secret": { |
17422 | 17422 |
"type": "string", |
17423 |
- "description": "Secret used to validate requests." |
|
17423 |
+ "description": "secret used to validate requests." |
|
17424 |
+ }, |
|
17425 |
+ "allowEnv": { |
|
17426 |
+ "type": "boolean", |
|
17427 |
+ "description": "allowEnv determines whether the webhook can set environment variables; can only be set to true for GenericWebHook." |
|
17424 | 17428 |
} |
17425 | 17429 |
} |
17426 | 17430 |
}, |
... | ... |
@@ -17430,11 +17592,11 @@ |
17430 | 17430 |
"properties": { |
17431 | 17431 |
"lastTriggeredImageID": { |
17432 | 17432 |
"type": "string", |
17433 |
- "description": "LastTriggeredImageID is used internally by the ImageChangeController to save last used image ID for build" |
|
17433 |
+ "description": "lastTriggeredImageID is used internally by the ImageChangeController to save last used image ID for build" |
|
17434 | 17434 |
}, |
17435 | 17435 |
"from": { |
17436 | 17436 |
"$ref": "v1.ObjectReference", |
17437 |
- "description": "From is a reference to an ImageStreamTag that will trigger a build when updated It is optional. If no From is specified, the From image from the build strategy will be used. Only one ImageChangeTrigger with an empty From reference is allowed in a build configuration." |
|
17437 |
+ "description": "from is a reference to an ImageStreamTag that will trigger a build when updated It is optional. If no From is specified, the From image from the build strategy will be used. Only one ImageChangeTrigger with an empty From reference is allowed in a build configuration." |
|
17438 | 17438 |
} |
17439 | 17439 |
} |
17440 | 17440 |
}, |
... | ... |
@@ -17482,41 +17644,41 @@ |
17482 | 17482 |
"properties": { |
17483 | 17483 |
"type": { |
17484 | 17484 |
"type": "string", |
17485 |
- "description": "Type of build input to accept" |
|
17485 |
+ "description": "type of build input to accept" |
|
17486 | 17486 |
}, |
17487 | 17487 |
"binary": { |
17488 | 17488 |
"$ref": "v1.BinaryBuildSource", |
17489 |
- "description": "Binary builds accept a binary as their input. The binary is generally assumed to be a tar, gzipped tar, or zip file depending on the strategy. For Docker builds, this is the build context and an optional Dockerfile may be specified to override any Dockerfile in the build context. For Source builds, this is assumed to be an archive as described above. For Source and Docker builds, if binary.asFile is set the build will receive a directory with a single file. contextDir may be used when an archive is provided. Custom builds will receive this binary as input on STDIN." |
|
17489 |
+ "description": "binary builds accept a binary as their input. The binary is generally assumed to be a tar, gzipped tar, or zip file depending on the strategy. For Docker builds, this is the build context and an optional Dockerfile may be specified to override any Dockerfile in the build context. For Source builds, this is assumed to be an archive as described above. For Source and Docker builds, if binary.asFile is set the build will receive a directory with a single file. contextDir may be used when an archive is provided. Custom builds will receive this binary as input on STDIN." |
|
17490 | 17490 |
}, |
17491 | 17491 |
"dockerfile": { |
17492 | 17492 |
"type": "string", |
17493 |
- "description": "Dockerfile is the raw contents of a Dockerfile which should be built. When this option is specified, the FROM may be modified based on your strategy base image and additional ENV stanzas from your strategy environment will be added after the FROM, but before the rest of your Dockerfile stanzas. The Dockerfile source type may be used with other options like git - in those cases the Git repo will have any innate Dockerfile replaced in the context dir." |
|
17493 |
+ "description": "dockerfile is the raw contents of a Dockerfile which should be built. When this option is specified, the FROM may be modified based on your strategy base image and additional ENV stanzas from your strategy environment will be added after the FROM, but before the rest of your Dockerfile stanzas. The Dockerfile source type may be used with other options like git - in those cases the Git repo will have any innate Dockerfile replaced in the context dir." |
|
17494 | 17494 |
}, |
17495 | 17495 |
"git": { |
17496 | 17496 |
"$ref": "v1.GitBuildSource", |
17497 |
- "description": "Git contains optional information about git build source" |
|
17497 |
+ "description": "git contains optional information about git build source" |
|
17498 | 17498 |
}, |
17499 | 17499 |
"images": { |
17500 | 17500 |
"type": "array", |
17501 | 17501 |
"items": { |
17502 | 17502 |
"$ref": "v1.ImageSource" |
17503 | 17503 |
}, |
17504 |
- "description": "Images describes a set of images to be used to provide source for the build" |
|
17504 |
+ "description": "images describes a set of images to be used to provide source for the build" |
|
17505 | 17505 |
}, |
17506 | 17506 |
"contextDir": { |
17507 | 17507 |
"type": "string", |
17508 |
- "description": "ContextDir specifies the sub-directory where the source code for the application exists. This allows to have buildable sources in directory other than root of repository." |
|
17508 |
+ "description": "contextDir specifies the sub-directory where the source code for the application exists. This allows to have buildable sources in directory other than root of repository." |
|
17509 | 17509 |
}, |
17510 | 17510 |
"sourceSecret": { |
17511 | 17511 |
"$ref": "v1.LocalObjectReference", |
17512 |
- "description": "SourceSecret is the name of a Secret that would be used for setting up the authentication for cloning private repository. The secret contains valid credentials for remote repository, where the data's key represent the authentication method to be used and value is the base64 encoded credentials. Supported auth methods are: ssh-privatekey." |
|
17512 |
+ "description": "sourceSecret is the name of a Secret that would be used for setting up the authentication for cloning private repository. The secret contains valid credentials for remote repository, where the data's key represent the authentication method to be used and value is the base64 encoded credentials. Supported auth methods are: ssh-privatekey." |
|
17513 | 17513 |
}, |
17514 | 17514 |
"secrets": { |
17515 | 17515 |
"type": "array", |
17516 | 17516 |
"items": { |
17517 | 17517 |
"$ref": "v1.SecretBuildSource" |
17518 | 17518 |
}, |
17519 |
- "description": "Secrets represents a list of secrets and their destinations that will be used only for the build." |
|
17519 |
+ "description": "secrets represents a list of secrets and their destinations that will be used only for the build." |
|
17520 | 17520 |
} |
17521 | 17521 |
} |
17522 | 17522 |
}, |
... | ... |
@@ -17526,7 +17688,7 @@ |
17526 | 17526 |
"properties": { |
17527 | 17527 |
"asFile": { |
17528 | 17528 |
"type": "string", |
17529 |
- "description": "AsFile indicates that the provided binary input should be considered a single file within the build input. For example, specifying \"webapp.war\" would place the provided binary as `/webapp.war` for the builder. If left empty, the Docker and Source build strategies assume this file is a zip, tar, or tar.gz file and extract it as the source. The custom strategy receives this binary as standard input. This filename may not contain slashes or be '..' or '.'." |
|
17529 |
+ "description": "asFile indicates that the provided binary input should be considered a single file within the build input. For example, specifying \"webapp.war\" would place the provided binary as `/webapp.war` for the builder. If left empty, the Docker and Source build strategies assume this file is a zip, tar, or tar.gz file and extract it as the source. The custom strategy receives this binary as standard input. This filename may not contain slashes or be '..' or '.'." |
|
17530 | 17530 |
} |
17531 | 17531 |
} |
17532 | 17532 |
}, |
... | ... |
@@ -17539,19 +17701,19 @@ |
17539 | 17539 |
"properties": { |
17540 | 17540 |
"uri": { |
17541 | 17541 |
"type": "string", |
17542 |
- "description": "URI points to the source that will be built. The structure of the source will depend on the type of build to run" |
|
17542 |
+ "description": "uri points to the source that will be built. The structure of the source will depend on the type of build to run" |
|
17543 | 17543 |
}, |
17544 | 17544 |
"ref": { |
17545 | 17545 |
"type": "string", |
17546 |
- "description": "Ref is the branch/tag/ref to build." |
|
17546 |
+ "description": "ref is the branch/tag/ref to build." |
|
17547 | 17547 |
}, |
17548 | 17548 |
"httpProxy": { |
17549 | 17549 |
"type": "string", |
17550 |
- "description": "HTTPProxy is a proxy used to reach the git repository over http" |
|
17550 |
+ "description": "httpProxy is a proxy used to reach the git repository over http" |
|
17551 | 17551 |
}, |
17552 | 17552 |
"httpsProxy": { |
17553 | 17553 |
"type": "string", |
17554 |
- "description": "HTTPSProxy is a proxy used to reach the git repository over https" |
|
17554 |
+ "description": "httpsProxy is a proxy used to reach the git repository over https" |
|
17555 | 17555 |
} |
17556 | 17556 |
} |
17557 | 17557 |
}, |
... | ... |
@@ -17565,18 +17727,18 @@ |
17565 | 17565 |
"properties": { |
17566 | 17566 |
"from": { |
17567 | 17567 |
"$ref": "v1.ObjectReference", |
17568 |
- "description": "From is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from." |
|
17568 |
+ "description": "from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from." |
|
17569 | 17569 |
}, |
17570 | 17570 |
"paths": { |
17571 | 17571 |
"type": "array", |
17572 | 17572 |
"items": { |
17573 | 17573 |
"$ref": "v1.ImageSourcePath" |
17574 | 17574 |
}, |
17575 |
- "description": "Paths is a list of source and destination paths to copy from the image." |
|
17575 |
+ "description": "paths is a list of source and destination paths to copy from the image." |
|
17576 | 17576 |
}, |
17577 | 17577 |
"pullSecret": { |
17578 | 17578 |
"$ref": "v1.LocalObjectReference", |
17579 |
- "description": "PullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set." |
|
17579 |
+ "description": "pullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set." |
|
17580 | 17580 |
} |
17581 | 17581 |
} |
17582 | 17582 |
}, |
... | ... |
@@ -17590,11 +17752,11 @@ |
17590 | 17590 |
"properties": { |
17591 | 17591 |
"sourcePath": { |
17592 | 17592 |
"type": "string", |
17593 |
- "description": "SourcePath is the absolute path of the file or directory inside the image to copy to the build directory." |
|
17593 |
+ "description": "sourcePath is the absolute path of the file or directory inside the image to copy to the build directory." |
|
17594 | 17594 |
}, |
17595 | 17595 |
"destinationDir": { |
17596 | 17596 |
"type": "string", |
17597 |
- "description": "DestinationDir is the relative directory within the build directory where files copied from the image are placed." |
|
17597 |
+ "description": "destinationDir is the relative directory within the build directory where files copied from the image are placed." |
|
17598 | 17598 |
} |
17599 | 17599 |
} |
17600 | 17600 |
}, |
... | ... |
@@ -17617,11 +17779,11 @@ |
17617 | 17617 |
"properties": { |
17618 | 17618 |
"secret": { |
17619 | 17619 |
"$ref": "v1.LocalObjectReference", |
17620 |
- "description": "Secret is a reference to an existing secret that you want to use in your build." |
|
17620 |
+ "description": "secret is a reference to an existing secret that you want to use in your build." |
|
17621 | 17621 |
}, |
17622 | 17622 |
"destinationDir": { |
17623 | 17623 |
"type": "string", |
17624 |
- "description": "DestinationDir is the directory where the files from the secret should be available for the build time. For the Source build strategy, these will be injected into a container where the assemble script runs. Later, when the script finishes, all files injected will be truncated to zero length. For the Docker build strategy, these will be copied into the build directory, where the Dockerfile is located, so users can ADD or COPY them during docker build." |
|
17624 |
+ "description": "destinationDir is the directory where the files from the secret should be available for the build time. For the Source build strategy, these will be injected into a container where the assemble script runs. Later, when the script finishes, all files injected will be truncated to zero length. For the Docker build strategy, these will be copied into the build directory, where the Dockerfile is located, so users can ADD or COPY them during docker build." |
|
17625 | 17625 |
} |
17626 | 17626 |
} |
17627 | 17627 |
}, |
... | ... |
@@ -17634,7 +17796,7 @@ |
17634 | 17634 |
"properties": { |
17635 | 17635 |
"type": { |
17636 | 17636 |
"type": "string", |
17637 |
- "description": "Type of the build source" |
|
17637 |
+ "description": "type of the build source" |
|
17638 | 17638 |
}, |
17639 | 17639 |
"git": { |
17640 | 17640 |
"$ref": "v1.GitSourceRevision", |
... | ... |
@@ -17648,19 +17810,19 @@ |
17648 | 17648 |
"properties": { |
17649 | 17649 |
"commit": { |
17650 | 17650 |
"type": "string", |
17651 |
- "description": "Commit is the commit hash identifying a specific commit" |
|
17651 |
+ "description": "commit is the commit hash identifying a specific commit" |
|
17652 | 17652 |
}, |
17653 | 17653 |
"author": { |
17654 | 17654 |
"$ref": "v1.SourceControlUser", |
17655 |
- "description": "Author is the author of a specific commit" |
|
17655 |
+ "description": "author is the author of a specific commit" |
|
17656 | 17656 |
}, |
17657 | 17657 |
"committer": { |
17658 | 17658 |
"$ref": "v1.SourceControlUser", |
17659 |
- "description": "Committer is the committer of a specific commit" |
|
17659 |
+ "description": "committer is the committer of a specific commit" |
|
17660 | 17660 |
}, |
17661 | 17661 |
"message": { |
17662 | 17662 |
"type": "string", |
17663 |
- "description": "Message is the description of a specific commit" |
|
17663 |
+ "description": "message is the description of a specific commit" |
|
17664 | 17664 |
} |
17665 | 17665 |
} |
17666 | 17666 |
}, |
... | ... |
@@ -17670,11 +17832,11 @@ |
17670 | 17670 |
"properties": { |
17671 | 17671 |
"name": { |
17672 | 17672 |
"type": "string", |
17673 |
- "description": "Name of the source control user" |
|
17673 |
+ "description": "name of the source control user" |
|
17674 | 17674 |
}, |
17675 | 17675 |
"email": { |
17676 | 17676 |
"type": "string", |
17677 |
- "description": "Email of the source control user" |
|
17677 |
+ "description": "email of the source control user" |
|
17678 | 17678 |
} |
17679 | 17679 |
} |
17680 | 17680 |
}, |
... | ... |
@@ -17687,19 +17849,23 @@ |
17687 | 17687 |
"properties": { |
17688 | 17688 |
"type": { |
17689 | 17689 |
"type": "string", |
17690 |
- "description": "Type is the kind of build strategy." |
|
17690 |
+ "description": "type is the kind of build strategy." |
|
17691 | 17691 |
}, |
17692 | 17692 |
"dockerStrategy": { |
17693 | 17693 |
"$ref": "v1.DockerBuildStrategy", |
17694 |
- "description": "DockerStrategy holds the parameters to the Docker build strategy." |
|
17694 |
+ "description": "dockerStrategy holds the parameters to the Docker build strategy." |
|
17695 | 17695 |
}, |
17696 | 17696 |
"sourceStrategy": { |
17697 | 17697 |
"$ref": "v1.SourceBuildStrategy", |
17698 |
- "description": "SourceStrategy holds the parameters to the Source build strategy." |
|
17698 |
+ "description": "sourceStrategy holds the parameters to the Source build strategy." |
|
17699 | 17699 |
}, |
17700 | 17700 |
"customStrategy": { |
17701 | 17701 |
"$ref": "v1.CustomBuildStrategy", |
17702 |
- "description": "CustomStrategy holds the parameters to the Custom build strategy" |
|
17702 |
+ "description": "customStrategy holds the parameters to the Custom build strategy" |
|
17703 |
+ }, |
|
17704 |
+ "jenkinsPipelineStrategy": { |
|
17705 |
+ "$ref": "v1.JenkinsPipelineBuildStrategy", |
|
17706 |
+ "description": "JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline build strategy. This strategy is experimental." |
|
17703 | 17707 |
} |
17704 | 17708 |
} |
17705 | 17709 |
}, |
... | ... |
@@ -17709,30 +17875,30 @@ |
17709 | 17709 |
"properties": { |
17710 | 17710 |
"from": { |
17711 | 17711 |
"$ref": "v1.ObjectReference", |
17712 |
- "description": "From is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled the resulting image will be used in the FROM line of the Dockerfile for this build." |
|
17712 |
+ "description": "from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled the resulting image will be used in the FROM line of the Dockerfile for this build." |
|
17713 | 17713 |
}, |
17714 | 17714 |
"pullSecret": { |
17715 | 17715 |
"$ref": "v1.LocalObjectReference", |
17716 |
- "description": "PullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries" |
|
17716 |
+ "description": "pullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries" |
|
17717 | 17717 |
}, |
17718 | 17718 |
"noCache": { |
17719 | 17719 |
"type": "boolean", |
17720 |
- "description": "NoCache if set to true indicates that the docker build must be executed with the --no-cache=true flag" |
|
17720 |
+ "description": "noCache if set to true indicates that the docker build must be executed with the --no-cache=true flag" |
|
17721 | 17721 |
}, |
17722 | 17722 |
"env": { |
17723 | 17723 |
"type": "array", |
17724 | 17724 |
"items": { |
17725 | 17725 |
"$ref": "v1.EnvVar" |
17726 | 17726 |
}, |
17727 |
- "description": "Env contains additional environment variables you want to pass into a builder container" |
|
17727 |
+ "description": "env contains additional environment variables you want to pass into a builder container" |
|
17728 | 17728 |
}, |
17729 | 17729 |
"forcePull": { |
17730 | 17730 |
"type": "boolean", |
17731 |
- "description": "ForcePull describes if the builder should pull the images from registry prior to building." |
|
17731 |
+ "description": "forcePull describes if the builder should pull the images from registry prior to building." |
|
17732 | 17732 |
}, |
17733 | 17733 |
"dockerfilePath": { |
17734 | 17734 |
"type": "string", |
17735 |
- "description": "DockerfilePath is the path of the Dockerfile that will be used to build the Docker image, relative to the root of the context (contextDir)." |
|
17735 |
+ "description": "dockerfilePath is the path of the Dockerfile that will be used to build the Docker image, relative to the root of the context (contextDir)." |
|
17736 | 17736 |
} |
17737 | 17737 |
} |
17738 | 17738 |
}, |
... | ... |
@@ -17835,30 +18001,30 @@ |
17835 | 17835 |
"properties": { |
17836 | 17836 |
"from": { |
17837 | 17837 |
"$ref": "v1.ObjectReference", |
17838 |
- "description": "From is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled" |
|
17838 |
+ "description": "from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled" |
|
17839 | 17839 |
}, |
17840 | 17840 |
"pullSecret": { |
17841 | 17841 |
"$ref": "v1.LocalObjectReference", |
17842 |
- "description": "PullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries" |
|
17842 |
+ "description": "pullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries" |
|
17843 | 17843 |
}, |
17844 | 17844 |
"env": { |
17845 | 17845 |
"type": "array", |
17846 | 17846 |
"items": { |
17847 | 17847 |
"$ref": "v1.EnvVar" |
17848 | 17848 |
}, |
17849 |
- "description": "Env contains additional environment variables you want to pass into a builder container" |
|
17849 |
+ "description": "env contains additional environment variables you want to pass into a builder container" |
|
17850 | 17850 |
}, |
17851 | 17851 |
"scripts": { |
17852 | 17852 |
"type": "string", |
17853 |
- "description": "Scripts is the location of Source scripts" |
|
17853 |
+ "description": "scripts is the location of Source scripts" |
|
17854 | 17854 |
}, |
17855 | 17855 |
"incremental": { |
17856 | 17856 |
"type": "boolean", |
17857 |
- "description": "Incremental flag forces the Source build to do incremental builds if true." |
|
17857 |
+ "description": "incremental flag forces the Source build to do incremental builds if true." |
|
17858 | 17858 |
}, |
17859 | 17859 |
"forcePull": { |
17860 | 17860 |
"type": "boolean", |
17861 |
- "description": "ForcePull describes if the builder should pull the images from registry prior to building." |
|
17861 |
+ "description": "forcePull describes if the builder should pull the images from registry prior to building." |
|
17862 | 17862 |
} |
17863 | 17863 |
} |
17864 | 17864 |
}, |
... | ... |
@@ -17871,37 +18037,37 @@ |
17871 | 17871 |
"properties": { |
17872 | 17872 |
"from": { |
17873 | 17873 |
"$ref": "v1.ObjectReference", |
17874 |
- "description": "From is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled" |
|
17874 |
+ "description": "from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled" |
|
17875 | 17875 |
}, |
17876 | 17876 |
"pullSecret": { |
17877 | 17877 |
"$ref": "v1.LocalObjectReference", |
17878 |
- "description": "PullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries" |
|
17878 |
+ "description": "pullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries" |
|
17879 | 17879 |
}, |
17880 | 17880 |
"env": { |
17881 | 17881 |
"type": "array", |
17882 | 17882 |
"items": { |
17883 | 17883 |
"$ref": "v1.EnvVar" |
17884 | 17884 |
}, |
17885 |
- "description": "Env contains additional environment variables you want to pass into a builder container" |
|
17885 |
+ "description": "env contains additional environment variables you want to pass into a builder container" |
|
17886 | 17886 |
}, |
17887 | 17887 |
"exposeDockerSocket": { |
17888 | 17888 |
"type": "boolean", |
17889 |
- "description": "ExposeDockerSocket will allow running Docker commands (and build Docker images) from inside the Docker container." |
|
17889 |
+ "description": "exposeDockerSocket will allow running Docker commands (and build Docker images) from inside the Docker container." |
|
17890 | 17890 |
}, |
17891 | 17891 |
"forcePull": { |
17892 | 17892 |
"type": "boolean", |
17893 |
- "description": "ForcePull describes if the controller should configure the build pod to always pull the images for the builder or only pull if it is not present locally" |
|
17893 |
+ "description": "forcePull describes if the controller should configure the build pod to always pull the images for the builder or only pull if it is not present locally" |
|
17894 | 17894 |
}, |
17895 | 17895 |
"secrets": { |
17896 | 17896 |
"type": "array", |
17897 | 17897 |
"items": { |
17898 | 17898 |
"$ref": "v1.SecretSpec" |
17899 | 17899 |
}, |
17900 |
- "description": "Secrets is a list of additional secrets that will be included in the build pod" |
|
17900 |
+ "description": "secrets is a list of additional secrets that will be included in the build pod" |
|
17901 | 17901 |
}, |
17902 | 17902 |
"buildAPIVersion": { |
17903 | 17903 |
"type": "string", |
17904 |
- "description": "BuildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder" |
|
17904 |
+ "description": "buildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder" |
|
17905 | 17905 |
} |
17906 | 17906 |
} |
17907 | 17907 |
}, |
... | ... |
@@ -17915,11 +18081,25 @@ |
17915 | 17915 |
"properties": { |
17916 | 17916 |
"secretSource": { |
17917 | 17917 |
"$ref": "v1.LocalObjectReference", |
17918 |
- "description": "SecretSource is a reference to the secret" |
|
17918 |
+ "description": "secretSource is a reference to the secret" |
|
17919 | 17919 |
}, |
17920 | 17920 |
"mountPath": { |
17921 | 17921 |
"type": "string", |
17922 |
- "description": "MountPath is the path at which to mount the secret" |
|
17922 |
+ "description": "mountPath is the path at which to mount the secret" |
|
17923 |
+ } |
|
17924 |
+ } |
|
17925 |
+ }, |
|
17926 |
+ "v1.JenkinsPipelineBuildStrategy": { |
|
17927 |
+ "id": "v1.JenkinsPipelineBuildStrategy", |
|
17928 |
+ "description": "JenkinsPipelineBuildStrategy holds parameters specific to a Jenkins Pipeline build. This strategy is experimental.", |
|
17929 |
+ "properties": { |
|
17930 |
+ "jenkinsfilePath": { |
|
17931 |
+ "type": "string", |
|
17932 |
+ "description": "JenkinsfilePath is the optional path of the Jenkinsfile that will be used to configure the pipeline relative to the root of the context (contextDir). If both JenkinsfilePath \u0026 Jenkinsfile are both not specified, this defaults to Jenkinsfile in the root of the specified contextDir." |
|
17933 |
+ }, |
|
17934 |
+ "jenkinsfile": { |
|
17935 |
+ "type": "string", |
|
17936 |
+ "description": "Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines a Jenkins pipeline build." |
|
17923 | 17937 |
} |
17924 | 17938 |
} |
17925 | 17939 |
}, |
... | ... |
@@ -17929,7 +18109,7 @@ |
17929 | 17929 |
"properties": { |
17930 | 17930 |
"to": { |
17931 | 17931 |
"$ref": "v1.ObjectReference", |
17932 |
- "description": "To defines an optional location to push the output of this build to. Kind must be one of 'ImageStreamTag' or 'DockerImage'. This value will be used to look up a Docker image repository to push to. In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of the build unless Namespace is specified." |
|
17932 |
+ "description": "to defines an optional location to push the output of this build to. Kind must be one of 'ImageStreamTag' or 'DockerImage'. This value will be used to look up a Docker image repository to push to. In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of the build unless Namespace is specified." |
|
17933 | 17933 |
}, |
17934 | 17934 |
"pushSecret": { |
17935 | 17935 |
"$ref": "v1.LocalObjectReference", |
... | ... |
@@ -17960,18 +18140,18 @@ |
17960 | 17960 |
"items": { |
17961 | 17961 |
"type": "string" |
17962 | 17962 |
}, |
17963 |
- "description": "Command is the command to run. It may not be specified with Script. This might be needed if the image doesn't have `/bin/sh`, or if you do not want to use a shell. In all other cases, using Script might be more convenient." |
|
17963 |
+ "description": "command is the command to run. It may not be specified with Script. This might be needed if the image doesn't have `/bin/sh`, or if you do not want to use a shell. In all other cases, using Script might be more convenient." |
|
17964 | 17964 |
}, |
17965 | 17965 |
"args": { |
17966 | 17966 |
"type": "array", |
17967 | 17967 |
"items": { |
17968 | 17968 |
"type": "string" |
17969 | 17969 |
}, |
17970 |
- "description": "Args is a list of arguments that are provided to either Command, Script or the Docker image's default entrypoint. The arguments are placed immediately after the command to be run." |
|
17970 |
+ "description": "args is a list of arguments that are provided to either Command, Script or the Docker image's default entrypoint. The arguments are placed immediately after the command to be run." |
|
17971 | 17971 |
}, |
17972 | 17972 |
"script": { |
17973 | 17973 |
"type": "string", |
17974 |
- "description": "Script is a shell script to be run with `/bin/sh -ic`. It may not be specified with Command. Use Script when a shell script is appropriate to execute the post build hook, for example for running unit tests with `rake test`. If you need control over the image entrypoint, or if the image does not have `/bin/sh`, use Command and/or Args. The `-i` flag is needed to support CentOS and RHEL images that use Software Collections (SCL), in order to have the appropriate collections enabled in the shell. E.g., in the Ruby image, this is necessary to make `ruby`, `bundle` and other binaries available in the PATH." |
|
17974 |
+ "description": "script is a shell script to be run with `/bin/sh -ic`. It may not be specified with Command. Use Script when a shell script is appropriate to execute the post build hook, for example for running unit tests with `rake test`. If you need control over the image entrypoint, or if the image does not have `/bin/sh`, use Command and/or Args. The `-i` flag is needed to support CentOS and RHEL images that use Software Collections (SCL), in order to have the appropriate collections enabled in the shell. E.g., in the Ruby image, this is necessary to make `ruby`, `bundle` and other binaries available in the PATH." |
|
17975 | 17975 |
} |
17976 | 17976 |
} |
17977 | 17977 |
}, |
... | ... |
@@ -17985,7 +18165,7 @@ |
17985 | 17985 |
"lastVersion": { |
17986 | 17986 |
"type": "integer", |
17987 | 17987 |
"format": "int32", |
17988 |
- "description": "LastVersion is used to inform about number of last triggered build." |
|
17988 |
+ "description": "lastVersion is used to inform about number of last triggered build." |
|
17989 | 17989 |
} |
17990 | 17990 |
} |
17991 | 17991 |
}, |
... | ... |
@@ -18145,35 +18325,35 @@ |
18145 | 18145 |
}, |
18146 | 18146 |
"metadata": { |
18147 | 18147 |
"$ref": "v1.ObjectMeta", |
18148 |
- "description": "Standard object's metadata." |
|
18148 |
+ "description": "metadata for BuildRequest." |
|
18149 | 18149 |
}, |
18150 | 18150 |
"revision": { |
18151 | 18151 |
"$ref": "v1.SourceRevision", |
18152 |
- "description": "Revision is the information from the source for a specific repo snapshot." |
|
18152 |
+ "description": "revision is the information from the source for a specific repo snapshot." |
|
18153 | 18153 |
}, |
18154 | 18154 |
"triggeredByImage": { |
18155 | 18155 |
"$ref": "v1.ObjectReference", |
18156 |
- "description": "TriggeredByImage is the Image that triggered this build." |
|
18156 |
+ "description": "triggeredByImage is the Image that triggered this build." |
|
18157 | 18157 |
}, |
18158 | 18158 |
"from": { |
18159 | 18159 |
"$ref": "v1.ObjectReference", |
18160 |
- "description": "From is the reference to the ImageStreamTag that triggered the build." |
|
18160 |
+ "description": "from is the reference to the ImageStreamTag that triggered the build." |
|
18161 | 18161 |
}, |
18162 | 18162 |
"binary": { |
18163 | 18163 |
"$ref": "v1.BinaryBuildSource", |
18164 |
- "description": "Binary indicates a request to build from a binary provided to the builder" |
|
18164 |
+ "description": "binary indicates a request to build from a binary provided to the builder" |
|
18165 | 18165 |
}, |
18166 | 18166 |
"lastVersion": { |
18167 | 18167 |
"type": "integer", |
18168 | 18168 |
"format": "int32", |
18169 |
- "description": "LastVersion (optional) is the LastVersion of the BuildConfig that was used to generate the build. If the BuildConfig in the generator doesn't match, a build will not be generated." |
|
18169 |
+ "description": "lastVersion (optional) is the LastVersion of the BuildConfig that was used to generate the build. If the BuildConfig in the generator doesn't match, a build will not be generated." |
|
18170 | 18170 |
}, |
18171 | 18171 |
"env": { |
18172 | 18172 |
"type": "array", |
18173 | 18173 |
"items": { |
18174 | 18174 |
"$ref": "v1.EnvVar" |
18175 | 18175 |
}, |
18176 |
- "description": "Env contains additional environment variables you want to pass into a builder container" |
|
18176 |
+ "description": "env contains additional environment variables you want to pass into a builder container" |
|
18177 | 18177 |
} |
18178 | 18178 |
} |
18179 | 18179 |
}, |
... | ... |
@@ -18194,14 +18374,14 @@ |
18194 | 18194 |
}, |
18195 | 18195 |
"metadata": { |
18196 | 18196 |
"$ref": "unversioned.ListMeta", |
18197 |
- "description": "Standard object's metadata." |
|
18197 |
+ "description": "metadata for BuildList." |
|
18198 | 18198 |
}, |
18199 | 18199 |
"items": { |
18200 | 18200 |
"type": "array", |
18201 | 18201 |
"items": { |
18202 | 18202 |
"$ref": "v1.Build" |
18203 | 18203 |
}, |
18204 |
- "description": "Items is a list of builds" |
|
18204 |
+ "description": "items is a list of builds" |
|
18205 | 18205 |
} |
18206 | 18206 |
} |
18207 | 18207 |
}, |
... | ... |
@@ -18223,11 +18403,11 @@ |
18223 | 18223 |
}, |
18224 | 18224 |
"spec": { |
18225 | 18225 |
"$ref": "v1.BuildSpec", |
18226 |
- "description": "Spec is all the inputs used to execute the build." |
|
18226 |
+ "description": "spec is all the inputs used to execute the build." |
|
18227 | 18227 |
}, |
18228 | 18228 |
"status": { |
18229 | 18229 |
"$ref": "v1.BuildStatus", |
18230 |
- "description": "Status is the current status of the build." |
|
18230 |
+ "description": "status is the current status of the build." |
|
18231 | 18231 |
} |
18232 | 18232 |
} |
18233 | 18233 |
}, |
... | ... |
@@ -18240,36 +18420,36 @@ |
18240 | 18240 |
"properties": { |
18241 | 18241 |
"serviceAccount": { |
18242 | 18242 |
"type": "string", |
18243 |
- "description": "ServiceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount" |
|
18243 |
+ "description": "serviceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount" |
|
18244 | 18244 |
}, |
18245 | 18245 |
"source": { |
18246 | 18246 |
"$ref": "v1.BuildSource", |
18247 |
- "description": "Source describes the SCM in use." |
|
18247 |
+ "description": "source describes the SCM in use." |
|
18248 | 18248 |
}, |
18249 | 18249 |
"revision": { |
18250 | 18250 |
"$ref": "v1.SourceRevision", |
18251 |
- "description": "Revision is the information from the source for a specific repo snapshot. This is optional." |
|
18251 |
+ "description": "revision is the information from the source for a specific repo snapshot. This is optional." |
|
18252 | 18252 |
}, |
18253 | 18253 |
"strategy": { |
18254 | 18254 |
"$ref": "v1.BuildStrategy", |
18255 |
- "description": "Strategy defines how to perform a build." |
|
18255 |
+ "description": "strategy defines how to perform a build." |
|
18256 | 18256 |
}, |
18257 | 18257 |
"output": { |
18258 | 18258 |
"$ref": "v1.BuildOutput", |
18259 |
- "description": "Output describes the Docker image the Strategy should produce." |
|
18259 |
+ "description": "output describes the Docker image the Strategy should produce." |
|
18260 | 18260 |
}, |
18261 | 18261 |
"resources": { |
18262 | 18262 |
"$ref": "v1.ResourceRequirements", |
18263 |
- "description": "Compute resource requirements to execute the build" |
|
18263 |
+ "description": "resource requirements to execute the build" |
|
18264 | 18264 |
}, |
18265 | 18265 |
"postCommit": { |
18266 | 18266 |
"$ref": "v1.BuildPostCommitSpec", |
18267 |
- "description": "PostCommit is a build hook executed after the build output image is committed, before it is pushed to a registry." |
|
18267 |
+ "description": "postCommit is a build hook executed after the build output image is committed, before it is pushed to a registry." |
|
18268 | 18268 |
}, |
18269 | 18269 |
"completionDeadlineSeconds": { |
18270 | 18270 |
"type": "integer", |
18271 | 18271 |
"format": "int64", |
18272 |
- "description": "Optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer" |
|
18272 |
+ "description": "completionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer" |
|
18273 | 18273 |
} |
18274 | 18274 |
} |
18275 | 18275 |
}, |
... | ... |
@@ -18282,39 +18462,39 @@ |
18282 | 18282 |
"properties": { |
18283 | 18283 |
"phase": { |
18284 | 18284 |
"type": "string", |
18285 |
- "description": "Phase is the point in the build lifecycle." |
|
18285 |
+ "description": "phase is the point in the build lifecycle." |
|
18286 | 18286 |
}, |
18287 | 18287 |
"cancelled": { |
18288 | 18288 |
"type": "boolean", |
18289 |
- "description": "Cancelled describes if a cancel event was triggered for the build." |
|
18289 |
+ "description": "cancelled describes if a cancel event was triggered for the build." |
|
18290 | 18290 |
}, |
18291 | 18291 |
"reason": { |
18292 | 18292 |
"type": "string", |
18293 |
- "description": "Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI." |
|
18293 |
+ "description": "reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI." |
|
18294 | 18294 |
}, |
18295 | 18295 |
"message": { |
18296 | 18296 |
"type": "string", |
18297 |
- "description": "Message is a human-readable message indicating details about why the build has this status." |
|
18297 |
+ "description": "message is a human-readable message indicating details about why the build has this status." |
|
18298 | 18298 |
}, |
18299 | 18299 |
"startTimestamp": { |
18300 | 18300 |
"type": "string", |
18301 |
- "description": "StartTimestamp is a timestamp representing the server time when this Build started running in a Pod. It is represented in RFC3339 form and is in UTC." |
|
18301 |
+ "description": "startTimestamp is a timestamp representing the server time when this Build started running in a Pod. It is represented in RFC3339 form and is in UTC." |
|
18302 | 18302 |
}, |
18303 | 18303 |
"completionTimestamp": { |
18304 | 18304 |
"type": "string", |
18305 |
- "description": "CompletionTimestamp is a timestamp representing the server time when this Build was finished, whether that build failed or succeeded. It reflects the time at which the Pod running the Build terminated. It is represented in RFC3339 form and is in UTC." |
|
18305 |
+ "description": "completionTimestamp is a timestamp representing the server time when this Build was finished, whether that build failed or succeeded. It reflects the time at which the Pod running the Build terminated. It is represented in RFC3339 form and is in UTC." |
|
18306 | 18306 |
}, |
18307 | 18307 |
"duration": { |
18308 | 18308 |
"$ref": "time.Duration", |
18309 |
- "description": "Duration contains time.Duration object describing build time." |
|
18309 |
+ "description": "duration contains time.Duration object describing build time." |
|
18310 | 18310 |
}, |
18311 | 18311 |
"outputDockerImageReference": { |
18312 | 18312 |
"type": "string", |
18313 |
- "description": "OutputDockerImageReference contains a reference to the Docker image that will be built by this build. Its value is computed from Build.Spec.Output.To, and should include the registry address, so that it can be used to push and pull the image." |
|
18313 |
+ "description": "outputDockerImageReference contains a reference to the Docker image that will be built by this build. Its value is computed from Build.Spec.Output.To, and should include the registry address, so that it can be used to push and pull the image." |
|
18314 | 18314 |
}, |
18315 | 18315 |
"config": { |
18316 | 18316 |
"$ref": "v1.ObjectReference", |
18317 |
- "description": "Config is an ObjectReference to the BuildConfig this Build is based on." |
|
18317 |
+ "description": "config is an ObjectReference to the BuildConfig this Build is based on." |
|
18318 | 18318 |
} |
18319 | 18319 |
} |
18320 | 18320 |
}, |
... | ... |
@@ -1742,6 +1742,7 @@ func TestValidateBuildSpec(t *testing.T) { |
1742 | 1742 |
}, |
1743 | 1743 |
}, |
1744 | 1744 |
// 25 |
1745 |
+ // path must be shorter than 100k |
|
1745 | 1746 |
{ |
1746 | 1747 |
string(field.ErrorTypeInvalid) + "strategy.jenkinsPipelineStrategy.jenkinsfile", |
1747 | 1748 |
&buildapi.BuildSpec{ |
... | ... |
@@ -1752,23 +1753,7 @@ func TestValidateBuildSpec(t *testing.T) { |
1752 | 1752 |
}, |
1753 | 1753 |
Strategy: buildapi.BuildStrategy{ |
1754 | 1754 |
JenkinsPipelineStrategy: &buildapi.JenkinsPipelineBuildStrategy{ |
1755 |
- Jenkinsfile: longString, |
|
1756 |
- }, |
|
1757 |
- }, |
|
1758 |
- }, |
|
1759 |
- }, |
|
1760 |
- // 26 |
|
1761 |
- { |
|
1762 |
- string(field.ErrorTypeInvalid) + "strategy.jenkinsPipelineStrategy.jenkinsfile", |
|
1763 |
- &buildapi.BuildSpec{ |
|
1764 |
- Source: buildapi.BuildSource{ |
|
1765 |
- Git: &buildapi.GitBuildSource{ |
|
1766 |
- URI: "http://github.com/my/repository", |
|
1767 |
- }, |
|
1768 |
- }, |
|
1769 |
- Strategy: buildapi.BuildStrategy{ |
|
1770 |
- JenkinsPipelineStrategy: &buildapi.JenkinsPipelineBuildStrategy{ |
|
1771 |
- Jenkinsfile: longString, |
|
1755 |
+ Jenkinsfile: longString + longString, |
|
1772 | 1756 |
}, |
1773 | 1757 |
}, |
1774 | 1758 |
}, |
... | ... |
@@ -12,8 +12,8 @@ import ( |
12 | 12 |
|
13 | 13 |
buildapi "github.com/openshift/origin/pkg/build/api" |
14 | 14 |
buildclient "github.com/openshift/origin/pkg/build/client" |
15 |
+ "github.com/openshift/origin/pkg/build/controller/jenkins" |
|
15 | 16 |
buildgenerator "github.com/openshift/origin/pkg/build/generator" |
16 |
- buildutil "github.com/openshift/origin/pkg/build/util" |
|
17 | 17 |
"github.com/openshift/origin/pkg/client" |
18 | 18 |
osclient "github.com/openshift/origin/pkg/client" |
19 | 19 |
serverapi "github.com/openshift/origin/pkg/cmd/server/api" |
... | ... |
@@ -64,8 +64,7 @@ func (c *BuildConfigController) HandleBuildConfig(bc *buildapi.BuildConfig) erro |
64 | 64 |
return nil |
65 | 65 |
} |
66 | 66 |
|
67 |
- isDisabled := c.JenkinsConfig.Disabled |
|
68 |
- if isDisabled != nil && *isDisabled { |
|
67 |
+ if b := c.JenkinsConfig.Enabled; b == nil || !*b { |
|
69 | 68 |
glog.V(4).Infof("Provisioning Jenkins Pipeline from a template is disabled in master configuration") |
70 | 69 |
return nil |
71 | 70 |
} |
... | ... |
@@ -80,18 +79,18 @@ func (c *BuildConfigController) HandleBuildConfig(bc *buildapi.BuildConfig) erro |
80 | 80 |
return fmt.Errorf("unable to get openshift client from %v", c.KubeClient) |
81 | 81 |
} |
82 | 82 |
|
83 |
- jenkinsTemplate := buildutil.NewJenkinsPipelineTemplate(bc.Namespace, c.JenkinsConfig, kc, oc) |
|
83 |
+ jenkinsTemplate := jenkins.NewPipelineTemplate(bc.Namespace, c.JenkinsConfig, kc, oc) |
|
84 | 84 |
objects, errs := jenkinsTemplate.Process() |
85 | 85 |
if len(errs) > 0 { |
86 | 86 |
for _, err := range errs { |
87 |
- c.Recorder.Eventf(bc, kapi.EventTypeWarning, "Failed", "Processing %s/%s error: %v", c.JenkinsConfig.Namespace, c.JenkinsConfig.TemplateName, err) |
|
87 |
+ c.Recorder.Eventf(bc, kapi.EventTypeWarning, "Failed", "Processing %s/%s error: %v", c.JenkinsConfig.TemplateNamespace, c.JenkinsConfig.TemplateName, err) |
|
88 | 88 |
} |
89 | 89 |
return fmt.Errorf("processing Jenkins pipeline template failed") |
90 | 90 |
} |
91 | 91 |
|
92 | 92 |
if errs := jenkinsTemplate.Instantiate(objects); len(errs) > 0 { |
93 | 93 |
for _, err := range errs { |
94 |
- c.Recorder.Eventf(bc, kapi.EventTypeWarning, "Failed", "Instantiating %s/%s error: %v", c.JenkinsConfig.Namespace, c.JenkinsConfig.TemplateName, err) |
|
94 |
+ c.Recorder.Eventf(bc, kapi.EventTypeWarning, "Failed", "Instantiating %s/%s error: %v", c.JenkinsConfig.TemplateNamespace, c.JenkinsConfig.TemplateName, err) |
|
95 | 95 |
} |
96 | 96 |
return fmt.Errorf("instantiating Jenkins pipeline template failed") |
97 | 97 |
} |
98 | 98 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,139 @@ |
0 |
+package jenkins |
|
1 |
+ |
|
2 |
+import ( |
|
3 |
+ "fmt" |
|
4 |
+ |
|
5 |
+ "github.com/golang/glog" |
|
6 |
+ |
|
7 |
+ kapi "k8s.io/kubernetes/pkg/api" |
|
8 |
+ kerrs "k8s.io/kubernetes/pkg/api/errors" |
|
9 |
+ "k8s.io/kubernetes/pkg/api/meta" |
|
10 |
+ "k8s.io/kubernetes/pkg/api/unversioned" |
|
11 |
+ kclient "k8s.io/kubernetes/pkg/client/unversioned" |
|
12 |
+ "k8s.io/kubernetes/pkg/kubectl/resource" |
|
13 |
+ "k8s.io/kubernetes/pkg/runtime" |
|
14 |
+ |
|
15 |
+ "github.com/openshift/origin/pkg/api/latest" |
|
16 |
+ "github.com/openshift/origin/pkg/client" |
|
17 |
+ serverapi "github.com/openshift/origin/pkg/cmd/server/api" |
|
18 |
+ "github.com/openshift/origin/pkg/config/cmd" |
|
19 |
+ "github.com/openshift/origin/pkg/template" |
|
20 |
+ templateapi "github.com/openshift/origin/pkg/template/api" |
|
21 |
+) |
|
22 |
+ |
|
23 |
+// PipelineTemplate stores the configuration of the |
|
24 |
+// PipelineStrategy template, used to instantiate the Jenkins service in |
|
25 |
+// given namespace. |
|
26 |
+type PipelineTemplate struct { |
|
27 |
+ Config serverapi.JenkinsPipelineConfig |
|
28 |
+ Namespace string |
|
29 |
+ kubeClient *kclient.Client |
|
30 |
+ osClient *client.Client |
|
31 |
+} |
|
32 |
+ |
|
33 |
+// NewPipelineTemplate returns a new PipelineTemplate. |
|
34 |
+func NewPipelineTemplate(ns string, conf serverapi.JenkinsPipelineConfig, kubeClient *kclient.Client, osClient *client.Client) *PipelineTemplate { |
|
35 |
+ return &PipelineTemplate{ |
|
36 |
+ Config: conf, |
|
37 |
+ Namespace: ns, |
|
38 |
+ kubeClient: kubeClient, |
|
39 |
+ osClient: osClient, |
|
40 |
+ } |
|
41 |
+} |
|
42 |
+ |
|
43 |
+// Process processes the Jenkins template. If an error occurs |
|
44 |
+func (t *PipelineTemplate) Process() (*kapi.List, []error) { |
|
45 |
+ var errors []error |
|
46 |
+ jenkinsTemplate, err := t.osClient.Templates(t.Config.TemplateNamespace).Get(t.Config.TemplateName) |
|
47 |
+ if err != nil { |
|
48 |
+ if kerrs.IsNotFound(err) { |
|
49 |
+ errors = append(errors, fmt.Errorf("Jenkins pipeline template %s/%s not found", t.Config.TemplateNamespace, t.Config.TemplateName)) |
|
50 |
+ } else { |
|
51 |
+ errors = append(errors, err) |
|
52 |
+ } |
|
53 |
+ return nil, errors |
|
54 |
+ } |
|
55 |
+ errors = append(errors, substituteTemplateParameters(t.Config.Parameters, jenkinsTemplate)...) |
|
56 |
+ pTemplate, err := t.osClient.TemplateConfigs(t.Namespace).Create(jenkinsTemplate) |
|
57 |
+ if err != nil { |
|
58 |
+ errors = append(errors, fmt.Errorf("processing Jenkins template %s/%s failed: %v", t.Config.TemplateNamespace, t.Config.TemplateName, err)) |
|
59 |
+ return nil, errors |
|
60 |
+ } |
|
61 |
+ var items []runtime.Object |
|
62 |
+ for _, obj := range pTemplate.Objects { |
|
63 |
+ if unknownObj, ok := obj.(*runtime.Unknown); ok { |
|
64 |
+ decodedObj, err := runtime.Decode(kapi.Codecs.UniversalDecoder(), unknownObj.Raw) |
|
65 |
+ if err != nil { |
|
66 |
+ errors = append(errors, err) |
|
67 |
+ } |
|
68 |
+ items = append(items, decodedObj) |
|
69 |
+ } |
|
70 |
+ } |
|
71 |
+ glog.V(4).Infof("Processed Jenkins pipeline jenkinsTemplate %s/%s", pTemplate.Namespace, pTemplate.Namespace) |
|
72 |
+ return &kapi.List{ListMeta: unversioned.ListMeta{}, Items: items}, errors |
|
73 |
+} |
|
74 |
+ |
|
75 |
+// Instantiate instantiates the Jenkins template in the target namespace. |
|
76 |
+func (t *PipelineTemplate) Instantiate(list *kapi.List) []error { |
|
77 |
+ var errors []error |
|
78 |
+ if !t.hasJenkinsService(list) { |
|
79 |
+ err := fmt.Errorf("template %s/%s does not contain required service %q", t.Config.TemplateNamespace, t.Config.TemplateName, t.Config.ServiceName) |
|
80 |
+ return append(errors, err) |
|
81 |
+ } |
|
82 |
+ bulk := &cmd.Bulk{ |
|
83 |
+ Mapper: &resource.Mapper{ |
|
84 |
+ RESTMapper: client.DefaultMultiRESTMapper(), |
|
85 |
+ ObjectTyper: kapi.Scheme, |
|
86 |
+ ClientMapper: resource.ClientMapperFunc(func(mapping *meta.RESTMapping) (resource.RESTClient, error) { |
|
87 |
+ if latest.OriginKind(mapping.GroupVersionKind) { |
|
88 |
+ return t.osClient, nil |
|
89 |
+ } |
|
90 |
+ return t.kubeClient, nil |
|
91 |
+ }), |
|
92 |
+ }, |
|
93 |
+ Op: cmd.Create, |
|
94 |
+ } |
|
95 |
+ return bulk.Run(list, t.Namespace) |
|
96 |
+} |
|
97 |
+ |
|
98 |
+// hasJenkinsService searches the template items and return true if the expected |
|
99 |
+// Jenkins service is contained in template. |
|
100 |
+func (t *PipelineTemplate) hasJenkinsService(items *kapi.List) bool { |
|
101 |
+ accessor := meta.NewAccessor() |
|
102 |
+ for _, item := range items.Items { |
|
103 |
+ kind, err := kapi.Scheme.ObjectKind(item) |
|
104 |
+ if err != nil { |
|
105 |
+ glog.Infof("Error checking Jenkins service kind: %v", err) |
|
106 |
+ return false |
|
107 |
+ } |
|
108 |
+ name, err := accessor.Name(item) |
|
109 |
+ if err != nil { |
|
110 |
+ glog.Infof("Error checking Jenkins service name: %v", err) |
|
111 |
+ return false |
|
112 |
+ } |
|
113 |
+ glog.Infof("Jenkins Pipeline template object %q with name %q", name, kind.Kind) |
|
114 |
+ if name == t.Config.ServiceName && kind.Kind == "Service" { |
|
115 |
+ return true |
|
116 |
+ } |
|
117 |
+ } |
|
118 |
+ return false |
|
119 |
+} |
|
120 |
+ |
|
121 |
+// substituteTemplateParameters injects user specified parameter values into the Template |
|
122 |
+func substituteTemplateParameters(params map[string]string, t *templateapi.Template) []error { |
|
123 |
+ var errors []error |
|
124 |
+ for name, value := range params { |
|
125 |
+ if len(name) == 0 { |
|
126 |
+ errors = append(errors, fmt.Errorf("template parameter name cannot be empty (%q)", value)) |
|
127 |
+ continue |
|
128 |
+ } |
|
129 |
+ if v := template.GetParameterByName(t, name); v != nil { |
|
130 |
+ v.Value = value |
|
131 |
+ v.Generate = "" |
|
132 |
+ template.AddParameter(t, *v) |
|
133 |
+ } else { |
|
134 |
+ errors = append(errors, fmt.Errorf("unknown parameter %q specified for template", name)) |
|
135 |
+ } |
|
136 |
+ } |
|
137 |
+ return errors |
|
138 |
+} |
0 | 139 |
deleted file mode 100644 |
... | ... |
@@ -1,137 +0,0 @@ |
1 |
-package util |
|
2 |
- |
|
3 |
-import ( |
|
4 |
- "fmt" |
|
5 |
- |
|
6 |
- "github.com/golang/glog" |
|
7 |
- "github.com/openshift/origin/pkg/api/latest" |
|
8 |
- "github.com/openshift/origin/pkg/client" |
|
9 |
- serverapi "github.com/openshift/origin/pkg/cmd/server/api" |
|
10 |
- "github.com/openshift/origin/pkg/config/cmd" |
|
11 |
- "github.com/openshift/origin/pkg/template" |
|
12 |
- templateapi "github.com/openshift/origin/pkg/template/api" |
|
13 |
- kapi "k8s.io/kubernetes/pkg/api" |
|
14 |
- kerrs "k8s.io/kubernetes/pkg/api/errors" |
|
15 |
- "k8s.io/kubernetes/pkg/api/meta" |
|
16 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
17 |
- kclient "k8s.io/kubernetes/pkg/client/unversioned" |
|
18 |
- "k8s.io/kubernetes/pkg/kubectl/resource" |
|
19 |
- "k8s.io/kubernetes/pkg/runtime" |
|
20 |
-) |
|
21 |
- |
|
22 |
-// JenkinsPipelineTemplate stores the configuration of the |
|
23 |
-// JenkinsPipelineStrategy template, used to instantiate the Jenkins service in |
|
24 |
-// given namespace. |
|
25 |
-type JenkinsPipelineTemplate struct { |
|
26 |
- Config serverapi.JenkinsPipelineConfig |
|
27 |
- Namespace string |
|
28 |
- kubeClient *kclient.Client |
|
29 |
- osClient *client.Client |
|
30 |
-} |
|
31 |
- |
|
32 |
-// NewJenkinsPipelineTemplate returns a new JenkinsPipelineTemplate. |
|
33 |
-func NewJenkinsPipelineTemplate(ns string, conf serverapi.JenkinsPipelineConfig, kubeClient *kclient.Client, osClient *client.Client) *JenkinsPipelineTemplate { |
|
34 |
- return &JenkinsPipelineTemplate{ |
|
35 |
- Config: conf, |
|
36 |
- Namespace: ns, |
|
37 |
- kubeClient: kubeClient, |
|
38 |
- osClient: osClient, |
|
39 |
- } |
|
40 |
-} |
|
41 |
- |
|
42 |
-// Process processes the Jenkins template. If an error occurs |
|
43 |
-func (t *JenkinsPipelineTemplate) Process() (*kapi.List, []error) { |
|
44 |
- var errors []error |
|
45 |
- jenkinsTemplate, err := t.osClient.Templates(t.Config.Namespace).Get(t.Config.TemplateName) |
|
46 |
- if err != nil { |
|
47 |
- if kerrs.IsNotFound(err) { |
|
48 |
- errors = append(errors, fmt.Errorf("Jenkins pipeline template %s/%s not found", t.Config.Namespace, t.Config.TemplateName)) |
|
49 |
- } else { |
|
50 |
- errors = append(errors, err) |
|
51 |
- } |
|
52 |
- return nil, errors |
|
53 |
- } |
|
54 |
- errors = append(errors, substituteTemplateParameters(t.Config.Parameters, jenkinsTemplate)...) |
|
55 |
- pTemplate, err := t.osClient.TemplateConfigs(t.Namespace).Create(jenkinsTemplate) |
|
56 |
- if err != nil { |
|
57 |
- errors = append(errors, fmt.Errorf("processing Jenkins template %s/%s failed: %v", t.Config.Namespace, t.Config.TemplateName, err)) |
|
58 |
- return nil, errors |
|
59 |
- } |
|
60 |
- var items []runtime.Object |
|
61 |
- for _, obj := range pTemplate.Objects { |
|
62 |
- if unknownObj, ok := obj.(*runtime.Unknown); ok { |
|
63 |
- decodedObj, err := runtime.Decode(kapi.Codecs.UniversalDecoder(), unknownObj.Raw) |
|
64 |
- if err != nil { |
|
65 |
- errors = append(errors, err) |
|
66 |
- } |
|
67 |
- items = append(items, decodedObj) |
|
68 |
- } |
|
69 |
- } |
|
70 |
- glog.V(4).Infof("Processed Jenkins pipeline jenkinsTemplate %s/%s", pTemplate.Namespace, pTemplate.Namespace) |
|
71 |
- return &kapi.List{ListMeta: unversioned.ListMeta{}, Items: items}, errors |
|
72 |
-} |
|
73 |
- |
|
74 |
-// Instantiate instantiates the Jenkins template in the target namespace. |
|
75 |
-func (t *JenkinsPipelineTemplate) Instantiate(list *kapi.List) []error { |
|
76 |
- var errors []error |
|
77 |
- if !t.hasJenkinsService(list) { |
|
78 |
- err := fmt.Errorf("template %s/%s does not contain required service %q", t.Config.Namespace, t.Config.TemplateName, t.Config.ServiceName) |
|
79 |
- return append(errors, err) |
|
80 |
- } |
|
81 |
- bulk := &cmd.Bulk{ |
|
82 |
- Mapper: &resource.Mapper{ |
|
83 |
- RESTMapper: client.DefaultMultiRESTMapper(), |
|
84 |
- ObjectTyper: kapi.Scheme, |
|
85 |
- ClientMapper: resource.ClientMapperFunc(func(mapping *meta.RESTMapping) (resource.RESTClient, error) { |
|
86 |
- if latest.OriginKind(mapping.GroupVersionKind) { |
|
87 |
- return t.osClient, nil |
|
88 |
- } |
|
89 |
- return t.kubeClient, nil |
|
90 |
- }), |
|
91 |
- }, |
|
92 |
- Op: cmd.Create, |
|
93 |
- } |
|
94 |
- return bulk.Run(list, t.Namespace) |
|
95 |
-} |
|
96 |
- |
|
97 |
-// hasJenkinsService searches the template items and return true if the expected |
|
98 |
-// Jenkins service is contained in template. |
|
99 |
-func (t *JenkinsPipelineTemplate) hasJenkinsService(items *kapi.List) bool { |
|
100 |
- accessor := meta.NewAccessor() |
|
101 |
- for _, item := range items.Items { |
|
102 |
- kind, err := kapi.Scheme.ObjectKind(item) |
|
103 |
- if err != nil { |
|
104 |
- glog.Infof("Error checking Jenkins service kind: %v", err) |
|
105 |
- return false |
|
106 |
- } |
|
107 |
- name, err := accessor.Name(item) |
|
108 |
- if err != nil { |
|
109 |
- glog.Infof("Error checking Jenkins service name: %v", err) |
|
110 |
- return false |
|
111 |
- } |
|
112 |
- glog.Infof("Jenkins Pipeline template object %q with name %q", name, kind.Kind) |
|
113 |
- if name == t.Config.ServiceName && kind.Kind == "Service" { |
|
114 |
- return true |
|
115 |
- } |
|
116 |
- } |
|
117 |
- return false |
|
118 |
-} |
|
119 |
- |
|
120 |
-// substituteTemplateParameters injects user specified parameter values into the Template |
|
121 |
-func substituteTemplateParameters(params map[string]string, t *templateapi.Template) []error { |
|
122 |
- var errors []error |
|
123 |
- for name, value := range params { |
|
124 |
- if len(name) == 0 { |
|
125 |
- errors = append(errors, fmt.Errorf("template parameter name cannot be empty (%q)", value)) |
|
126 |
- continue |
|
127 |
- } |
|
128 |
- if v := template.GetParameterByName(t, name); v != nil { |
|
129 |
- v.Value = value |
|
130 |
- v.Generate = "" |
|
131 |
- template.AddParameter(t, *v) |
|
132 |
- } else { |
|
133 |
- errors = append(errors, fmt.Errorf("unknown parameter %q specified for template", name)) |
|
134 |
- } |
|
135 |
- } |
|
136 |
- return errors |
|
137 |
-} |
... | ... |
@@ -81,6 +81,22 @@ func fuzzInternalObject(t *testing.T, forVersion unversioned.GroupVersion, item |
81 | 81 |
obj.PodEvictionTimeout = "5m" |
82 | 82 |
} |
83 | 83 |
}, |
84 |
+ func(obj *configapi.JenkinsPipelineConfig, c fuzz.Continue) { |
|
85 |
+ c.FuzzNoCustom(obj) |
|
86 |
+ if obj.Enabled == nil { |
|
87 |
+ v := c.RandBool() |
|
88 |
+ obj.Enabled = &v |
|
89 |
+ } |
|
90 |
+ if len(obj.TemplateNamespace) == 0 { |
|
91 |
+ obj.TemplateNamespace = "value" |
|
92 |
+ } |
|
93 |
+ if len(obj.TemplateName) == 0 { |
|
94 |
+ obj.TemplateName = "anothervalue" |
|
95 |
+ } |
|
96 |
+ if len(obj.ServiceName) == 0 { |
|
97 |
+ obj.ServiceName = "thirdvalue" |
|
98 |
+ } |
|
99 |
+ }, |
|
84 | 100 |
func(obj *configapi.NodeConfig, c fuzz.Continue) { |
85 | 101 |
c.FuzzNoCustom(obj) |
86 | 102 |
// Defaults/migrations for NetworkConfig |
... | ... |
@@ -296,19 +296,19 @@ type MasterConfig struct { |
296 | 296 |
|
297 | 297 |
// JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy |
298 | 298 |
type JenkinsPipelineConfig struct { |
299 |
- // Disabled disables the Jenkins Pipeline auto-instantiation of Jenkins |
|
300 |
- // template. The ServiceName is still used to verify the project already have |
|
301 |
- // the Jenkins available. When not specified (default), this option defaults |
|
302 |
- // to false |
|
303 |
- Disabled *bool `json:"disabled"` |
|
304 |
- // Namespace contains the namespace name where the Jenkins template is stored |
|
305 |
- Namespace string |
|
299 |
+ // If the enabled flag is set, a Jenkins server will be spawned from the provided |
|
300 |
+ // template when the first build config in the project with type JenkinsPipeline |
|
301 |
+ // is created. When not specified this option defaults to true. |
|
302 |
+ Enabled *bool |
|
303 |
+ // TemplateNamespace contains the namespace name where the Jenkins template is stored |
|
304 |
+ TemplateNamespace string |
|
306 | 305 |
// TemplateName is the name of the default Jenkins template |
307 | 306 |
TemplateName string |
308 |
- // ServiceName is the name of the Jenkins service OpenShift use for Jenkins |
|
309 |
- // pipeline |
|
307 |
+ // ServiceName is the name of the Jenkins service OpenShift uses to detect |
|
308 |
+ // whether a Jenkins pipeline handler has already been installed in a project. |
|
309 |
+ // This value *must* match a service name in the provided template. |
|
310 | 310 |
ServiceName string |
311 |
- // Parameters specifies a set of optional parameters to the Jenkins template |
|
311 |
+ // Parameters specifies a set of optional parameters to the Jenkins template. |
|
312 | 312 |
Parameters map[string]string |
313 | 313 |
} |
314 | 314 |
|
... | ... |
@@ -318,13 +318,13 @@ type ImagePolicyConfig struct { |
318 | 318 |
// importing large numbers of images accidentally. Set -1 for no limit. |
319 | 319 |
MaxImagesBulkImportedPerRepository int |
320 | 320 |
// DisableScheduledImport allows scheduled background import of images to be disabled. |
321 |
- DisableScheduledImport bool `json:"disableScheduledImport"` |
|
321 |
+ DisableScheduledImport bool |
|
322 | 322 |
// ScheduledImageImportMinimumIntervalSeconds is the minimum number of seconds that can elapse between when image streams |
323 | 323 |
// scheduled for background import are checked against the upstream repository. The default value is 15 minutes. |
324 |
- ScheduledImageImportMinimumIntervalSeconds int `json:"scheduledImageImportMinimumIntervalSeconds"` |
|
324 |
+ ScheduledImageImportMinimumIntervalSeconds int |
|
325 | 325 |
// MaxScheduledImageImportsPerMinute is the maximum number of image streams that will be imported in the background per minute. |
326 | 326 |
// The default value is 60. Set to -1 for unlimited. |
327 |
- MaxScheduledImageImportsPerMinute int `json:"maxScheduledImageImportsPerMinute"` |
|
327 |
+ MaxScheduledImageImportsPerMinute int |
|
328 | 328 |
} |
329 | 329 |
|
330 | 330 |
type ProjectConfig struct { |
... | ... |
@@ -423,7 +423,7 @@ type MasterNetworkConfig struct { |
423 | 423 |
// may be set. It may contain a list of CIDRs which are checked for access. If a CIDR is prefixed with !, IPs in that |
424 | 424 |
// CIDR will be rejected. Rejections will be applied first, then the IP checked against one of the allowed CIDRs. You |
425 | 425 |
// should ensure this range does not overlap with your nodes, pods, or service CIDRs for security reasons. |
426 |
- ExternalIPNetworkCIDRs []string `json:"externalIPNetworkCIDRs"` |
|
426 |
+ ExternalIPNetworkCIDRs []string |
|
427 | 427 |
} |
428 | 428 |
|
429 | 429 |
type ImageConfig struct { |
... | ... |
@@ -32,8 +32,8 @@ func addDefaultingFuncs(scheme *runtime.Scheme) { |
32 | 32 |
if len(obj.RoutingConfig.Subdomain) == 0 { |
33 | 33 |
obj.RoutingConfig.Subdomain = "router.default.svc.cluster.local" |
34 | 34 |
} |
35 |
- if len(obj.JenkinsPipelineConfig.Namespace) == 0 { |
|
36 |
- obj.JenkinsPipelineConfig.Namespace = "openshift" |
|
35 |
+ if len(obj.JenkinsPipelineConfig.TemplateNamespace) == 0 { |
|
36 |
+ obj.JenkinsPipelineConfig.TemplateNamespace = "openshift" |
|
37 | 37 |
} |
38 | 38 |
if len(obj.JenkinsPipelineConfig.TemplateName) == 0 { |
39 | 39 |
obj.JenkinsPipelineConfig.TemplateName = "jenkins" |
... | ... |
@@ -41,9 +41,9 @@ func addDefaultingFuncs(scheme *runtime.Scheme) { |
41 | 41 |
if len(obj.JenkinsPipelineConfig.ServiceName) == 0 { |
42 | 42 |
obj.JenkinsPipelineConfig.ServiceName = "jenkins" |
43 | 43 |
} |
44 |
- if obj.JenkinsPipelineConfig.Disabled == nil { |
|
45 |
- disabled := false |
|
46 |
- obj.JenkinsPipelineConfig.Disabled = &disabled |
|
44 |
+ if obj.JenkinsPipelineConfig.Enabled == nil { |
|
45 |
+ v := true |
|
46 |
+ obj.JenkinsPipelineConfig.Enabled = &v |
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
// Populate the new NetworkConfig.ServiceNetworkCIDR field from the KubernetesMasterConfig.ServicesSubnet field if needed |
... | ... |
@@ -266,12 +266,12 @@ func (ImagePolicyConfig) SwaggerDoc() map[string]string { |
266 | 266 |
} |
267 | 267 |
|
268 | 268 |
var map_JenkinsPipelineConfig = map[string]string{ |
269 |
- "": "JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy", |
|
270 |
- "disabled": "Disabled disables the Jenkins Pipeline auto-instantiation of Jenkins template. The ServiceName is still used to verify the project already have the Jenkins available. When not specified (default), this option defaults to false", |
|
271 |
- "namespace": "Namespace contains the namespace name where the Jenkins template is stored", |
|
272 |
- "templateName": "TemplateName is the name of the default Jenkins template", |
|
273 |
- "serviceName": "ServiceName is the name of the Jenkins service OpenShift use for Jenkins pipeline", |
|
274 |
- "parameters": "Parameters specifies a set of optional parameters to the Jenkins template", |
|
269 |
+ "": "JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy", |
|
270 |
+ "enabled": "If the enabled flag is set, a Jenkins server will be spawned from the provided template when the first build config in the project with type JenkinsPipeline is created. When not specified this option defaults to true.", |
|
271 |
+ "templateNamespace": "TemplateNamespace contains the namespace name where the Jenkins template is stored", |
|
272 |
+ "templateName": "TemplateName is the name of the default Jenkins template", |
|
273 |
+ "serviceName": "ServiceName is the name of the Jenkins service OpenShift uses to detect whether a Jenkins pipeline handler has already been installed in a project. This value *must* match a service name in the provided template.", |
|
274 |
+ "parameters": "Parameters specifies a set of optional parameters to the Jenkins template.", |
|
275 | 275 |
} |
276 | 276 |
|
277 | 277 |
func (JenkinsPipelineConfig) SwaggerDoc() map[string]string { |
... | ... |
@@ -236,19 +236,19 @@ type MasterConfig struct { |
236 | 236 |
|
237 | 237 |
// JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy |
238 | 238 |
type JenkinsPipelineConfig struct { |
239 |
- // Disabled disables the Jenkins Pipeline auto-instantiation of Jenkins |
|
240 |
- // template. The ServiceName is still used to verify the project already have |
|
241 |
- // the Jenkins available. When not specified (default), this option defaults |
|
242 |
- // to false |
|
243 |
- Disabled *bool `json:"disabled"` |
|
244 |
- // Namespace contains the namespace name where the Jenkins template is stored |
|
245 |
- Namespace string `json:"namespace"` |
|
239 |
+ // If the enabled flag is set, a Jenkins server will be spawned from the provided |
|
240 |
+ // template when the first build config in the project with type JenkinsPipeline |
|
241 |
+ // is created. When not specified this option defaults to true. |
|
242 |
+ Enabled *bool `json:"enabled"` |
|
243 |
+ // TemplateNamespace contains the namespace name where the Jenkins template is stored |
|
244 |
+ TemplateNamespace string `json:"templateNamespace"` |
|
246 | 245 |
// TemplateName is the name of the default Jenkins template |
247 | 246 |
TemplateName string `json:"templateName"` |
248 |
- // ServiceName is the name of the Jenkins service OpenShift use for Jenkins |
|
249 |
- // pipeline |
|
247 |
+ // ServiceName is the name of the Jenkins service OpenShift uses to detect |
|
248 |
+ // whether a Jenkins pipeline handler has already been installed in a project. |
|
249 |
+ // This value *must* match a service name in the provided template. |
|
250 | 250 |
ServiceName string `json:"serviceName"` |
251 |
- // Parameters specifies a set of optional parameters to the Jenkins template |
|
251 |
+ // Parameters specifies a set of optional parameters to the Jenkins template. |
|
252 | 252 |
Parameters map[string]string `json:"parameters"` |
253 | 253 |
} |
254 | 254 |
|
... | ... |
@@ -146,6 +146,12 @@ imagePolicyConfig: |
146 | 146 |
maxImagesBulkImportedPerRepository: 0 |
147 | 147 |
maxScheduledImageImportsPerMinute: 0 |
148 | 148 |
scheduledImageImportMinimumIntervalSeconds: 0 |
149 |
+jenkinsPipelineConfig: |
|
150 |
+ enabled: null |
|
151 |
+ parameters: null |
|
152 |
+ serviceName: "" |
|
153 |
+ templateName: "" |
|
154 |
+ templateNamespace: "" |
|
149 | 155 |
kind: MasterConfig |
150 | 156 |
kubeletClientInfo: |
151 | 157 |
ca: "" |