Commit bb7cc740 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #40013 from jsafrane/storage-ga-class-attributes

Automatic merge from submit-queue Add ClassName attributes to PV and PVC This just adds new attributes to PV/PVC. Real code that uses the attributes instead of beta annotations will follow when we agree on the attribute names / style.
parents 1320021a dcb3e19a
...@@ -37674,6 +37674,10 @@ ...@@ -37674,6 +37674,10 @@
"description": "A label query over volumes to consider for binding.", "description": "A label query over volumes to consider for binding.",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
}, },
"storageClassName": {
"description": "Name of the StorageClass required by the claim. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1",
"type": "string"
},
"volumeName": { "volumeName": {
"description": "VolumeName is the binding reference to the PersistentVolume backing this claim.", "description": "VolumeName is the binding reference to the PersistentVolume backing this claim.",
"type": "string" "type": "string"
...@@ -37842,6 +37846,10 @@ ...@@ -37842,6 +37846,10 @@
"description": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", "description": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md",
"$ref": "#/definitions/io.k8s.kubernetes.pkg.api.v1.RBDVolumeSource" "$ref": "#/definitions/io.k8s.kubernetes.pkg.api.v1.RBDVolumeSource"
}, },
"storageClassName": {
"description": "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.",
"type": "string"
},
"vsphereVolume": { "vsphereVolume": {
"description": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", "description": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine",
"$ref": "#/definitions/io.k8s.kubernetes.pkg.api.v1.VsphereVirtualDiskVolumeSource" "$ref": "#/definitions/io.k8s.kubernetes.pkg.api.v1.VsphereVirtualDiskVolumeSource"
...@@ -3081,6 +3081,10 @@ ...@@ -3081,6 +3081,10 @@
"volumeName": { "volumeName": {
"type": "string", "type": "string",
"description": "VolumeName is the binding reference to the PersistentVolume backing this claim." "description": "VolumeName is the binding reference to the PersistentVolume backing this claim."
},
"storageClassName": {
"type": "string",
"description": "Name of the StorageClass required by the claim. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1"
} }
} }
}, },
......
...@@ -17667,6 +17667,10 @@ ...@@ -17667,6 +17667,10 @@
"volumeName": { "volumeName": {
"type": "string", "type": "string",
"description": "VolumeName is the binding reference to the PersistentVolume backing this claim." "description": "VolumeName is the binding reference to the PersistentVolume backing this claim."
},
"storageClassName": {
"type": "string",
"description": "Name of the StorageClass required by the claim. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1"
} }
} }
}, },
...@@ -17895,6 +17899,10 @@ ...@@ -17895,6 +17899,10 @@
"persistentVolumeReclaimPolicy": { "persistentVolumeReclaimPolicy": {
"type": "string", "type": "string",
"description": "What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy" "description": "What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy"
},
"storageClassName": {
"type": "string",
"description": "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass."
} }
} }
}, },
......
...@@ -1053,6 +1053,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; } ...@@ -1053,6 +1053,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">storageClassName</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Name of the StorageClass required by the claim. More info: <a href="http://kubernetes.io/docs/user-guide/persistent-volumes#class-1">http://kubernetes.io/docs/user-guide/persistent-volumes#class-1</a></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">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody> </tbody>
</table> </table>
......
...@@ -1074,6 +1074,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; } ...@@ -1074,6 +1074,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">storageClassName</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Name of the StorageClass required by the claim. More info: <a href="http://kubernetes.io/docs/user-guide/persistent-volumes#class-1">http://kubernetes.io/docs/user-guide/persistent-volumes#class-1</a></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">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody> </tbody>
</table> </table>
...@@ -7030,6 +7037,13 @@ Examples:<br> ...@@ -7030,6 +7037,13 @@ Examples:<br>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">storageClassName</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.</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">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody> </tbody>
</table> </table>
......
...@@ -404,6 +404,10 @@ type PersistentVolumeSpec struct { ...@@ -404,6 +404,10 @@ type PersistentVolumeSpec struct {
// Optional: what happens to a persistent volume when released from its claim. // Optional: what happens to a persistent volume when released from its claim.
// +optional // +optional
PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy
// Name of StorageClass to which this persistent volume belongs. Empty value
// means that this volume does not belong to any StorageClass.
// +optional
StorageClassName string
} }
// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes // PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes
...@@ -481,6 +485,10 @@ type PersistentVolumeClaimSpec struct { ...@@ -481,6 +485,10 @@ type PersistentVolumeClaimSpec struct {
// claim. When set to non-empty value Selector is not evaluated // claim. When set to non-empty value Selector is not evaluated
// +optional // +optional
VolumeName string VolumeName string
// Name of the StorageClass required by the claim.
// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1
// +optional
StorageClassName *string
} }
type PersistentVolumeClaimStatus struct { type PersistentVolumeClaimStatus struct {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1993,6 +1993,11 @@ message PersistentVolumeClaimSpec { ...@@ -1993,6 +1993,11 @@ message PersistentVolumeClaimSpec {
// VolumeName is the binding reference to the PersistentVolume backing this claim. // VolumeName is the binding reference to the PersistentVolume backing this claim.
// +optional // +optional
optional string volumeName = 3; optional string volumeName = 3;
// Name of the StorageClass required by the claim.
// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1
// +optional
optional string storageClassName = 5;
} }
// PersistentVolumeClaimStatus is the current status of a persistent volume claim. // PersistentVolumeClaimStatus is the current status of a persistent volume claim.
...@@ -2153,6 +2158,11 @@ message PersistentVolumeSpec { ...@@ -2153,6 +2158,11 @@ message PersistentVolumeSpec {
// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy
// +optional // +optional
optional string persistentVolumeReclaimPolicy = 5; optional string persistentVolumeReclaimPolicy = 5;
// Name of StorageClass to which this persistent volume belongs. Empty value
// means that this volume does not belong to any StorageClass.
// +optional
optional string storageClassName = 6;
} }
// PersistentVolumeStatus is the current status of a persistent volume. // PersistentVolumeStatus is the current status of a persistent volume.
......
...@@ -466,6 +466,10 @@ type PersistentVolumeSpec struct { ...@@ -466,6 +466,10 @@ type PersistentVolumeSpec struct {
// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy
// +optional // +optional
PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty" protobuf:"bytes,5,opt,name=persistentVolumeReclaimPolicy,casttype=PersistentVolumeReclaimPolicy"` PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty" protobuf:"bytes,5,opt,name=persistentVolumeReclaimPolicy,casttype=PersistentVolumeReclaimPolicy"`
// Name of StorageClass to which this persistent volume belongs. Empty value
// means that this volume does not belong to any StorageClass.
// +optional
StorageClassName string `json:"storageClassName,omitempty"`
} }
// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes. // PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes.
...@@ -561,6 +565,10 @@ type PersistentVolumeClaimSpec struct { ...@@ -561,6 +565,10 @@ type PersistentVolumeClaimSpec struct {
// VolumeName is the binding reference to the PersistentVolume backing this claim. // VolumeName is the binding reference to the PersistentVolume backing this claim.
// +optional // +optional
VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,3,opt,name=volumeName"` VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,3,opt,name=volumeName"`
// Name of the StorageClass required by the claim.
// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1
// +optional
StorageClassName *string `json:"storageClassName,omitempty"`
} }
// PersistentVolumeClaimStatus is the current status of a persistent volume claim. // PersistentVolumeClaimStatus is the current status of a persistent volume claim.
......
...@@ -1060,11 +1060,12 @@ func (PersistentVolumeClaimList) SwaggerDoc() map[string]string { ...@@ -1060,11 +1060,12 @@ func (PersistentVolumeClaimList) SwaggerDoc() map[string]string {
} }
var map_PersistentVolumeClaimSpec = map[string]string{ var map_PersistentVolumeClaimSpec = map[string]string{
"": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", "": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes",
"accessModes": "AccessModes contains the desired access modes the volume should have. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes-1", "accessModes": "AccessModes contains the desired access modes the volume should have. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes-1",
"selector": "A label query over volumes to consider for binding.", "selector": "A label query over volumes to consider for binding.",
"resources": "Resources represents the minimum resources the volume should have. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources", "resources": "Resources represents the minimum resources the volume should have. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources",
"volumeName": "VolumeName is the binding reference to the PersistentVolume backing this claim.", "volumeName": "VolumeName is the binding reference to the PersistentVolume backing this claim.",
"storageClassName": "Name of the StorageClass required by the claim. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1",
} }
func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string { func (PersistentVolumeClaimSpec) SwaggerDoc() map[string]string {
...@@ -1133,6 +1134,7 @@ var map_PersistentVolumeSpec = map[string]string{ ...@@ -1133,6 +1134,7 @@ var map_PersistentVolumeSpec = map[string]string{
"accessModes": "AccessModes contains all ways the volume can be mounted. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes", "accessModes": "AccessModes contains all ways the volume can be mounted. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes",
"claimRef": "ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#binding", "claimRef": "ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#binding",
"persistentVolumeReclaimPolicy": "What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy", "persistentVolumeReclaimPolicy": "What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy",
"storageClassName": "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.",
} }
func (PersistentVolumeSpec) SwaggerDoc() map[string]string { func (PersistentVolumeSpec) SwaggerDoc() map[string]string {
......
...@@ -2583,6 +2583,7 @@ func autoConvert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(i ...@@ -2583,6 +2583,7 @@ func autoConvert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(i
return err return err
} }
out.VolumeName = in.VolumeName out.VolumeName = in.VolumeName
out.StorageClassName = (*string)(unsafe.Pointer(in.StorageClassName))
return nil return nil
} }
...@@ -2597,6 +2598,7 @@ func autoConvert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(i ...@@ -2597,6 +2598,7 @@ func autoConvert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(i
return err return err
} }
out.VolumeName = in.VolumeName out.VolumeName = in.VolumeName
out.StorageClassName = (*string)(unsafe.Pointer(in.StorageClassName))
return nil return nil
} }
...@@ -2744,6 +2746,7 @@ func autoConvert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in *Persist ...@@ -2744,6 +2746,7 @@ func autoConvert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in *Persist
out.AccessModes = *(*[]api.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) out.AccessModes = *(*[]api.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes))
out.ClaimRef = (*api.ObjectReference)(unsafe.Pointer(in.ClaimRef)) out.ClaimRef = (*api.ObjectReference)(unsafe.Pointer(in.ClaimRef))
out.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) out.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy)
out.StorageClassName = in.StorageClassName
return nil return nil
} }
...@@ -2759,6 +2762,7 @@ func autoConvert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *api.Per ...@@ -2759,6 +2762,7 @@ func autoConvert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *api.Per
out.AccessModes = *(*[]PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) out.AccessModes = *(*[]PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes))
out.ClaimRef = (*ObjectReference)(unsafe.Pointer(in.ClaimRef)) out.ClaimRef = (*ObjectReference)(unsafe.Pointer(in.ClaimRef))
out.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) out.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy)
out.StorageClassName = in.StorageClassName
return nil return nil
} }
......
...@@ -1856,6 +1856,11 @@ func DeepCopy_v1_PersistentVolumeClaimSpec(in interface{}, out interface{}, c *c ...@@ -1856,6 +1856,11 @@ func DeepCopy_v1_PersistentVolumeClaimSpec(in interface{}, out interface{}, c *c
if err := DeepCopy_v1_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil { if err := DeepCopy_v1_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil {
return err return err
} }
if in.StorageClassName != nil {
in, out := &in.StorageClassName, &out.StorageClassName
*out = new(string)
**out = **in
}
return nil return nil
} }
} }
......
...@@ -1900,6 +1900,11 @@ func DeepCopy_api_PersistentVolumeClaimSpec(in interface{}, out interface{}, c * ...@@ -1900,6 +1900,11 @@ func DeepCopy_api_PersistentVolumeClaimSpec(in interface{}, out interface{}, c *
if err := DeepCopy_api_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil { if err := DeepCopy_api_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil {
return err return err
} }
if in.StorageClassName != nil {
in, out := &in.StorageClassName, &out.StorageClassName
*out = new(string)
**out = **in
}
return nil return nil
} }
} }
......
...@@ -1560,7 +1560,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg3_v1.Persisten ...@@ -1560,7 +1560,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg3_v1.Persisten
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 376)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
......
...@@ -5312,6 +5312,13 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope ...@@ -5312,6 +5312,13 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
Format: "", Format: "",
}, },
}, },
"storageClassName": {
SchemaProps: spec.SchemaProps{
Description: "Name of the StorageClass required by the claim. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1",
Type: []string{"string"},
Format: "",
},
},
}, },
}, },
}, },
...@@ -5693,6 +5700,13 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope ...@@ -5693,6 +5700,13 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
Format: "", Format: "",
}, },
}, },
"storageClassName": {
SchemaProps: spec.SchemaProps{
Description: "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.",
Type: []string{"string"},
Format: "",
},
},
}, },
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment