Merge pull request #17483 from brendandburns/kubectl5

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2015-12-16 21:57:33 -08:00
commit 46c2df3e05
41 changed files with 16730 additions and 14701 deletions

View File

@ -479,6 +479,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -1220,6 +1236,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -1961,6 +1993,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -2670,6 +2718,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -3291,6 +3355,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -4217,6 +4297,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -4985,6 +5081,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -5587,6 +5699,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -7871,6 +7999,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -8612,6 +8756,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -9412,6 +9572,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -10212,6 +10388,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -10953,6 +11145,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",

View File

@ -310,6 +310,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -1110,6 +1126,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
@ -1910,6 +1942,22 @@
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "export",
"description": "Should this value be exported. Export strips fields that a user can not specify.",
"required": false,
"allowMultiple": false
},
{
"type": "boolean",
"paramType": "query",
"name": "exact",
"description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",

View File

@ -1282,6 +1282,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -2288,6 +2304,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -3294,6 +3326,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -5530,7 +5578,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div id="footer">
<div id="footer-text">
Last updated 2015-12-08 11:56:55 UTC
Last updated 2015-12-15 06:44:37 UTC
</div>
</div>
</body>

View File

@ -2016,6 +2016,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -2901,6 +2917,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -3786,6 +3818,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -4671,6 +4719,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -5677,6 +5741,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -8723,6 +8803,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -9608,6 +9704,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -10614,6 +10726,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -11620,6 +11748,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -12505,6 +12649,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">namespace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">object name and auth scope, such as for teams and projects</p></td>
@ -13719,6 +13879,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name of the Namespace</p></td>
@ -14774,6 +14950,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name of the Node</p></td>
@ -15853,6 +16045,22 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">export</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should this value be exported. Export strips fields that a user can not specify.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">exact</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the export be exact. Exact export maintains cluster-specific fields like <em>Namespace</em></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name of the PersistentVolume</p></td>
@ -25525,7 +25733,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div id="footer">
<div id="footer-text">
Last updated 2015-12-08 11:56:49 UTC
Last updated 2015-12-15 06:44:31 UTC
</div>
</div>
</body>

View File

@ -54,7 +54,7 @@ function depends {
file=${generated_files[$1]//\.generated\.go/.go}
deps=$(go list -f "{{.Deps}}" ${file} | tr "[" " " | tr "]" " ")
inputfile=${generated_files[$2]//\.generated\.go/.go}
fullpath=$(readlink -f ${generated_files[$2]//\.generated\.go/.go})
fullpath=${generated_files[$2]//\.generated\.go/.go}
candidate=$(dirname "${fullpath}")
result=false
for dep in ${deps}; do

View File

@ -24,8 +24,6 @@ import (
resource "k8s.io/kubernetes/pkg/api/resource"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
conversion "k8s.io/kubernetes/pkg/conversion"
fields "k8s.io/kubernetes/pkg/fields"
labels "k8s.io/kubernetes/pkg/labels"
runtime "k8s.io/kubernetes/pkg/runtime"
intstr "k8s.io/kubernetes/pkg/util/intstr"
inf "speter.net/go/exp/math/dec/inf"
@ -809,35 +807,6 @@ func deepCopy_api_List(in List, out *List, c *conversion.Cloner) error {
return nil
}
func deepCopy_api_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cloner) error {
if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
if newVal, err := c.DeepCopy(in.LabelSelector); err != nil {
return err
} else if newVal == nil {
out.LabelSelector = nil
} else {
out.LabelSelector = newVal.(labels.Selector)
}
if newVal, err := c.DeepCopy(in.FieldSelector); err != nil {
return err
} else if newVal == nil {
out.FieldSelector = nil
} else {
out.FieldSelector = newVal.(fields.Selector)
}
out.Watch = in.Watch
out.ResourceVersion = in.ResourceVersion
if in.TimeoutSeconds != nil {
out.TimeoutSeconds = new(int64)
*out.TimeoutSeconds = *in.TimeoutSeconds
} else {
out.TimeoutSeconds = nil
}
return nil
}
func deepCopy_api_LoadBalancerIngress(in LoadBalancerIngress, out *LoadBalancerIngress, c *conversion.Cloner) error {
out.IP = in.IP
out.Hostname = in.Hostname
@ -2417,7 +2386,6 @@ func init() {
deepCopy_api_LimitRangeList,
deepCopy_api_LimitRangeSpec,
deepCopy_api_List,
deepCopy_api_ListOptions,
deepCopy_api_LoadBalancerIngress,
deepCopy_api_LoadBalancerStatus,
deepCopy_api_LocalObjectReference,

View File

@ -88,6 +88,8 @@ func init() {
// Register Unversioned types
// TODO this should not be done here
Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.ExportOptions{})
Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.ListOptions{})
Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.Status{})
Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.APIVersions{})
Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.APIGroupList{})
@ -155,3 +157,4 @@ func (obj *SerializedReference) GetObjectKind() unversioned.ObjectKind { r
func (obj *RangeAllocation) GetObjectMeta() meta.Object { return &obj.ObjectMeta }
func (obj *RangeAllocation) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *ObjectReference) GetObjectKind() unversioned.ObjectKind { return obj }
func (obj *ExportOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }

28
pkg/api/rest/export.go Normal file
View File

@ -0,0 +1,28 @@
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package rest
import (
"k8s.io/kubernetes/pkg/runtime"
)
// RESTExportStrategy is the interface that defines how to export a Kubernetes object
type RESTExportStrategy interface {
// Export strips fields that can not be set by the user. If 'exact' is false
// fields specific to the cluster are also stripped
Export(obj runtime.Object, exact bool) error
}

View File

@ -64,6 +64,14 @@ type Lister interface {
List(ctx api.Context, options *unversioned.ListOptions) (runtime.Object, error)
}
// Exporter is an object that knows how to strip a RESTful resource for export
type Exporter interface {
// Export an object. Fields that are not user specified (e.g. Status, ObjectMeta.ResourceVersion) are stripped out
// Returns the stripped object. If 'exact' is true, fields that are specific to the cluster (e.g. namespace) are
// retained, otherwise they are stripped also.
Export(ctx api.Context, name string, opts unversioned.ExportOptions) (runtime.Object, error)
}
// Getter is an object that can retrieve a named RESTful resource.
type Getter interface {
// Get finds a resource in the storage by name and returns it.

View File

@ -147,9 +147,9 @@ func TestList(t *testing.T) {
roundTripSame(t, item)
}
var nonRoundTrippableTypes = sets.NewString()
var nonRoundTrippableTypes = sets.NewString("ExportOptions")
var nonInternalRoundTrippableTypes = sets.NewString("List", "ListOptions")
var nonInternalRoundTrippableTypes = sets.NewString("List", "ListOptions", "ExportOptions")
var nonRoundTrippableTypesByVersion = map[string][]string{}
func TestRoundTripTypes(t *testing.T) {

File diff suppressed because it is too large Load Diff

View File

@ -1669,6 +1669,15 @@ type DeleteOptions struct {
GracePeriodSeconds *int64 `json:"gracePeriodSeconds"`
}
// ExportOptions is the query options to the standard REST get call.
type ExportOptions struct {
unversioned.TypeMeta `json:",inline"`
// Should this value be exported. Export strips fields that a user can not specify.
Export bool `json:"export"`
// Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'
Exact bool `json:"exact"`
}
// ListOptions is the query options to a standard REST list call, and has future support for
// watch calls.
type ListOptions struct {

View File

@ -40,3 +40,4 @@ func (obj *APIVersions) GetObjectKind() ObjectKind { return &obj.TypeMeta }
func (obj *APIGroupList) GetObjectKind() ObjectKind { return &obj.TypeMeta }
func (obj *APIGroup) GetObjectKind() ObjectKind { return &obj.TypeMeta }
func (obj *APIResourceList) GetObjectKind() ObjectKind { return &obj.TypeMeta }
func (obj *ExportOptions) GetObjectKind() ObjectKind { return &obj.TypeMeta }

View File

@ -54,6 +54,15 @@ type ListMeta struct {
ResourceVersion string `json:"resourceVersion,omitempty"`
}
// ExportOptions is the query options to the standard REST get call.
type ExportOptions struct {
TypeMeta `json:",inline"`
// Should this value be exported. Export strips fields that a user can not specify.`
Export bool `json:"export"`
// Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'
Exact bool `json:"exact"`
}
// ListOptions is the query options to a standard REST list/watch calls.
type ListOptions struct {
TypeMeta `json:",inline"`

View File

@ -76,6 +76,16 @@ func (APIVersions) SwaggerDoc() map[string]string {
return map_APIVersions
}
var map_ExportOptions = map[string]string{
"": "ExportOptions is the query options to the standard REST get call.",
"export": "Should this value be exported. Export strips fields that a user can not specify.`",
"exact": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
}
func (ExportOptions) SwaggerDoc() map[string]string {
return map_ExportOptions
}
var map_GroupVersionForDiscovery = map[string]string{
"": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensiblity.",
"groupVersion": "groupVersion specifies the API group and version in the form \"group/version\"",

View File

@ -23,6 +23,7 @@ import (
api "k8s.io/kubernetes/pkg/api"
resource "k8s.io/kubernetes/pkg/api/resource"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
conversion "k8s.io/kubernetes/pkg/conversion"
)
@ -1115,34 +1116,6 @@ func convert_api_List_To_v1_List(in *api.List, out *List, s conversion.Scope) er
return autoconvert_api_List_To_v1_List(in, out, s)
}
func autoconvert_api_ListOptions_To_v1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.ListOptions))(in)
}
if err := s.Convert(&in.TypeMeta, &out.TypeMeta, 0); err != nil {
return err
}
if err := s.Convert(&in.LabelSelector, &out.LabelSelector, 0); err != nil {
return err
}
if err := s.Convert(&in.FieldSelector, &out.FieldSelector, 0); err != nil {
return err
}
out.Watch = in.Watch
out.ResourceVersion = in.ResourceVersion
if in.TimeoutSeconds != nil {
out.TimeoutSeconds = new(int64)
*out.TimeoutSeconds = *in.TimeoutSeconds
} else {
out.TimeoutSeconds = nil
}
return nil
}
func convert_api_ListOptions_To_v1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error {
return autoconvert_api_ListOptions_To_v1_ListOptions(in, out, s)
}
func autoconvert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress(in *api.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.LoadBalancerIngress))(in)
@ -3065,6 +3038,50 @@ func convert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *Volu
return autoconvert_api_VolumeSource_To_v1_VolumeSource(in, out, s)
}
func autoconvert_unversioned_ExportOptions_To_v1_ExportOptions(in *unversioned.ExportOptions, out *ExportOptions, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*unversioned.ExportOptions))(in)
}
if err := s.Convert(&in.TypeMeta, &out.TypeMeta, 0); err != nil {
return err
}
out.Export = in.Export
out.Exact = in.Exact
return nil
}
func convert_unversioned_ExportOptions_To_v1_ExportOptions(in *unversioned.ExportOptions, out *ExportOptions, s conversion.Scope) error {
return autoconvert_unversioned_ExportOptions_To_v1_ExportOptions(in, out, s)
}
func autoconvert_unversioned_ListOptions_To_v1_ListOptions(in *unversioned.ListOptions, out *ListOptions, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*unversioned.ListOptions))(in)
}
if err := s.Convert(&in.TypeMeta, &out.TypeMeta, 0); err != nil {
return err
}
if err := s.Convert(&in.LabelSelector, &out.LabelSelector, 0); err != nil {
return err
}
if err := s.Convert(&in.FieldSelector, &out.FieldSelector, 0); err != nil {
return err
}
out.Watch = in.Watch
out.ResourceVersion = in.ResourceVersion
if in.TimeoutSeconds != nil {
out.TimeoutSeconds = new(int64)
*out.TimeoutSeconds = *in.TimeoutSeconds
} else {
out.TimeoutSeconds = nil
}
return nil
}
func convert_unversioned_ListOptions_To_v1_ListOptions(in *unversioned.ListOptions, out *ListOptions, s conversion.Scope) error {
return autoconvert_unversioned_ListOptions_To_v1_ListOptions(in, out, s)
}
func autoconvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in *AWSElasticBlockStoreVolumeSource, out *api.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*AWSElasticBlockStoreVolumeSource))(in)
@ -3804,6 +3821,22 @@ func convert_v1_ExecAction_To_api_ExecAction(in *ExecAction, out *api.ExecAction
return autoconvert_v1_ExecAction_To_api_ExecAction(in, out, s)
}
func autoconvert_v1_ExportOptions_To_unversioned_ExportOptions(in *ExportOptions, out *unversioned.ExportOptions, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*ExportOptions))(in)
}
if err := s.Convert(&in.TypeMeta, &out.TypeMeta, 0); err != nil {
return err
}
out.Export = in.Export
out.Exact = in.Exact
return nil
}
func convert_v1_ExportOptions_To_unversioned_ExportOptions(in *ExportOptions, out *unversioned.ExportOptions, s conversion.Scope) error {
return autoconvert_v1_ExportOptions_To_unversioned_ExportOptions(in, out, s)
}
func autoconvert_v1_FCVolumeSource_To_api_FCVolumeSource(in *FCVolumeSource, out *api.FCVolumeSource, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*FCVolumeSource))(in)
@ -4154,7 +4187,7 @@ func convert_v1_List_To_api_List(in *List, out *api.List, s conversion.Scope) er
return autoconvert_v1_List_To_api_List(in, out, s)
}
func autoconvert_v1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error {
func autoconvert_v1_ListOptions_To_unversioned_ListOptions(in *ListOptions, out *unversioned.ListOptions, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*ListOptions))(in)
}
@ -4178,8 +4211,8 @@ func autoconvert_v1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.Lis
return nil
}
func convert_v1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error {
return autoconvert_v1_ListOptions_To_api_ListOptions(in, out, s)
func convert_v1_ListOptions_To_unversioned_ListOptions(in *ListOptions, out *unversioned.ListOptions, s conversion.Scope) error {
return autoconvert_v1_ListOptions_To_unversioned_ListOptions(in, out, s)
}
func autoconvert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress(in *LoadBalancerIngress, out *api.LoadBalancerIngress, s conversion.Scope) error {
@ -6154,7 +6187,6 @@ func init() {
autoconvert_api_LimitRangeList_To_v1_LimitRangeList,
autoconvert_api_LimitRangeSpec_To_v1_LimitRangeSpec,
autoconvert_api_LimitRange_To_v1_LimitRange,
autoconvert_api_ListOptions_To_v1_ListOptions,
autoconvert_api_List_To_v1_List,
autoconvert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress,
autoconvert_api_LoadBalancerStatus_To_v1_LoadBalancerStatus,
@ -6227,6 +6259,8 @@ func init() {
autoconvert_api_VolumeMount_To_v1_VolumeMount,
autoconvert_api_VolumeSource_To_v1_VolumeSource,
autoconvert_api_Volume_To_v1_Volume,
autoconvert_unversioned_ExportOptions_To_v1_ExportOptions,
autoconvert_unversioned_ListOptions_To_v1_ListOptions,
autoconvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource,
autoconvert_v1_Binding_To_api_Binding,
autoconvert_v1_Capabilities_To_api_Capabilities,
@ -6258,6 +6292,7 @@ func init() {
autoconvert_v1_EventSource_To_api_EventSource,
autoconvert_v1_Event_To_api_Event,
autoconvert_v1_ExecAction_To_api_ExecAction,
autoconvert_v1_ExportOptions_To_unversioned_ExportOptions,
autoconvert_v1_FCVolumeSource_To_api_FCVolumeSource,
autoconvert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource,
autoconvert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource,
@ -6272,7 +6307,7 @@ func init() {
autoconvert_v1_LimitRangeList_To_api_LimitRangeList,
autoconvert_v1_LimitRangeSpec_To_api_LimitRangeSpec,
autoconvert_v1_LimitRange_To_api_LimitRange,
autoconvert_v1_ListOptions_To_api_ListOptions,
autoconvert_v1_ListOptions_To_unversioned_ListOptions,
autoconvert_v1_List_To_api_List,
autoconvert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress,
autoconvert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus,

View File

@ -587,6 +587,15 @@ func deepCopy_v1_ExecAction(in ExecAction, out *ExecAction, c *conversion.Cloner
return nil
}
func deepCopy_v1_ExportOptions(in ExportOptions, out *ExportOptions, c *conversion.Cloner) error {
if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
out.Export = in.Export
out.Exact = in.Exact
return nil
}
func deepCopy_v1_FCVolumeSource(in FCVolumeSource, out *FCVolumeSource, c *conversion.Cloner) error {
if in.TargetWWNs != nil {
out.TargetWWNs = make([]string, len(in.TargetWWNs))
@ -2415,6 +2424,7 @@ func init() {
deepCopy_v1_EventList,
deepCopy_v1_EventSource,
deepCopy_v1_ExecAction,
deepCopy_v1_ExportOptions,
deepCopy_v1_FCVolumeSource,
deepCopy_v1_FlockerVolumeSource,
deepCopy_v1_GCEPersistentDiskVolumeSource,

View File

@ -79,6 +79,7 @@ func addKnownTypes() {
&PersistentVolumeClaim{},
&PersistentVolumeClaimList{},
&DeleteOptions{},
&ExportOptions{},
&ListOptions{},
&PodAttachOptions{},
&PodLogOptions{},
@ -135,3 +136,4 @@ func (obj *ComponentStatus) GetObjectKind() unversioned.ObjectKind { r
func (obj *ComponentStatusList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *SerializedReference) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *RangeAllocation) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *ExportOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }

File diff suppressed because it is too large Load Diff

View File

@ -2073,6 +2073,16 @@ type DeleteOptions struct {
GracePeriodSeconds *int64 `json:"gracePeriodSeconds"`
}
// ExportOptions is the query options to the standard REST get call.
type ExportOptions struct {
unversioned.TypeMeta `json:",inline"`
// Should this value be exported. Export strips fields that a user can not specify.
Export bool `json:"export"`
// Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'
Exact bool `json:"exact"`
}
// ListOptions is the query options to a standard REST list call.
type ListOptions struct {
unversioned.TypeMeta `json:",inline"`

View File

@ -379,6 +379,16 @@ func (ExecAction) SwaggerDoc() map[string]string {
return map_ExecAction
}
var map_ExportOptions = map[string]string{
"": "ExportOptions is the query options to the standard REST get call.",
"export": "Should this value be exported. Export strips fields that a user can not specify.",
"exact": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
}
func (ExportOptions) SwaggerDoc() map[string]string {
return map_ExportOptions
}
var map_FCVolumeSource = map[string]string{
"": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.",
"targetWWNs": "Required: FC target world wide names (WWNs)",

View File

@ -67,6 +67,7 @@ func addKnownTypes() {
&api.ListOptions{},
&ConfigMap{},
&ConfigMapList{},
&api.ExportOptions{},
)
}

File diff suppressed because it is too large Load Diff

View File

@ -663,6 +663,15 @@ type ClusterAutoscalerList struct {
Items []ClusterAutoscaler `json:"items"`
}
// ExportOptions is the query options to the standard REST get call.
type ExportOptions struct {
unversioned.TypeMeta `json:",inline"`
// Should this value be exported. Export strips fields that a user can not specify.
Export bool `json:"export"`
// Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'
Exact bool `json:"exact"`
}
// ListOptions is the query options to a standard REST list call.
type ListOptions struct {
unversioned.TypeMeta `json:",inline"`

View File

@ -190,6 +190,16 @@ func (DeploymentStrategy) SwaggerDoc() map[string]string {
return map_DeploymentStrategy
}
var map_ExportOptions = map[string]string{
"": "ExportOptions is the query options to the standard REST get call.",
"export": "Should this value be exported. Export strips fields that a user can not specify.",
"exact": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'",
}
func (ExportOptions) SwaggerDoc() map[string]string {
return map_ExportOptions
}
var map_HTTPIngressPath = map[string]string{
"": "HTTPIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend.",
"path": "Path is a extended POSIX regex as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. If unspecified, the path defaults to a catch all sending traffic to the backend.",

View File

@ -210,6 +210,15 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
if !isMetadata {
storageMeta = defaultStorageMetadata{}
}
exporter, isExporter := storage.(rest.Exporter)
if !isExporter {
exporter = nil
}
versionedExportOptions, err := a.group.Creater.New(optionsExternalVersion.WithKind("ExportOptions"))
if err != nil {
return nil, err
}
if isNamedCreater {
isCreater = true
@ -310,6 +319,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
scope := mapping.Scope
nameParam := ws.PathParameter("name", "name of the "+kind).DataType("string")
pathParam := ws.PathParameter("path", "path to the resource").DataType("string")
params := []*restful.Parameter{}
actions := []action{}
@ -444,9 +454,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
case "GET": // Get a resource.
var handler restful.RouteFunction
if isGetterWithOptions {
handler = GetResourceWithOptions(getterWithOptions, reqScope, getOptionsInternalKind, getOptionsExternalKind, getSubpath, getSubpathKey)
handler = GetResourceWithOptions(getterWithOptions, exporter, reqScope, getOptionsInternalKind, getOptionsExternalKind, getSubpath, getSubpathKey)
} else {
handler = GetResource(getter, reqScope)
handler = GetResource(getter, exporter, reqScope)
}
doc := "read the specified " + kind
if hasSubresource {
@ -465,6 +475,11 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
return nil, err
}
}
if isExporter {
if err := addObjectParams(ws, route, versionedExportOptions); err != nil {
return nil, err
}
}
addParams(route, action.Params)
ws.Route(route)
case "LIST": // List all resources of a kind.

View File

@ -117,14 +117,16 @@ func addGrouplessTypes() {
func addTestTypes() {
api.Scheme.AddKnownTypes(
testGroupVersion, &apiservertesting.Simple{}, &apiservertesting.SimpleList{}, &unversioned.Status{},
&unversioned.ListOptions{}, &api.DeleteOptions{}, &apiservertesting.SimpleGetOptions{}, &apiservertesting.SimpleRoot{})
&unversioned.ListOptions{}, &api.DeleteOptions{}, &apiservertesting.SimpleGetOptions{}, &apiservertesting.SimpleRoot{},
&unversioned.ExportOptions{})
api.Scheme.AddKnownTypes(testGroupVersion, &api.Pod{})
}
func addNewTestTypes() {
api.Scheme.AddKnownTypes(
newGroupVersion, &apiservertesting.Simple{}, &apiservertesting.SimpleList{}, &unversioned.Status{},
&unversioned.ListOptions{}, &api.DeleteOptions{}, &apiservertesting.SimpleGetOptions{}, &apiservertesting.SimpleRoot{})
&unversioned.ListOptions{}, &api.DeleteOptions{}, &apiservertesting.SimpleGetOptions{}, &apiservertesting.SimpleRoot{},
&unversioned.ExportOptions{})
}
func init() {
@ -334,6 +336,21 @@ type SimpleRESTStorage struct {
injectedFunction func(obj runtime.Object) (returnObj runtime.Object, err error)
}
func (storage *SimpleRESTStorage) Export(ctx api.Context, name string, opts unversioned.ExportOptions) (runtime.Object, error) {
obj, err := storage.Get(ctx, name)
if err != nil {
return nil, err
}
s, ok := obj.(*apiservertesting.Simple)
if !ok {
return nil, fmt.Errorf("unexpected object")
}
// Set a marker to verify the method was called
s.Other = "exported"
return obj, storage.errors["export"]
}
func (storage *SimpleRESTStorage) List(ctx api.Context, options *unversioned.ListOptions) (runtime.Object, error) {
storage.checkContext(ctx)
result := &apiservertesting.SimpleList{
@ -1150,6 +1167,55 @@ func TestMetadata(t *testing.T) {
}
}
func TestExport(t *testing.T) {
storage := map[string]rest.Storage{}
simpleStorage := SimpleRESTStorage{
item: apiservertesting.Simple{
ObjectMeta: api.ObjectMeta{
ResourceVersion: "1234",
CreationTimestamp: unversioned.NewTime(time.Unix(10, 10)),
},
Other: "foo",
},
}
selfLinker := &setTestSelfLinker{
t: t,
expectedSet: "/" + prefix + "/" + testGroupVersion.Group + "/" + testGroupVersion.Version + "/namespaces/default/simple/id",
name: "id",
namespace: "default",
}
storage["simple"] = &simpleStorage
handler := handleLinker(storage, selfLinker)
server := httptest.NewServer(handler)
defer server.Close()
resp, err := http.Get(server.URL + "/" + prefix + "/" + testGroupVersion.Group + "/" + testGroupVersion.Version + "/namespaces/default/simple/id?export=true")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if resp.StatusCode != http.StatusOK {
data, _ := ioutil.ReadAll(resp.Body)
resp.Body.Close()
t.Fatalf("unexpected response: %#v\n%s\n", resp, string(data))
}
var itemOut apiservertesting.Simple
body, err := extractBody(resp, &itemOut)
if err != nil {
t.Errorf("unexpected error: %v", err)
}
if itemOut.Name != simpleStorage.item.Name {
t.Errorf("Unexpected data: %#v, expected %#v (%s)", itemOut, simpleStorage.item, string(body))
}
if itemOut.Other != "exported" {
t.Errorf("Expected: exported, saw: %s", itemOut.Other)
}
if !selfLinker.called {
t.Errorf("Never set self link")
}
}
func TestGet(t *testing.T) {
storage := map[string]rest.Storage{}
simpleStorage := SimpleRESTStorage{

View File

@ -32,6 +32,7 @@ import (
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
@ -112,24 +113,43 @@ func getResourceHandler(scope RequestScope, getter getterFunc) restful.RouteFunc
}
// GetResource returns a function that handles retrieving a single resource from a rest.Storage object.
func GetResource(r rest.Getter, scope RequestScope) restful.RouteFunction {
func GetResource(r rest.Getter, e rest.Exporter, scope RequestScope) restful.RouteFunction {
return getResourceHandler(scope,
func(ctx api.Context, name string, req *restful.Request) (runtime.Object, error) {
// For performance tracking purposes.
trace := util.NewTrace("Get " + req.Request.URL.Path)
defer trace.LogIfLong(250 * time.Millisecond)
opts := v1.ExportOptions{}
if err := scope.Codec.DecodeParametersInto(req.Request.URL.Query(), &opts); err != nil {
return nil, err
}
internalOpts := unversioned.ExportOptions{}
scope.Convertor.Convert(&opts, &internalOpts)
if internalOpts.Export {
if e == nil {
return nil, errors.NewBadRequest("export unsupported")
}
return e.Export(ctx, name, internalOpts)
}
return r.Get(ctx, name)
})
}
// GetResourceWithOptions returns a function that handles retrieving a single resource from a rest.Storage object.
func GetResourceWithOptions(r rest.GetterWithOptions, scope RequestScope, internalKind, externalKind unversioned.GroupVersionKind, subpath bool, subpathKey string) restful.RouteFunction {
func GetResourceWithOptions(r rest.GetterWithOptions, e rest.Exporter, scope RequestScope, internalKind, externalKind unversioned.GroupVersionKind, subpath bool, subpathKey string) restful.RouteFunction {
return getResourceHandler(scope,
func(ctx api.Context, name string, req *restful.Request) (runtime.Object, error) {
opts, err := getRequestOptions(req, scope, internalKind, externalKind, subpath, subpathKey)
if err != nil {
return nil, err
}
exportOpts := unversioned.ExportOptions{}
if err := scope.Codec.DecodeParametersInto(req.Request.URL.Query(), &exportOpts); err != nil {
return nil, err
}
if exportOpts.Export {
return nil, errors.NewBadRequest("export unsupported")
}
return r.Get(ctx, name, opts)
})
}

View File

@ -18,6 +18,7 @@ package etcd
import (
"fmt"
"reflect"
"k8s.io/kubernetes/pkg/api"
kubeerr "k8s.io/kubernetes/pkg/api/errors"
@ -103,6 +104,8 @@ type Etcd struct {
// If true, return the object that was deleted. Otherwise, return a generic
// success status response.
ReturnDeletedObject bool
// Allows extended behavior during export, optional
ExportStrategy rest.RESTExportStrategy
// Used for all etcd access functions
Storage storage.Interface
@ -536,3 +539,39 @@ func (e *Etcd) calculateTTL(obj runtime.Object, defaultTTL int64, update bool) (
}
return ttl, err
}
func exportObjectMeta(objMeta *api.ObjectMeta, exact bool) {
objMeta.UID = ""
if !exact {
objMeta.Namespace = ""
}
objMeta.CreationTimestamp = unversioned.Time{}
objMeta.DeletionTimestamp = nil
objMeta.ResourceVersion = ""
objMeta.SelfLink = ""
if len(objMeta.GenerateName) > 0 && !exact {
objMeta.Name = ""
}
}
// Implements the rest.Exporter interface
func (e *Etcd) Export(ctx api.Context, name string, opts unversioned.ExportOptions) (runtime.Object, error) {
obj, err := e.Get(ctx, name)
if err != nil {
return nil, err
}
if meta, err := api.ObjectMetaFor(obj); err == nil {
exportObjectMeta(meta, opts.Exact)
} else {
glog.V(4).Infof("Object of type %v does not have ObjectMeta: %v", reflect.TypeOf(obj), err)
}
if e.ExportStrategy != nil {
if err = e.ExportStrategy.Export(obj, opts.Exact); err != nil {
return nil, err
}
} else {
e.CreateStrategy.PrepareForCreate(obj)
}
return obj, nil
}

View File

@ -20,10 +20,12 @@ import (
"fmt"
"path"
"reflect"
"strconv"
"testing"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/fields"
@ -50,7 +52,19 @@ func (t *testRESTStrategy) NamespaceScoped() bool { return t.namespaceS
func (t *testRESTStrategy) AllowCreateOnUpdate() bool { return t.allowCreateOnUpdate }
func (t *testRESTStrategy) AllowUnconditionalUpdate() bool { return t.allowUnconditionalUpdate }
func (t *testRESTStrategy) PrepareForCreate(obj runtime.Object) {}
func (t *testRESTStrategy) PrepareForCreate(obj runtime.Object) {
metaObj, err := meta.Accessor(obj)
if err != nil {
panic(err.Error())
}
labels := metaObj.GetLabels()
if labels == nil {
labels = map[string]string{}
}
labels["prepare_create"] = "true"
metaObj.SetLabels(labels)
}
func (t *testRESTStrategy) PrepareForUpdate(obj, old runtime.Object) {}
func (t *testRESTStrategy) Validate(ctx api.Context, obj runtime.Object) field.ErrorList {
return nil
@ -325,6 +339,95 @@ func TestEtcdUpdate(t *testing.T) {
}
type testPodExport struct{}
func (t testPodExport) Export(obj runtime.Object, exact bool) error {
pod := obj.(*api.Pod)
if pod.Labels == nil {
pod.Labels = map[string]string{}
}
pod.Labels["exported"] = "true"
pod.Labels["exact"] = strconv.FormatBool(exact)
return nil
}
func TestEtcdCustomExport(t *testing.T) {
podA := api.Pod{
ObjectMeta: api.ObjectMeta{
Namespace: "test",
Name: "foo",
Labels: map[string]string{},
},
Spec: api.PodSpec{NodeName: "machine"},
}
server, registry := NewTestGenericEtcdRegistry(t)
defer server.Terminate(t)
registry.ExportStrategy = testPodExport{}
testContext := api.WithNamespace(api.NewContext(), "test")
registry.UpdateStrategy.(*testRESTStrategy).allowCreateOnUpdate = true
if !updateAndVerify(t, testContext, registry, &podA) {
t.Errorf("Unexpected error updating podA")
}
obj, err := registry.Export(testContext, podA.Name, unversioned.ExportOptions{})
if err != nil {
t.Errorf("unexpected error: %v", err)
}
exportedPod := obj.(*api.Pod)
if exportedPod.Labels["exported"] != "true" {
t.Errorf("expected: exported->true, found: %s", exportedPod.Labels["exported"])
}
if exportedPod.Labels["exact"] != "false" {
t.Errorf("expected: exact->false, found: %s", exportedPod.Labels["exact"])
}
delete(exportedPod.Labels, "exported")
delete(exportedPod.Labels, "exact")
exportObjectMeta(&podA.ObjectMeta, false)
podA.Spec = exportedPod.Spec
if !reflect.DeepEqual(&podA, exportedPod) {
t.Errorf("expected:\n%v\nsaw:\n%v\n", &podA, exportedPod)
}
}
func TestEtcdBasicExport(t *testing.T) {
podA := api.Pod{
ObjectMeta: api.ObjectMeta{
Namespace: "test",
Name: "foo",
Labels: map[string]string{},
},
Spec: api.PodSpec{NodeName: "machine"},
Status: api.PodStatus{HostIP: "1.2.3.4"},
}
server, registry := NewTestGenericEtcdRegistry(t)
defer server.Terminate(t)
testContext := api.WithNamespace(api.NewContext(), "test")
registry.UpdateStrategy.(*testRESTStrategy).allowCreateOnUpdate = true
if !updateAndVerify(t, testContext, registry, &podA) {
t.Errorf("Unexpected error updating podA")
}
obj, err := registry.Export(testContext, podA.Name, unversioned.ExportOptions{})
if err != nil {
t.Errorf("unexpected error: %v", err)
}
exportedPod := obj.(*api.Pod)
if exportedPod.Labels["prepare_create"] != "true" {
t.Errorf("expected: prepare_create->true, found: %s", exportedPod.Labels["prepare_create"])
}
exportObjectMeta(&podA.ObjectMeta, false)
podA.Spec = exportedPod.Spec
if !reflect.DeepEqual(&podA, exportedPod) {
t.Errorf("expected:\n%v\nsaw:\n%v\n", &podA, exportedPod)
}
}
func TestEtcdGet(t *testing.T) {
podA := &api.Pod{
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "foo"},
@ -344,7 +447,6 @@ func TestEtcdGet(t *testing.T) {
if !updateAndVerify(t, testContext, registry, podA) {
t.Errorf("Unexpected error updating podA")
}
}
func TestEtcdDelete(t *testing.T) {

View File

@ -58,6 +58,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
CreateStrategy: limitrange.Strategy,
UpdateStrategy: limitrange.Strategy,
ExportStrategy: limitrange.Strategy,
Storage: storageInterface,
}

View File

@ -78,6 +78,13 @@ func LimitRangeToSelectableFields(limitRange *api.LimitRange) fields.Set {
return fields.Set{}
}
func (limitrangeStrategy) Export(runtime.Object, bool) error {
// Copied from OpenShift exporter
// TODO: this needs to be fixed
// limitrange.Strategy.PrepareForCreate(obj)
return nil
}
func MatchLimitRange(label labels.Selector, field fields.Selector) generic.Matcher {
return &generic.SelectionPredicate{
Label: label,

View File

@ -76,6 +76,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator, con
CreateStrategy: node.Strategy,
UpdateStrategy: node.Strategy,
ExportStrategy: node.Strategy,
Storage: storageInterface,
}

View File

@ -90,6 +90,22 @@ func (nodeStrategy) AllowUnconditionalUpdate() bool {
return true
}
func (ns nodeStrategy) Export(obj runtime.Object, exact bool) error {
n, ok := obj.(*api.Node)
if !ok {
// unexpected programmer error
return fmt.Errorf("unexpected object: %v", obj)
}
ns.PrepareForCreate(obj)
if exact {
return nil
}
// Nodes are the only resources that allow direct status edits, therefore
// we clear that without exact so that the node value can be reused.
n.Status = api.NodeStatus{}
return nil
}
type nodeStatusStrategy struct {
nodeStrategy
}

View File

@ -56,8 +56,10 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
},
EndpointName: "podtemplates",
CreateStrategy: podtemplate.Strategy,
UpdateStrategy: podtemplate.Strategy,
CreateStrategy: podtemplate.Strategy,
UpdateStrategy: podtemplate.Strategy,
ExportStrategy: podtemplate.Strategy,
ReturnDeletedObject: true,
Storage: storageInterface,

View File

@ -77,6 +77,11 @@ func (podTemplateStrategy) AllowUnconditionalUpdate() bool {
return true
}
func (podTemplateStrategy) Export(obj runtime.Object, exact bool) error {
// Do nothing
return nil
}
func PodTemplateToSelectableFields(podTemplate *api.PodTemplate) fields.Set {
return fields.Set{}
}

View File

@ -20,6 +20,7 @@ import (
"fmt"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/fields"
@ -72,6 +73,26 @@ func (strategy) AllowUnconditionalUpdate() bool {
return true
}
func (s strategy) Export(obj runtime.Object, exact bool) error {
t, ok := obj.(*api.Secret)
if !ok {
// unexpected programmer error
return fmt.Errorf("unexpected object: %v", obj)
}
s.PrepareForCreate(obj)
if exact {
return nil
}
// secrets that are tied to the UID of a service account cannot be exported anyway
if t.Type == api.SecretTypeServiceAccountToken || len(t.Annotations[api.ServiceAccountUIDKey]) > 0 {
errs := []*field.Error{
field.Invalid(field.NewPath("type"), t, "can not export service account secrets"),
}
return errors.NewInvalid("Secret", t.Name, errs)
}
return nil
}
// Matcher returns a generic matcher for a given label and field selector.
func Matcher(label labels.Selector, field fields.Selector) generic.Matcher {
return generic.MatcherFunc(func(obj runtime.Object) (bool, error) {

View File

@ -0,0 +1,99 @@
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package secret
import (
"reflect"
"testing"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/runtime"
)
func TestExportSecret(t *testing.T) {
tests := []struct {
objIn runtime.Object
objOut runtime.Object
exact bool
expectErr bool
}{
{
objIn: &api.Secret{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
},
Data: map[string][]byte{
"foo": []byte("bar"),
},
},
objOut: &api.Secret{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
},
Data: map[string][]byte{
"foo": []byte("bar"),
},
},
exact: true,
},
{
objIn: &api.Secret{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
},
Type: api.SecretTypeServiceAccountToken,
},
expectErr: true,
},
{
objIn: &api.Secret{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
Annotations: map[string]string{
api.ServiceAccountUIDKey: "true",
},
},
},
expectErr: true,
},
{
objIn: &api.Pod{},
expectErr: true,
},
}
for _, test := range tests {
err := Strategy.Export(test.objIn, test.exact)
if err != nil {
if !test.expectErr {
t.Errorf("unexpected error: %v", err)
}
continue
}
if test.expectErr {
t.Error("unexpected non-error")
continue
}
if !reflect.DeepEqual(test.objIn, test.objOut) {
t.Errorf("expected:\n%v\nsaw:\n%v\n", test.objOut, test.objIn)
}
}
}

View File

@ -79,6 +79,28 @@ func (svcStrategy) AllowUnconditionalUpdate() bool {
return true
}
func (svcStrategy) Export(obj runtime.Object, exact bool) error {
t, ok := obj.(*api.Service)
if !ok {
// unexpected programmer error
return fmt.Errorf("unexpected object: %v", obj)
}
// TODO: service does not yet have a prepare create strategy (see above)
t.Status = api.ServiceStatus{}
if exact {
return nil
}
if t.Spec.ClusterIP != api.ClusterIPNone {
t.Spec.ClusterIP = ""
}
if t.Spec.Type == api.ServiceTypeNodePort {
for i := range t.Spec.Ports {
t.Spec.Ports[i].NodePort = 0
}
}
return nil
}
func MatchServices(label labels.Selector, field fields.Selector) generic.Matcher {
return &generic.SelectionPredicate{
Label: label,

View File

@ -17,6 +17,7 @@ limitations under the License.
package service
import (
"reflect"
"testing"
"k8s.io/kubernetes/pkg/api"
@ -26,6 +27,83 @@ import (
"k8s.io/kubernetes/pkg/util/intstr"
)
func TestExportService(t *testing.T) {
tests := []struct {
objIn runtime.Object
objOut runtime.Object
exact bool
expectErr bool
}{
{
objIn: &api.Service{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
},
Status: api.ServiceStatus{
LoadBalancer: api.LoadBalancerStatus{
Ingress: []api.LoadBalancerIngress{
{IP: "1.2.3.4"},
},
},
},
},
objOut: &api.Service{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
},
},
exact: true,
},
{
objIn: &api.Service{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
},
Spec: api.ServiceSpec{
ClusterIP: "10.0.0.1",
},
Status: api.ServiceStatus{
LoadBalancer: api.LoadBalancerStatus{
Ingress: []api.LoadBalancerIngress{
{IP: "1.2.3.4"},
},
},
},
},
objOut: &api.Service{
ObjectMeta: api.ObjectMeta{
Name: "foo",
Namespace: "bar",
},
},
},
{
objIn: &api.Pod{},
expectErr: true,
},
}
for _, test := range tests {
err := Strategy.Export(test.objIn, test.exact)
if err != nil {
if !test.expectErr {
t.Errorf("unexpected error: %v", err)
}
continue
}
if test.expectErr {
t.Error("unexpected non-error")
continue
}
if !reflect.DeepEqual(test.objIn, test.objOut) {
t.Errorf("expected:\n%v\nsaw:\n%v\n", test.objOut, test.objIn)
}
}
}
func TestCheckGeneratedNameError(t *testing.T) {
expect := errors.NewNotFound("foo", "bar")
if err := rest.CheckGeneratedNameError(Strategy, expect, &api.Pod{}); err != expect {

View File

@ -399,6 +399,9 @@ func TestGuaranteedUpdate(t *testing.T) {
return objUpdate, nil
}))
if err != nil {
t.Errorf("unexpected error: %v", err)
}
objCheck := &storagetesting.TestResource{}
err = helper.Get(context.TODO(), key, objCheck, false)
@ -406,7 +409,7 @@ func TestGuaranteedUpdate(t *testing.T) {
t.Errorf("Unexpected error %#v", err)
}
if objCheck.Value != 2 {
t.Errorf("Value should have been 2 but got", objCheck.Value)
t.Errorf("Value should have been 2 but got %v", objCheck.Value)
}
if !callbackCalled {