Skip to content

Commit

Permalink
add delete precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Xu committed Mar 25, 2016
1 parent 590038d commit 31b425b
Show file tree
Hide file tree
Showing 71 changed files with 1,570 additions and 342 deletions.
21 changes: 18 additions & 3 deletions api/swagger-spec/autoscaling_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,6 @@
"v1.DeleteOptions": {
"id": "v1.DeleteOptions",
"description": "DeleteOptions may be provided when deleting an API object",
"required": [
"gracePeriodSeconds"
],
"properties": {
"kind": {
"type": "string",
Expand All @@ -1185,9 +1182,27 @@
"type": "integer",
"format": "int64",
"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."
},
"preconditions": {
"$ref": "v1.Preconditions",
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
}
}
},
"v1.Preconditions": {
"id": "v1.Preconditions",
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
"properties": {
"uid": {
"$ref": "types.UID",
"description": "Specifies the target UID."
}
}
},
"types.UID": {
"id": "types.UID",
"properties": {}
},
"unversioned.APIResourceList": {
"id": "unversioned.APIResourceList",
"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.",
Expand Down
21 changes: 18 additions & 3 deletions api/swagger-spec/batch_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2410,9 +2410,6 @@
"v1.DeleteOptions": {
"id": "v1.DeleteOptions",
"description": "DeleteOptions may be provided when deleting an API object",
"required": [
"gracePeriodSeconds"
],
"properties": {
"kind": {
"type": "string",
Expand All @@ -2426,9 +2423,27 @@
"type": "integer",
"format": "int64",
"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."
},
"preconditions": {
"$ref": "v1.Preconditions",
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
}
}
},
"v1.Preconditions": {
"id": "v1.Preconditions",
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
"properties": {
"uid": {
"$ref": "types.UID",
"description": "Specifies the target UID."
}
}
},
"types.UID": {
"id": "types.UID",
"properties": {}
},
"unversioned.APIResourceList": {
"id": "unversioned.APIResourceList",
"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.",
Expand Down
21 changes: 18 additions & 3 deletions api/swagger-spec/extensions_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -7783,9 +7783,6 @@
"v1.DeleteOptions": {
"id": "v1.DeleteOptions",
"description": "DeleteOptions may be provided when deleting an API object",
"required": [
"gracePeriodSeconds"
],
"properties": {
"kind": {
"type": "string",
Expand All @@ -7799,9 +7796,27 @@
"type": "integer",
"format": "int64",
"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."
},
"preconditions": {
"$ref": "v1.Preconditions",
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
}
}
},
"v1.Preconditions": {
"id": "v1.Preconditions",
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
"properties": {
"uid": {
"$ref": "types.UID",
"description": "Specifies the target UID."
}
}
},
"types.UID": {
"id": "types.UID",
"properties": {}
},
"v1beta1.DeploymentList": {
"id": "v1beta1.DeploymentList",
"description": "DeploymentList is a list of Deployments.",
Expand Down
21 changes: 18 additions & 3 deletions api/swagger-spec/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -15118,9 +15118,6 @@
"v1.DeleteOptions": {
"id": "v1.DeleteOptions",
"description": "DeleteOptions may be provided when deleting an API object",
"required": [
"gracePeriodSeconds"
],
"properties": {
"kind": {
"type": "string",
Expand All @@ -15134,9 +15131,27 @@
"type": "integer",
"format": "int64",
"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."
},
"preconditions": {
"$ref": "v1.Preconditions",
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned."
}
}
},
"v1.Preconditions": {
"id": "v1.Preconditions",
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
"properties": {
"uid": {
"$ref": "types.UID",
"description": "Specifies the target UID."
}
}
},
"types.UID": {
"id": "types.UID",
"properties": {}
},
"v1.EndpointsList": {
"id": "v1.EndpointsList",
"description": "EndpointsList is a list of endpoints.",
Expand Down
1 change: 1 addition & 0 deletions cmd/genconversion/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func main() {
generator := kruntime.NewConversionGenerator(api.Scheme, versionPath)
apiShort := generator.AddImport(path.Join(pkgBase, "api"))
generator.AddImport(path.Join(pkgBase, "api/resource"))
generator.AddImport(path.Join(pkgBase, "types"))
// TODO(wojtek-t): Change the overwrites to a flag.
generator.OverwritePackage(gv.Version, "")
for _, knownType := range api.Scheme.KnownTypes(gv) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/libs/go2idl/.import-restrictions
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"SelectorRegexp": "k8s[.]io",
"AllowedPrefixes": [
"k8s.io/kubernetes/cmd/libs/go2idl",
"k8s.io/kubernetes/third_party"
"k8s.io/kubernetes/third_party",
"k8s.io/kubernetes/pkg/util/sets"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion cmd/libs/go2idl/generator/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (c *Context) ExecutePackage(outDir string, p Package) error {
}
}
if len(errors) > 0 {
return fmt.Errorf("errors in package %q:\n%v\n", p.Name(), strings.Join(errs2strings(errors), "\n"))
return fmt.Errorf("errors in package %q:\n%v\n", p.Path(), strings.Join(errs2strings(errors), "\n"))
}
return nil
}
Expand Down
1 change: 0 additions & 1 deletion cmd/libs/go2idl/import-boss/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func main() {
"k8s.io/kubernetes/cmd/",
"k8s.io/kubernetes/plugin/",
}
arguments.OutputBase = ""
arguments.Recursive = true
// arguments.VerifyOnly = true

Expand Down
49 changes: 47 additions & 2 deletions docs/api-reference/autoscaling/v1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,17 @@ <h3 id="_v1_deleteoptions">v1.DeleteOptions</h3>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">gracePeriodSeconds</p></td>
<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>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</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">integer (int64)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">preconditions</p></td>
<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>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_preconditions">v1.Preconditions</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -593,6 +600,40 @@ <h3 id="_unversioned_listmeta">unversioned.ListMeta</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_preconditions">v1.Preconditions</h3>
<div class="paragraph">
<p>Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">uid</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Specifies the target UID.</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"><a href="#_types_uid">types.UID</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_crossversionobjectreference">v1.CrossVersionObjectReference</h3>
Expand Down Expand Up @@ -1131,6 +1172,10 @@ <h3 id="_v1_objectmeta">v1.ObjectMeta</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_types_uid">types.UID</h3>

</div>
<div class="sect2">
<h3 id="_unversioned_statuscause">unversioned.StatusCause</h3>
Expand Down Expand Up @@ -1233,7 +1278,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-03-15 23:42:40 UTC
Last updated 2016-03-21 22:46:55 UTC
</div>
</div>
</body>
Expand Down
49 changes: 47 additions & 2 deletions docs/api-reference/batch/v1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,40 @@ <h2 id="_top_level_api_objects">Top Level API Objects</h2>
<h2 id="_definitions">Definitions</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_v1_preconditions">v1.Preconditions</h3>
<div class="paragraph">
<p>Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">uid</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Specifies the target UID.</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"><a href="#_types_uid">types.UID</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_selinuxoptions">v1.SELinuxOptions</h3>
<div class="paragraph">
<p>SELinuxOptions are the labels to be applied to the container</p>
Expand Down Expand Up @@ -1693,6 +1727,10 @@ <h3 id="_v1_objectmeta">v1.ObjectMeta</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_types_uid">types.UID</h3>

</div>
<div class="sect2">
<h3 id="_v1_hostpathvolumesource">v1.HostPathVolumeSource</h3>
Expand Down Expand Up @@ -2875,10 +2913,17 @@ <h3 id="_v1_deleteoptions">v1.DeleteOptions</h3>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">gracePeriodSeconds</p></td>
<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>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</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">integer (int64)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">preconditions</p></td>
<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>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_preconditions">v1.Preconditions</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -3875,7 +3920,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-03-15 23:42:36 UTC
Last updated 2016-03-21 22:46:48 UTC
</div>
</div>
</body>
Expand Down
Loading

0 comments on commit 31b425b

Please sign in to comment.