Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 95e09e3

Browse files
author
k8s-merge-robot
committed
Merge pull request kubernetes#22965 from caesarxuchao/delete-UID-precondition
Auto commit by PR queue bot
2 parents e44ad7a + 31b425b commit 95e09e3

File tree

71 files changed

+1570
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1570
-342
lines changed

api/swagger-spec/autoscaling_v1.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,6 @@
11691169
"v1.DeleteOptions": {
11701170
"id": "v1.DeleteOptions",
11711171
"description": "DeleteOptions may be provided when deleting an API object",
1172-
"required": [
1173-
"gracePeriodSeconds"
1174-
],
11751172
"properties": {
11761173
"kind": {
11771174
"type": "string",
@@ -1185,9 +1182,27 @@
11851182
"type": "integer",
11861183
"format": "int64",
11871184
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately."
1185+
},
1186+
"preconditions": {
1187+
"$ref": "v1.Preconditions",
1188+
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
1189+
}
1190+
}
1191+
},
1192+
"v1.Preconditions": {
1193+
"id": "v1.Preconditions",
1194+
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
1195+
"properties": {
1196+
"uid": {
1197+
"$ref": "types.UID",
1198+
"description": "Specifies the target UID."
11881199
}
11891200
}
11901201
},
1202+
"types.UID": {
1203+
"id": "types.UID",
1204+
"properties": {}
1205+
},
11911206
"unversioned.APIResourceList": {
11921207
"id": "unversioned.APIResourceList",
11931208
"description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.",

api/swagger-spec/batch_v1.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,9 +2410,6 @@
24102410
"v1.DeleteOptions": {
24112411
"id": "v1.DeleteOptions",
24122412
"description": "DeleteOptions may be provided when deleting an API object",
2413-
"required": [
2414-
"gracePeriodSeconds"
2415-
],
24162413
"properties": {
24172414
"kind": {
24182415
"type": "string",
@@ -2426,9 +2423,27 @@
24262423
"type": "integer",
24272424
"format": "int64",
24282425
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately."
2426+
},
2427+
"preconditions": {
2428+
"$ref": "v1.Preconditions",
2429+
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
2430+
}
2431+
}
2432+
},
2433+
"v1.Preconditions": {
2434+
"id": "v1.Preconditions",
2435+
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
2436+
"properties": {
2437+
"uid": {
2438+
"$ref": "types.UID",
2439+
"description": "Specifies the target UID."
24292440
}
24302441
}
24312442
},
2443+
"types.UID": {
2444+
"id": "types.UID",
2445+
"properties": {}
2446+
},
24322447
"unversioned.APIResourceList": {
24332448
"id": "unversioned.APIResourceList",
24342449
"description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.",

api/swagger-spec/extensions_v1beta1.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7783,9 +7783,6 @@
77837783
"v1.DeleteOptions": {
77847784
"id": "v1.DeleteOptions",
77857785
"description": "DeleteOptions may be provided when deleting an API object",
7786-
"required": [
7787-
"gracePeriodSeconds"
7788-
],
77897786
"properties": {
77907787
"kind": {
77917788
"type": "string",
@@ -7799,9 +7796,27 @@
77997796
"type": "integer",
78007797
"format": "int64",
78017798
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately."
7799+
},
7800+
"preconditions": {
7801+
"$ref": "v1.Preconditions",
7802+
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
7803+
}
7804+
}
7805+
},
7806+
"v1.Preconditions": {
7807+
"id": "v1.Preconditions",
7808+
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
7809+
"properties": {
7810+
"uid": {
7811+
"$ref": "types.UID",
7812+
"description": "Specifies the target UID."
78027813
}
78037814
}
78047815
},
7816+
"types.UID": {
7817+
"id": "types.UID",
7818+
"properties": {}
7819+
},
78057820
"v1beta1.DeploymentList": {
78067821
"id": "v1beta1.DeploymentList",
78077822
"description": "DeploymentList is a list of Deployments.",

api/swagger-spec/v1.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15118,9 +15118,6 @@
1511815118
"v1.DeleteOptions": {
1511915119
"id": "v1.DeleteOptions",
1512015120
"description": "DeleteOptions may be provided when deleting an API object",
15121-
"required": [
15122-
"gracePeriodSeconds"
15123-
],
1512415121
"properties": {
1512515122
"kind": {
1512615123
"type": "string",
@@ -15134,9 +15131,27 @@
1513415131
"type": "integer",
1513515132
"format": "int64",
1513615133
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately."
15134+
},
15135+
"preconditions": {
15136+
"$ref": "v1.Preconditions",
15137+
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
15138+
}
15139+
}
15140+
},
15141+
"v1.Preconditions": {
15142+
"id": "v1.Preconditions",
15143+
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
15144+
"properties": {
15145+
"uid": {
15146+
"$ref": "types.UID",
15147+
"description": "Specifies the target UID."
1513715148
}
1513815149
}
1513915150
},
15151+
"types.UID": {
15152+
"id": "types.UID",
15153+
"properties": {}
15154+
},
1514015155
"v1.EndpointsList": {
1514115156
"id": "v1.EndpointsList",
1514215157
"description": "EndpointsList is a list of endpoints.",

cmd/genconversion/conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func main() {
9797
generator := kruntime.NewConversionGenerator(api.Scheme, versionPath)
9898
apiShort := generator.AddImport(path.Join(pkgBase, "api"))
9999
generator.AddImport(path.Join(pkgBase, "api/resource"))
100+
generator.AddImport(path.Join(pkgBase, "types"))
100101
// TODO(wojtek-t): Change the overwrites to a flag.
101102
generator.OverwritePackage(gv.Version, "")
102103
for _, knownType := range api.Scheme.KnownTypes(gv) {

cmd/libs/go2idl/.import-restrictions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"SelectorRegexp": "k8s[.]io",
55
"AllowedPrefixes": [
66
"k8s.io/kubernetes/cmd/libs/go2idl",
7-
"k8s.io/kubernetes/third_party"
7+
"k8s.io/kubernetes/third_party",
8+
"k8s.io/kubernetes/pkg/util/sets"
89
]
910
}
1011
]

cmd/libs/go2idl/generator/execute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func (c *Context) ExecutePackage(outDir string, p Package) error {
286286
}
287287
}
288288
if len(errors) > 0 {
289-
return fmt.Errorf("errors in package %q:\n%v\n", p.Name(), strings.Join(errs2strings(errors), "\n"))
289+
return fmt.Errorf("errors in package %q:\n%v\n", p.Path(), strings.Join(errs2strings(errors), "\n"))
290290
}
291291
return nil
292292
}

cmd/libs/go2idl/import-boss/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ func main() {
7474
"k8s.io/kubernetes/cmd/",
7575
"k8s.io/kubernetes/plugin/",
7676
}
77-
arguments.OutputBase = ""
7877
arguments.Recursive = true
7978
// arguments.VerifyOnly = true
8079

docs/api-reference/autoscaling/v1/definitions.html

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,17 @@ <h3 id="_v1_deleteoptions">v1.DeleteOptions</h3>
428428
<tr>
429429
<td class="tableblock halign-left valign-top"><p class="tableblock">gracePeriodSeconds</p></td>
430430
<td class="tableblock halign-left valign-top"><p class="tableblock">The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.</p></td>
431-
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
431+
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
432432
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
433433
<td class="tableblock halign-left valign-top"></td>
434434
</tr>
435+
<tr>
436+
<td class="tableblock halign-left valign-top"><p class="tableblock">preconditions</p></td>
437+
<td class="tableblock halign-left valign-top"><p class="tableblock">Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.</p></td>
438+
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
439+
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_preconditions">v1.Preconditions</a></p></td>
440+
<td class="tableblock halign-left valign-top"></td>
441+
</tr>
435442
</tbody>
436443
</table>
437444

@@ -593,6 +600,40 @@ <h3 id="_unversioned_listmeta">unversioned.ListMeta</h3>
593600
</tbody>
594601
</table>
595602

603+
</div>
604+
<div class="sect2">
605+
<h3 id="_v1_preconditions">v1.Preconditions</h3>
606+
<div class="paragraph">
607+
<p>Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.</p>
608+
</div>
609+
<table class="tableblock frame-all grid-all" style="width:100%; ">
610+
<colgroup>
611+
<col style="width:20%;">
612+
<col style="width:20%;">
613+
<col style="width:20%;">
614+
<col style="width:20%;">
615+
<col style="width:20%;">
616+
</colgroup>
617+
<thead>
618+
<tr>
619+
<th class="tableblock halign-left valign-top">Name</th>
620+
<th class="tableblock halign-left valign-top">Description</th>
621+
<th class="tableblock halign-left valign-top">Required</th>
622+
<th class="tableblock halign-left valign-top">Schema</th>
623+
<th class="tableblock halign-left valign-top">Default</th>
624+
</tr>
625+
</thead>
626+
<tbody>
627+
<tr>
628+
<td class="tableblock halign-left valign-top"><p class="tableblock">uid</p></td>
629+
<td class="tableblock halign-left valign-top"><p class="tableblock">Specifies the target UID.</p></td>
630+
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
631+
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_types_uid">types.UID</a></p></td>
632+
<td class="tableblock halign-left valign-top"></td>
633+
</tr>
634+
</tbody>
635+
</table>
636+
596637
</div>
597638
<div class="sect2">
598639
<h3 id="_v1_crossversionobjectreference">v1.CrossVersionObjectReference</h3>
@@ -1131,6 +1172,10 @@ <h3 id="_v1_objectmeta">v1.ObjectMeta</h3>
11311172
</tbody>
11321173
</table>
11331174

1175+
</div>
1176+
<div class="sect2">
1177+
<h3 id="_types_uid">types.UID</h3>
1178+
11341179
</div>
11351180
<div class="sect2">
11361181
<h3 id="_unversioned_statuscause">unversioned.StatusCause</h3>
@@ -1233,7 +1278,7 @@ <h3 id="_any">any</h3>
12331278
</div>
12341279
<div id="footer">
12351280
<div id="footer-text">
1236-
Last updated 2016-03-15 23:42:40 UTC
1281+
Last updated 2016-03-21 22:46:55 UTC
12371282
</div>
12381283
</div>
12391284
</body>

docs/api-reference/batch/v1/definitions.html

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,40 @@ <h2 id="_top_level_api_objects">Top Level API Objects</h2>
383383
<h2 id="_definitions">Definitions</h2>
384384
<div class="sectionbody">
385385
<div class="sect2">
386+
<h3 id="_v1_preconditions">v1.Preconditions</h3>
387+
<div class="paragraph">
388+
<p>Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.</p>
389+
</div>
390+
<table class="tableblock frame-all grid-all" style="width:100%; ">
391+
<colgroup>
392+
<col style="width:20%;">
393+
<col style="width:20%;">
394+
<col style="width:20%;">
395+
<col style="width:20%;">
396+
<col style="width:20%;">
397+
</colgroup>
398+
<thead>
399+
<tr>
400+
<th class="tableblock halign-left valign-top">Name</th>
401+
<th class="tableblock halign-left valign-top">Description</th>
402+
<th class="tableblock halign-left valign-top">Required</th>
403+
<th class="tableblock halign-left valign-top">Schema</th>
404+
<th class="tableblock halign-left valign-top">Default</th>
405+
</tr>
406+
</thead>
407+
<tbody>
408+
<tr>
409+
<td class="tableblock halign-left valign-top"><p class="tableblock">uid</p></td>
410+
<td class="tableblock halign-left valign-top"><p class="tableblock">Specifies the target UID.</p></td>
411+
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
412+
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_types_uid">types.UID</a></p></td>
413+
<td class="tableblock halign-left valign-top"></td>
414+
</tr>
415+
</tbody>
416+
</table>
417+
418+
</div>
419+
<div class="sect2">
386420
<h3 id="_v1_selinuxoptions">v1.SELinuxOptions</h3>
387421
<div class="paragraph">
388422
<p>SELinuxOptions are the labels to be applied to the container</p>
@@ -1693,6 +1727,10 @@ <h3 id="_v1_objectmeta">v1.ObjectMeta</h3>
16931727
</tbody>
16941728
</table>
16951729

1730+
</div>
1731+
<div class="sect2">
1732+
<h3 id="_types_uid">types.UID</h3>
1733+
16961734
</div>
16971735
<div class="sect2">
16981736
<h3 id="_v1_hostpathvolumesource">v1.HostPathVolumeSource</h3>
@@ -2875,10 +2913,17 @@ <h3 id="_v1_deleteoptions">v1.DeleteOptions</h3>
28752913
<tr>
28762914
<td class="tableblock halign-left valign-top"><p class="tableblock">gracePeriodSeconds</p></td>
28772915
<td class="tableblock halign-left valign-top"><p class="tableblock">The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.</p></td>
2878-
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
2916+
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
28792917
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
28802918
<td class="tableblock halign-left valign-top"></td>
28812919
</tr>
2920+
<tr>
2921+
<td class="tableblock halign-left valign-top"><p class="tableblock">preconditions</p></td>
2922+
<td class="tableblock halign-left valign-top"><p class="tableblock">Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.</p></td>
2923+
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
2924+
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_preconditions">v1.Preconditions</a></p></td>
2925+
<td class="tableblock halign-left valign-top"></td>
2926+
</tr>
28822927
</tbody>
28832928
</table>
28842929

@@ -3875,7 +3920,7 @@ <h3 id="_any">any</h3>
38753920
</div>
38763921
<div id="footer">
38773922
<div id="footer-text">
3878-
Last updated 2016-03-15 23:42:36 UTC
3923+
Last updated 2016-03-21 22:46:48 UTC
38793924
</div>
38803925
</div>
38813926
</body>

0 commit comments

Comments
 (0)