Merge pull request #51228 from wongma7/mount-options-sc

Automatic merge from submit-queue

Add storageClass.mountOptions and use it in all applicable plugins

split off from https://github.com/kubernetes/kubernetes/pull/50919 and still dependent on it. cc @gnufied


issue: https://github.com/kubernetes/features/issues/168

```release-note
Add mount options field to StorageClass. The options listed there are automatically added to PVs provisioned using the class.
```
This commit is contained in:
Kubernetes Submit Queue 2017-08-29 23:48:32 -07:00 committed by GitHub
commit 583c4a442a
35 changed files with 602 additions and 223 deletions

View File

@ -65287,6 +65287,13 @@
"description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
}, },
"mountOptions": {
"description": "Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. [\"ro\", \"soft\"]. Not validated - mount of the PVs will simply fail if one is invalid.",
"type": "array",
"items": {
"type": "string"
}
},
"parameters": { "parameters": {
"description": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.", "description": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
"type": "object", "type": "object",
@ -65363,6 +65370,13 @@
"description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
}, },
"mountOptions": {
"description": "Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. [\"ro\", \"soft\"]. Not validated - mount of the PVs will simply fail if one is invalid.",
"type": "array",
"items": {
"type": "string"
}
},
"parameters": { "parameters": {
"description": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.", "description": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
"type": "object", "type": "object",

View File

@ -720,6 +720,13 @@
"reclaimPolicy": { "reclaimPolicy": {
"$ref": "v1.PersistentVolumeReclaimPolicy", "$ref": "v1.PersistentVolumeReclaimPolicy",
"description": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete." "description": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete."
},
"mountOptions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. [\"ro\", \"soft\"]. Not validated - mount of the PVs will simply fail if one is invalid."
} }
} }
}, },

View File

@ -720,6 +720,13 @@
"reclaimPolicy": { "reclaimPolicy": {
"$ref": "v1.PersistentVolumeReclaimPolicy", "$ref": "v1.PersistentVolumeReclaimPolicy",
"description": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete." "description": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete."
},
"mountOptions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. [\"ro\", \"soft\"]. Not validated - mount of the PVs will simply fail if one is invalid."
} }
} }
}, },

View File

@ -975,6 +975,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_persistentvolumereclaimpolicy">v1.PersistentVolumeReclaimPolicy</a></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_persistentvolumereclaimpolicy">v1.PersistentVolumeReclaimPolicy</a></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">mountOptions</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody> </tbody>
</table> </table>

View File

@ -937,6 +937,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_persistentvolumereclaimpolicy">v1.PersistentVolumeReclaimPolicy</a></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_persistentvolumereclaimpolicy">v1.PersistentVolumeReclaimPolicy</a></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">mountOptions</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody> </tbody>
</table> </table>

View File

@ -54,6 +54,11 @@ type StorageClass struct {
// PersistentVolumes of this storage class are created with // PersistentVolumes of this storage class are created with
// +optional // +optional
ReclaimPolicy *api.PersistentVolumeReclaimPolicy ReclaimPolicy *api.PersistentVolumeReclaimPolicy
// mountOptions are the mount options that dynamically provisioned
// PersistentVolumes of this storage class are created with
// +optional
MountOptions []string
} }
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@ -50,6 +50,7 @@ func autoConvert_v1_StorageClass_To_storage_StorageClass(in *v1.StorageClass, ou
out.Provisioner = in.Provisioner out.Provisioner = in.Provisioner
out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters)) out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
out.ReclaimPolicy = (*api.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy)) out.ReclaimPolicy = (*api.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy))
out.MountOptions = *(*[]string)(unsafe.Pointer(&in.MountOptions))
return nil return nil
} }
@ -63,6 +64,7 @@ func autoConvert_storage_StorageClass_To_v1_StorageClass(in *storage.StorageClas
out.Provisioner = in.Provisioner out.Provisioner = in.Provisioner
out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters)) out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
out.ReclaimPolicy = (*core_v1.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy)) out.ReclaimPolicy = (*core_v1.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy))
out.MountOptions = *(*[]string)(unsafe.Pointer(&in.MountOptions))
return nil return nil
} }

View File

@ -50,6 +50,7 @@ func autoConvert_v1beta1_StorageClass_To_storage_StorageClass(in *v1beta1.Storag
out.Provisioner = in.Provisioner out.Provisioner = in.Provisioner
out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters)) out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
out.ReclaimPolicy = (*api.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy)) out.ReclaimPolicy = (*api.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy))
out.MountOptions = *(*[]string)(unsafe.Pointer(&in.MountOptions))
return nil return nil
} }
@ -63,6 +64,7 @@ func autoConvert_storage_StorageClass_To_v1beta1_StorageClass(in *storage.Storag
out.Provisioner = in.Provisioner out.Provisioner = in.Provisioner
out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters)) out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
out.ReclaimPolicy = (*v1.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy)) out.ReclaimPolicy = (*v1.PersistentVolumeReclaimPolicy)(unsafe.Pointer(in.ReclaimPolicy))
out.MountOptions = *(*[]string)(unsafe.Pointer(&in.MountOptions))
return nil return nil
} }

View File

@ -69,6 +69,11 @@ func (in *StorageClass) DeepCopyInto(out *StorageClass) {
**out = **in **out = **in
} }
} }
if in.MountOptions != nil {
in, out := &in.MountOptions, &out.MountOptions
*out = make([]string, len(*in))
copy(*out, *in)
}
return return
} }

View File

@ -798,12 +798,13 @@ const operationDelete = "Delete"
const operationRecycle = "Recycle" const operationRecycle = "Recycle"
var ( var (
classGold string = "gold" classGold string = "gold"
classSilver string = "silver" classSilver string = "silver"
classEmpty string = "" classEmpty string = ""
classNonExisting string = "non-existing" classNonExisting string = "non-existing"
classExternal string = "external" classExternal string = "external"
classUnknownInternal string = "unknown-internal" classUnknownInternal string = "unknown-internal"
classUnsupportedMountOptions string = "unsupported-mountoptions"
) )
// wrapTestWithPluginCalls returns a testCall that: // wrapTestWithPluginCalls returns a testCall that:

View File

@ -81,6 +81,18 @@ var storageClasses = []*storage.StorageClass{
Parameters: class1Parameters, Parameters: class1Parameters,
ReclaimPolicy: &deleteReclaimPolicy, ReclaimPolicy: &deleteReclaimPolicy,
}, },
{
TypeMeta: metav1.TypeMeta{
Kind: "StorageClass",
},
ObjectMeta: metav1.ObjectMeta{
Name: "unsupported-mountoptions",
},
Provisioner: mockPluginName,
Parameters: class1Parameters,
ReclaimPolicy: &deleteReclaimPolicy,
MountOptions: []string{"foo"},
},
} }
// call to storageClass 1, returning an error // call to storageClass 1, returning an error
@ -392,6 +404,17 @@ func TestProvisionSync(t *testing.T) {
testSyncClaim, testSyncClaim,
), ),
}, },
{
// No provisioning + warning event with unsupported storageClass.mountOptions
"11-20 - unsupported storageClass.mountOptions",
novolumes,
novolumes,
newClaimArray("claim11-20", "uid11-20", "1Gi", "", v1.ClaimPending, &classUnsupportedMountOptions),
newClaimArray("claim11-20", "uid11-20", "1Gi", "", v1.ClaimPending, &classUnsupportedMountOptions, annStorageProvisioner),
// Expect event to be prefixed with "Mount options" because saving PV will fail anyway
[]string{"Warning ProvisioningFailed Mount options"},
noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
},
} }
runSyncTests(t, tests, storageClasses) runSyncTests(t, tests, storageClasses)
} }

View File

@ -1283,6 +1283,7 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
options := vol.VolumeOptions{ options := vol.VolumeOptions{
PersistentVolumeReclaimPolicy: *storageClass.ReclaimPolicy, PersistentVolumeReclaimPolicy: *storageClass.ReclaimPolicy,
MountOptions: storageClass.MountOptions,
CloudTags: &tags, CloudTags: &tags,
ClusterName: ctrl.clusterName, ClusterName: ctrl.clusterName,
PVName: pvName, PVName: pvName,
@ -1290,6 +1291,15 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
Parameters: storageClass.Parameters, Parameters: storageClass.Parameters,
} }
// Refuse to provision if the plugin doesn't support mount options, creation
// of PV would be rejected by validation anyway
if !plugin.SupportsMountOption() && len(options.MountOptions) > 0 {
strerr := fmt.Sprintf("Mount options are not supported by the provisioner but StorageClass %q has mount options %v", storageClass.Name, options.MountOptions)
glog.V(2).Infof("Mount options are not supported by the provisioner but claim %q's StorageClass %q has mount options %v", claimToClaimKey(claim), storageClass.Name, options.MountOptions)
ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, events.ProvisioningFailed, strerr)
return
}
// Provision the volume // Provision the volume
provisioner, err := plugin.NewProvisioner(options) provisioner, err := plugin.NewProvisioner(options)
if err != nil { if err != nil {

View File

@ -465,6 +465,7 @@ func (c *awsElasticBlockStoreProvisioner) Provision() (*v1.PersistentVolume, err
ReadOnly: false, ReadOnly: false,
}, },
}, },
MountOptions: c.options.MountOptions,
}, },
} }

View File

@ -198,6 +198,7 @@ func (p *azureDiskProvisioner) Provision() (*v1.PersistentVolume, error) {
FSType: &fsType, FSType: &fsType,
}, },
}, },
MountOptions: p.options.MountOptions,
}, },
} }
return pv, nil return pv, nil

View File

@ -196,6 +196,7 @@ func (a *azureFileProvisioner) Provision() (*v1.PersistentVolume, error) {
SecretNamespace: &secretNamespace, SecretNamespace: &secretNamespace,
}, },
}, },
MountOptions: a.options.MountOptions,
}, },
} }
return pv, nil return pv, nil

View File

@ -499,6 +499,7 @@ func (c *cinderVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
ReadOnly: false, ReadOnly: false,
}, },
}, },
MountOptions: c.options.MountOptions,
}, },
} }
if len(c.options.PVC.Spec.AccessModes) == 0 { if len(c.options.PVC.Spec.AccessModes) == 0 {

View File

@ -410,6 +410,7 @@ func (c *gcePersistentDiskProvisioner) Provision() (*v1.PersistentVolume, error)
FSType: fstype, FSType: fstype,
}, },
}, },
MountOptions: c.options.MountOptions,
}, },
} }
if len(c.options.PVC.Spec.AccessModes) == 0 { if len(c.options.PVC.Spec.AccessModes) == 0 {

View File

@ -711,6 +711,7 @@ func (p *glusterfsVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
if len(pv.Spec.AccessModes) == 0 { if len(pv.Spec.AccessModes) == 0 {
pv.Spec.AccessModes = p.plugin.GetAccessModes() pv.Spec.AccessModes = p.plugin.GetAccessModes()
} }
pv.Spec.MountOptions = p.options.MountOptions
gidStr := strconv.FormatInt(int64(gid), 10) gidStr := strconv.FormatInt(int64(gid), 10)

View File

@ -375,6 +375,7 @@ func (p *photonPersistentDiskProvisioner) Provision() (*v1.PersistentVolume, err
FSType: fstype, FSType: fstype,
}, },
}, },
MountOptions: p.options.MountOptions,
}, },
} }
if len(p.options.PVC.Spec.AccessModes) == 0 { if len(p.options.PVC.Spec.AccessModes) == 0 {

View File

@ -50,6 +50,8 @@ type VolumeOptions struct {
// Reclamation policy for a persistent volume // Reclamation policy for a persistent volume
PersistentVolumeReclaimPolicy v1.PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy v1.PersistentVolumeReclaimPolicy
// Mount options for a persistent volume
MountOptions []string
// Suggested PV.Name of the PersistentVolume to provision. // Suggested PV.Name of the PersistentVolume to provision.
// This is a generated name guaranteed to be unique in Kubernetes cluster. // This is a generated name guaranteed to be unique in Kubernetes cluster.
// If you choose not to use it as volume name, ensure uniqueness by either // If you choose not to use it as volume name, ensure uniqueness by either

View File

@ -420,6 +420,7 @@ func (provisioner *quobyteVolumeProvisioner) Provision() (*v1.PersistentVolume,
pv.Spec.Capacity = v1.ResourceList{ pv.Spec.Capacity = v1.ResourceList{
v1.ResourceName(v1.ResourceStorage): resource.MustParse(fmt.Sprintf("%dGi", sizeGB)), v1.ResourceName(v1.ResourceStorage): resource.MustParse(fmt.Sprintf("%dGi", sizeGB)),
} }
pv.Spec.MountOptions = provisioner.options.MountOptions
return pv, nil return pv, nil
} }

View File

@ -383,6 +383,7 @@ func (r *rbdVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
pv.Spec.Capacity = v1.ResourceList{ pv.Spec.Capacity = v1.ResourceList{
v1.ResourceName(v1.ResourceStorage): resource.MustParse(fmt.Sprintf("%dMi", sizeMB)), v1.ResourceName(v1.ResourceStorage): resource.MustParse(fmt.Sprintf("%dMi", sizeMB)),
} }
pv.Spec.MountOptions = r.options.MountOptions
return pv, nil return pv, nil
} }

View File

@ -379,6 +379,7 @@ func (v *vsphereVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
StoragePolicyID: volSpec.StoragePolicyID, StoragePolicyID: volSpec.StoragePolicyID,
}, },
}, },
MountOptions: v.options.MountOptions,
}, },
} }
if len(v.options.PVC.Spec.AccessModes) == 0 { if len(v.options.PVC.Spec.AccessModes) == 0 {

View File

@ -121,6 +121,21 @@ func (m *StorageClass) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ReclaimPolicy))) i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ReclaimPolicy)))
i += copy(dAtA[i:], *m.ReclaimPolicy) i += copy(dAtA[i:], *m.ReclaimPolicy)
} }
if len(m.MountOptions) > 0 {
for _, s := range m.MountOptions {
dAtA[i] = 0x2a
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
return i, nil return i, nil
} }
@ -208,6 +223,12 @@ func (m *StorageClass) Size() (n int) {
l = len(*m.ReclaimPolicy) l = len(*m.ReclaimPolicy)
n += 1 + l + sovGenerated(uint64(l)) n += 1 + l + sovGenerated(uint64(l))
} }
if len(m.MountOptions) > 0 {
for _, s := range m.MountOptions {
l = len(s)
n += 1 + l + sovGenerated(uint64(l))
}
}
return n return n
} }
@ -257,6 +278,7 @@ func (this *StorageClass) String() string {
`Provisioner:` + fmt.Sprintf("%v", this.Provisioner) + `,`, `Provisioner:` + fmt.Sprintf("%v", this.Provisioner) + `,`,
`Parameters:` + mapStringForParameters + `,`, `Parameters:` + mapStringForParameters + `,`,
`ReclaimPolicy:` + valueToStringGenerated(this.ReclaimPolicy) + `,`, `ReclaimPolicy:` + valueToStringGenerated(this.ReclaimPolicy) + `,`,
`MountOptions:` + fmt.Sprintf("%v", this.MountOptions) + `,`,
`}`, `}`,
}, "") }, "")
return s return s
@ -514,6 +536,35 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error {
s := k8s_io_api_core_v1.PersistentVolumeReclaimPolicy(dAtA[iNdEx:postIndex]) s := k8s_io_api_core_v1.PersistentVolumeReclaimPolicy(dAtA[iNdEx:postIndex])
m.ReclaimPolicy = &s m.ReclaimPolicy = &s
iNdEx = postIndex iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MountOptions", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MountOptions = append(m.MountOptions, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:]) skippy, err := skipGenerated(dAtA[iNdEx:])
@ -756,39 +807,40 @@ func init() {
} }
var fileDescriptorGenerated = []byte{ var fileDescriptorGenerated = []byte{
// 529 bytes of a gzipped FileDescriptorProto // 558 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x8a, 0x13, 0x41, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0xce, 0x24, 0x2e, 0xec, 0x76, 0x0c, 0x86, 0x51, 0x21, 0xe4, 0x30, 0x09, 0xeb, 0x25, 0x08, 0x10, 0x8e, 0x13, 0x22, 0x35, 0x9b, 0x44, 0x44, 0x06, 0x24, 0x2b, 0x07, 0x27, 0x2a, 0x97, 0x08,
0x76, 0x6f, 0x76, 0x55, 0x16, 0x41, 0x0f, 0x91, 0x05, 0x05, 0xc5, 0x30, 0x82, 0x07, 0xf1, 0x60, 0x89, 0xdd, 0xa6, 0x2d, 0xa8, 0x42, 0x82, 0x43, 0x50, 0x25, 0x90, 0xa8, 0x1a, 0x19, 0x89, 0x03,
0x67, 0x52, 0x4e, 0xda, 0xf9, 0xe9, 0xa1, 0xbb, 0x66, 0x20, 0x37, 0x1f, 0xc1, 0xe7, 0x11, 0x1f, 0xe2, 0xc0, 0xc6, 0x19, 0x9c, 0xc5, 0x3f, 0x6b, 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 0xd7, 0x2b, 0xb3, 0xf2, 0x2d, 0x31, 0xb5, 0x45, 0x62, 0x6a, 0x57,
0x00, 0x89, 0xa9, 0x5d, 0x27, 0xa6, 0xf6, 0x33, 0x31, 0xb5, 0xef, 0xbf, 0xcc, 0xca, 0xc7, 0x6a, 0x3c,
0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xb4, 0xf1, 0xb4, 0x62, 0x04, 0x00, 0x00,
} }

View File

@ -53,6 +53,12 @@ message StorageClass {
// created with this reclaimPolicy. Defaults to Delete. // created with this reclaimPolicy. Defaults to Delete.
// +optional // +optional
optional string reclaimPolicy = 4; optional string reclaimPolicy = 4;
// Dynamically provisioned PersistentVolumes of this storage class are
// created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
// mount of the PVs will simply fail if one is invalid.
// +optional
repeated string mountOptions = 5;
} }
// StorageClassList is a collection of storage classes. // StorageClassList is a collection of storage classes.

View File

@ -85,7 +85,7 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
} else { } else {
yysep2 := !z.EncBinary() yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [6]bool var yyq2 [7]bool
_, _, _ = yysep2, yyq2, yy2arr2 _, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false const yyr2 bool = false
yyq2[0] = x.Kind != "" yyq2[0] = x.Kind != ""
@ -93,9 +93,10 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
yyq2[2] = true yyq2[2] = true
yyq2[4] = len(x.Parameters) != 0 yyq2[4] = len(x.Parameters) != 0
yyq2[5] = x.ReclaimPolicy != nil yyq2[5] = x.ReclaimPolicy != nil
yyq2[6] = len(x.MountOptions) != 0
var yynn2 int var yynn2 int
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
r.EncodeArrayStart(6) r.EncodeArrayStart(7)
} else { } else {
yynn2 = 1 yynn2 = 1
for _, b := range yyq2 { for _, b := range yyq2 {
@ -264,6 +265,39 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
} }
} }
} }
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[6] {
if x.MountOptions == nil {
r.EncodeNil()
} else {
yym26 := z.EncBinary()
_ = yym26
if false {
} else {
z.F.EncSliceStringV(x.MountOptions, false, e)
}
}
} else {
r.EncodeNil()
}
} else {
if yyq2[6] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("mountOptions"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.MountOptions == nil {
r.EncodeNil()
} else {
yym27 := z.EncBinary()
_ = yym27
if false {
} else {
z.F.EncSliceStringV(x.MountOptions, false, e)
}
}
}
}
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
@ -397,6 +431,18 @@ func (x *StorageClass) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
x.ReclaimPolicy.CodecDecodeSelf(d) x.ReclaimPolicy.CodecDecodeSelf(d)
} }
case "mountOptions":
if r.TryDecodeAsNil() {
x.MountOptions = nil
} else {
yyv15 := &x.MountOptions
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
z.F.DecSliceStringX(yyv15, false, d)
}
}
default: default:
z.DecStructFieldNotFound(-1, yys3) z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3 } // end switch yys3
@ -408,16 +454,16 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj15 int var yyj17 int
var yyb15 bool var yyb17 bool
var yyhl15 bool = l >= 0 var yyhl17 bool = l >= 0
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -425,29 +471,7 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Kind = "" x.Kind = ""
} else { } else {
yyv16 := &x.Kind yyv18 := &x.Kind
yym17 := z.DecBinary()
_ = yym17
if false {
} else {
*((*string)(yyv16)) = r.DecodeString()
}
}
yyj15++
if yyhl15 {
yyb15 = yyj15 > l
} else {
yyb15 = r.CheckBreak()
}
if yyb15 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv18 := &x.APIVersion
yym19 := z.DecBinary() yym19 := z.DecBinary()
_ = yym19 _ = yym19
if false { if false {
@ -455,13 +479,35 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
*((*string)(yyv18)) = r.DecodeString() *((*string)(yyv18)) = r.DecodeString()
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv20 := &x.APIVersion
yym21 := z.DecBinary()
_ = yym21
if false {
} else {
*((*string)(yyv20)) = r.DecodeString()
}
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
} else {
yyb17 = r.CheckBreak()
}
if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -469,22 +515,22 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ObjectMeta = pkg1_v1.ObjectMeta{} x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else { } else {
yyv20 := &x.ObjectMeta yyv22 := &x.ObjectMeta
yym21 := z.DecBinary() yym23 := z.DecBinary()
_ = yym21 _ = yym23
if false { if false {
} else if z.HasExtensions() && z.DecExt(yyv20) { } else if z.HasExtensions() && z.DecExt(yyv22) {
} else { } else {
z.DecFallback(yyv20, false) z.DecFallback(yyv22, false)
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -492,21 +538,21 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Provisioner = "" x.Provisioner = ""
} else { } else {
yyv22 := &x.Provisioner yyv24 := &x.Provisioner
yym23 := z.DecBinary() yym25 := z.DecBinary()
_ = yym23 _ = yym25
if false { if false {
} else { } else {
*((*string)(yyv22)) = r.DecodeString() *((*string)(yyv24)) = r.DecodeString()
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -514,21 +560,21 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Parameters = nil x.Parameters = nil
} else { } else {
yyv24 := &x.Parameters yyv26 := &x.Parameters
yym25 := z.DecBinary() yym27 := z.DecBinary()
_ = yym25 _ = yym27
if false { if false {
} else { } else {
z.F.DecMapStringStringX(yyv24, false, d) z.F.DecMapStringStringX(yyv26, false, d)
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -543,18 +589,40 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} }
x.ReclaimPolicy.CodecDecodeSelf(d) x.ReclaimPolicy.CodecDecodeSelf(d)
} }
for { yyj17++
yyj15++ if yyhl17 {
if yyhl15 { yyb17 = yyj17 > l
yyb15 = yyj15 > l } else {
yyb17 = r.CheckBreak()
}
if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.MountOptions = nil
} else {
yyv29 := &x.MountOptions
yym30 := z.DecBinary()
_ = yym30
if false {
} else { } else {
yyb15 = r.CheckBreak() z.F.DecSliceStringX(yyv29, false, d)
} }
if yyb15 { }
for {
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
} else {
yyb17 = r.CheckBreak()
}
if yyb17 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj15-1, "") z.DecStructFieldNotFound(yyj17-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -966,7 +1034,7 @@ func (x codecSelfer1234) decSliceStorageClass(v *[]StorageClass, d *codec1978.De
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 296) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 320)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]

View File

@ -49,6 +49,12 @@ type StorageClass struct {
// created with this reclaimPolicy. Defaults to Delete. // created with this reclaimPolicy. Defaults to Delete.
// +optional // +optional
ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty" protobuf:"bytes,4,opt,name=reclaimPolicy,casttype=k8s.io/api/core/v1.PersistentVolumeReclaimPolicy"` ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty" protobuf:"bytes,4,opt,name=reclaimPolicy,casttype=k8s.io/api/core/v1.PersistentVolumeReclaimPolicy"`
// Dynamically provisioned PersistentVolumes of this storage class are
// created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
// mount of the PVs will simply fail if one is invalid.
// +optional
MountOptions []string `json:"mountOptions,omitempty" protobuf:"bytes,5,opt,name=mountOptions"`
} }
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@ -33,6 +33,7 @@ var map_StorageClass = map[string]string{
"provisioner": "Provisioner indicates the type of the provisioner.", "provisioner": "Provisioner indicates the type of the provisioner.",
"parameters": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.", "parameters": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
"reclaimPolicy": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.", "reclaimPolicy": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.",
"mountOptions": "Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. [\"ro\", \"soft\"]. Not validated - mount of the PVs will simply fail if one is invalid.",
} }
func (StorageClass) SwaggerDoc() map[string]string { func (StorageClass) SwaggerDoc() map[string]string {

View File

@ -69,6 +69,11 @@ func (in *StorageClass) DeepCopyInto(out *StorageClass) {
**out = **in **out = **in
} }
} }
if in.MountOptions != nil {
in, out := &in.MountOptions, &out.MountOptions
*out = make([]string, len(*in))
copy(*out, *in)
}
return return
} }

View File

@ -121,6 +121,21 @@ func (m *StorageClass) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ReclaimPolicy))) i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ReclaimPolicy)))
i += copy(dAtA[i:], *m.ReclaimPolicy) i += copy(dAtA[i:], *m.ReclaimPolicy)
} }
if len(m.MountOptions) > 0 {
for _, s := range m.MountOptions {
dAtA[i] = 0x2a
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
return i, nil return i, nil
} }
@ -208,6 +223,12 @@ func (m *StorageClass) Size() (n int) {
l = len(*m.ReclaimPolicy) l = len(*m.ReclaimPolicy)
n += 1 + l + sovGenerated(uint64(l)) n += 1 + l + sovGenerated(uint64(l))
} }
if len(m.MountOptions) > 0 {
for _, s := range m.MountOptions {
l = len(s)
n += 1 + l + sovGenerated(uint64(l))
}
}
return n return n
} }
@ -257,6 +278,7 @@ func (this *StorageClass) String() string {
`Provisioner:` + fmt.Sprintf("%v", this.Provisioner) + `,`, `Provisioner:` + fmt.Sprintf("%v", this.Provisioner) + `,`,
`Parameters:` + mapStringForParameters + `,`, `Parameters:` + mapStringForParameters + `,`,
`ReclaimPolicy:` + valueToStringGenerated(this.ReclaimPolicy) + `,`, `ReclaimPolicy:` + valueToStringGenerated(this.ReclaimPolicy) + `,`,
`MountOptions:` + fmt.Sprintf("%v", this.MountOptions) + `,`,
`}`, `}`,
}, "") }, "")
return s return s
@ -514,6 +536,35 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error {
s := k8s_io_api_core_v1.PersistentVolumeReclaimPolicy(dAtA[iNdEx:postIndex]) s := k8s_io_api_core_v1.PersistentVolumeReclaimPolicy(dAtA[iNdEx:postIndex])
m.ReclaimPolicy = &s m.ReclaimPolicy = &s
iNdEx = postIndex iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MountOptions", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MountOptions = append(m.MountOptions, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:]) skippy, err := skipGenerated(dAtA[iNdEx:])
@ -756,38 +807,40 @@ func init() {
} }
var fileDescriptorGenerated = []byte{ var fileDescriptorGenerated = []byte{
// 527 bytes of a gzipped FileDescriptorProto // 554 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbb, 0x8e, 0x13, 0x3f, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x8f, 0x12, 0x41,
0x14, 0xc6,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x6f, 0xe5, 0x83, 0x3d, 0xfd, 0x5b, 0x29,
0xb7, 0x66, 0xed, 0x66, 0x6b, 0xd6, 0x6e, 0xb7, 0x66, 0xed, 0x4b, 0x62, 0xa2, 0x75, 0x62, 0xa2, 0x25, 0x3f, 0x46, 0x35, 0xa6, 0xc0, 0x97, 0xc6, 0x49, 0x9a, 0x5e, 0xff, 0xa1, 0xe9, 0x8d, 0x9a,
0x9b, 0xc4, 0x44, 0xb7, 0x89, 0x89, 0x7e, 0x24, 0x26, 0xfa, 0xfa, 0xd3, 0xac, 0xbd, 0xff, 0xbf, 0xb9, 0x69, 0xed, 0x4d, 0x82, 0x5b, 0x99, 0xcb, 0xe8, 0x7c, 0xb5, 0x31, 0x2b, 0x77, 0x1b, 0xb3,
0x70, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x94, 0xc8, 0xc6, 0xb6, 0x3d, 0x04, 0x00, 0x00, 0x72, 0xbf, 0x31, 0x2b, 0x5f, 0x63, 0x53, 0x5b, 0xc5, 0xa6, 0x76, 0x17, 0x9b, 0xda, 0x7d, 0x6c,
0x6a, 0x3f, 0x62, 0x53, 0xfb, 0xf6, 0xd3, 0xac, 0x7c, 0x78, 0x9c, 0x3b, 0xfe, 0x09, 0x00, 0x00,
0xff, 0xff, 0x2a, 0xfd, 0x7a, 0x0a, 0x73, 0x04, 0x00, 0x00,
} }

View File

@ -53,6 +53,12 @@ message StorageClass {
// created with this reclaimPolicy. Defaults to Delete. // created with this reclaimPolicy. Defaults to Delete.
// +optional // +optional
optional string reclaimPolicy = 4; optional string reclaimPolicy = 4;
// Dynamically provisioned PersistentVolumes of this storage class are
// created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
// mount of the PVs will simply fail if one is invalid.
// +optional
repeated string mountOptions = 5;
} }
// StorageClassList is a collection of storage classes. // StorageClassList is a collection of storage classes.

View File

@ -85,7 +85,7 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
} else { } else {
yysep2 := !z.EncBinary() yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [6]bool var yyq2 [7]bool
_, _, _ = yysep2, yyq2, yy2arr2 _, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false const yyr2 bool = false
yyq2[0] = x.Kind != "" yyq2[0] = x.Kind != ""
@ -93,9 +93,10 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
yyq2[2] = true yyq2[2] = true
yyq2[4] = len(x.Parameters) != 0 yyq2[4] = len(x.Parameters) != 0
yyq2[5] = x.ReclaimPolicy != nil yyq2[5] = x.ReclaimPolicy != nil
yyq2[6] = len(x.MountOptions) != 0
var yynn2 int var yynn2 int
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
r.EncodeArrayStart(6) r.EncodeArrayStart(7)
} else { } else {
yynn2 = 1 yynn2 = 1
for _, b := range yyq2 { for _, b := range yyq2 {
@ -264,6 +265,39 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
} }
} }
} }
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[6] {
if x.MountOptions == nil {
r.EncodeNil()
} else {
yym26 := z.EncBinary()
_ = yym26
if false {
} else {
z.F.EncSliceStringV(x.MountOptions, false, e)
}
}
} else {
r.EncodeNil()
}
} else {
if yyq2[6] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("mountOptions"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.MountOptions == nil {
r.EncodeNil()
} else {
yym27 := z.EncBinary()
_ = yym27
if false {
} else {
z.F.EncSliceStringV(x.MountOptions, false, e)
}
}
}
}
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
@ -397,6 +431,18 @@ func (x *StorageClass) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
x.ReclaimPolicy.CodecDecodeSelf(d) x.ReclaimPolicy.CodecDecodeSelf(d)
} }
case "mountOptions":
if r.TryDecodeAsNil() {
x.MountOptions = nil
} else {
yyv15 := &x.MountOptions
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
z.F.DecSliceStringX(yyv15, false, d)
}
}
default: default:
z.DecStructFieldNotFound(-1, yys3) z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3 } // end switch yys3
@ -408,16 +454,16 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj15 int var yyj17 int
var yyb15 bool var yyb17 bool
var yyhl15 bool = l >= 0 var yyhl17 bool = l >= 0
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -425,29 +471,7 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Kind = "" x.Kind = ""
} else { } else {
yyv16 := &x.Kind yyv18 := &x.Kind
yym17 := z.DecBinary()
_ = yym17
if false {
} else {
*((*string)(yyv16)) = r.DecodeString()
}
}
yyj15++
if yyhl15 {
yyb15 = yyj15 > l
} else {
yyb15 = r.CheckBreak()
}
if yyb15 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv18 := &x.APIVersion
yym19 := z.DecBinary() yym19 := z.DecBinary()
_ = yym19 _ = yym19
if false { if false {
@ -455,13 +479,35 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
*((*string)(yyv18)) = r.DecodeString() *((*string)(yyv18)) = r.DecodeString()
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv20 := &x.APIVersion
yym21 := z.DecBinary()
_ = yym21
if false {
} else {
*((*string)(yyv20)) = r.DecodeString()
}
}
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
} else {
yyb17 = r.CheckBreak()
}
if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -469,22 +515,22 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ObjectMeta = pkg1_v1.ObjectMeta{} x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else { } else {
yyv20 := &x.ObjectMeta yyv22 := &x.ObjectMeta
yym21 := z.DecBinary() yym23 := z.DecBinary()
_ = yym21 _ = yym23
if false { if false {
} else if z.HasExtensions() && z.DecExt(yyv20) { } else if z.HasExtensions() && z.DecExt(yyv22) {
} else { } else {
z.DecFallback(yyv20, false) z.DecFallback(yyv22, false)
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -492,21 +538,21 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Provisioner = "" x.Provisioner = ""
} else { } else {
yyv22 := &x.Provisioner yyv24 := &x.Provisioner
yym23 := z.DecBinary() yym25 := z.DecBinary()
_ = yym23 _ = yym25
if false { if false {
} else { } else {
*((*string)(yyv22)) = r.DecodeString() *((*string)(yyv24)) = r.DecodeString()
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -514,21 +560,21 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Parameters = nil x.Parameters = nil
} else { } else {
yyv24 := &x.Parameters yyv26 := &x.Parameters
yym25 := z.DecBinary() yym27 := z.DecBinary()
_ = yym25 _ = yym27
if false { if false {
} else { } else {
z.F.DecMapStringStringX(yyv24, false, d) z.F.DecMapStringStringX(yyv26, false, d)
} }
} }
yyj15++ yyj17++
if yyhl15 { if yyhl17 {
yyb15 = yyj15 > l yyb17 = yyj17 > l
} else { } else {
yyb15 = r.CheckBreak() yyb17 = r.CheckBreak()
} }
if yyb15 { if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
@ -543,18 +589,40 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} }
x.ReclaimPolicy.CodecDecodeSelf(d) x.ReclaimPolicy.CodecDecodeSelf(d)
} }
for { yyj17++
yyj15++ if yyhl17 {
if yyhl15 { yyb17 = yyj17 > l
yyb15 = yyj15 > l } else {
yyb17 = r.CheckBreak()
}
if yyb17 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.MountOptions = nil
} else {
yyv29 := &x.MountOptions
yym30 := z.DecBinary()
_ = yym30
if false {
} else { } else {
yyb15 = r.CheckBreak() z.F.DecSliceStringX(yyv29, false, d)
} }
if yyb15 { }
for {
yyj17++
if yyhl17 {
yyb17 = yyj17 > l
} else {
yyb17 = r.CheckBreak()
}
if yyb17 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj15-1, "") z.DecStructFieldNotFound(yyj17-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }
@ -966,7 +1034,7 @@ func (x codecSelfer1234) decSliceStorageClass(v *[]StorageClass, d *codec1978.De
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 296) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 320)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]

View File

@ -49,6 +49,12 @@ type StorageClass struct {
// created with this reclaimPolicy. Defaults to Delete. // created with this reclaimPolicy. Defaults to Delete.
// +optional // +optional
ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty" protobuf:"bytes,4,opt,name=reclaimPolicy,casttype=k8s.io/api/core/v1.PersistentVolumeReclaimPolicy"` ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty" protobuf:"bytes,4,opt,name=reclaimPolicy,casttype=k8s.io/api/core/v1.PersistentVolumeReclaimPolicy"`
// Dynamically provisioned PersistentVolumes of this storage class are
// created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
// mount of the PVs will simply fail if one is invalid.
// +optional
MountOptions []string `json:"mountOptions,omitempty" protobuf:"bytes,5,opt,name=mountOptions"`
} }
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@ -33,6 +33,7 @@ var map_StorageClass = map[string]string{
"provisioner": "Provisioner indicates the type of the provisioner.", "provisioner": "Provisioner indicates the type of the provisioner.",
"parameters": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.", "parameters": "Parameters holds the parameters for the provisioner that should create volumes of this storage class.",
"reclaimPolicy": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.", "reclaimPolicy": "Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete.",
"mountOptions": "Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. [\"ro\", \"soft\"]. Not validated - mount of the PVs will simply fail if one is invalid.",
} }
func (StorageClass) SwaggerDoc() map[string]string { func (StorageClass) SwaggerDoc() map[string]string {

View File

@ -69,6 +69,11 @@ func (in *StorageClass) DeepCopyInto(out *StorageClass) {
**out = **in **out = **in
} }
} }
if in.MountOptions != nil {
in, out := &in.MountOptions, &out.MountOptions
*out = make([]string, len(*in))
copy(*out, *in)
}
return return
} }