Merge pull request #45903 from brendandburns/azure-disk-api

Automatic merge from submit-queue (batch tested with PRs 45346, 45903, 45958, 46042, 45975)

Azure disk api

This is to update the AzureDiskApi and split it from the implementation which is caught in rebase hell...

Once this is merged, we'll get the implementation in.

@smarterclayton suggested this as a way to break the rebase hell logjam. request for a quick review.

Thanks!
This commit is contained in:
Kubernetes Submit Queue
2017-05-19 22:29:30 -07:00
committed by GitHub
39 changed files with 2041 additions and 1533 deletions

View File

@@ -42972,6 +42972,10 @@
"description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
"type": "string"
},
"kind": {
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared",
"type": "string"
},
"readOnly": {
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.",
"type": "boolean"

View File

@@ -3610,6 +3610,10 @@
"readOnly": {
"type": "boolean",
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."
},
"kind": {
"$ref": "v1.AzureDataDiskKind",
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared"
}
}
},
@@ -3617,6 +3621,10 @@
"id": "v1.AzureDataDiskCachingMode",
"properties": {}
},
"v1.AzureDataDiskKind": {
"id": "v1.AzureDataDiskKind",
"properties": {}
},
"v1.PhotonPersistentDiskVolumeSource": {
"id": "v1.PhotonPersistentDiskVolumeSource",
"description": "Represents a Photon Controller persistent disk resource.",

View File

@@ -2345,6 +2345,10 @@
"readOnly": {
"type": "boolean",
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."
},
"kind": {
"$ref": "v1.AzureDataDiskKind",
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared"
}
}
},
@@ -2352,6 +2356,10 @@
"id": "v1.AzureDataDiskCachingMode",
"properties": {}
},
"v1.AzureDataDiskKind": {
"id": "v1.AzureDataDiskKind",
"properties": {}
},
"v1.PhotonPersistentDiskVolumeSource": {
"id": "v1.PhotonPersistentDiskVolumeSource",
"description": "Represents a Photon Controller persistent disk resource.",

View File

@@ -3426,6 +3426,10 @@
"readOnly": {
"type": "boolean",
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."
},
"kind": {
"$ref": "v1.AzureDataDiskKind",
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared"
}
}
},
@@ -3433,6 +3437,10 @@
"id": "v1.AzureDataDiskCachingMode",
"properties": {}
},
"v1.AzureDataDiskKind": {
"id": "v1.AzureDataDiskKind",
"properties": {}
},
"v1.PhotonPersistentDiskVolumeSource": {
"id": "v1.PhotonPersistentDiskVolumeSource",
"description": "Represents a Photon Controller persistent disk resource.",

View File

@@ -8065,6 +8065,10 @@
"readOnly": {
"type": "boolean",
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."
},
"kind": {
"$ref": "v1.AzureDataDiskKind",
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared"
}
}
},
@@ -8072,6 +8076,10 @@
"id": "v1.AzureDataDiskCachingMode",
"properties": {}
},
"v1.AzureDataDiskKind": {
"id": "v1.AzureDataDiskKind",
"properties": {}
},
"v1.PhotonPersistentDiskVolumeSource": {
"id": "v1.PhotonPersistentDiskVolumeSource",
"description": "Represents a Photon Controller persistent disk resource.",

View File

@@ -2172,6 +2172,10 @@
"readOnly": {
"type": "boolean",
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."
},
"kind": {
"$ref": "v1.AzureDataDiskKind",
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared"
}
}
},
@@ -2179,6 +2183,10 @@
"id": "v1.AzureDataDiskCachingMode",
"properties": {}
},
"v1.AzureDataDiskKind": {
"id": "v1.AzureDataDiskKind",
"properties": {}
},
"v1.PhotonPersistentDiskVolumeSource": {
"id": "v1.PhotonPersistentDiskVolumeSource",
"description": "Represents a Photon Controller persistent disk resource.",

View File

@@ -19432,6 +19432,10 @@
"readOnly": {
"type": "boolean",
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."
},
"kind": {
"$ref": "v1.AzureDataDiskKind",
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared"
}
}
},
@@ -19439,6 +19443,10 @@
"id": "v1.AzureDataDiskCachingMode",
"properties": {}
},
"v1.AzureDataDiskKind": {
"id": "v1.AzureDataDiskKind",
"properties": {}
},
"v1.PhotonPersistentDiskVolumeSource": {
"id": "v1.PhotonPersistentDiskVolumeSource",
"description": "Represents a Photon Controller persistent disk resource.",

View File

@@ -2650,6 +2650,13 @@ When an object is created, the system will populate this list with the current s
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared</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_azuredatadiskkind">v1.AzureDataDiskKind</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@@ -6333,6 +6340,10 @@ Examples:<br>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azuredatadiskkind">v1.AzureDataDiskKind</h3>
</div>
<div class="sect2">
<h3 id="_v1_preferredschedulingterm">v1.PreferredSchedulingTerm</h3>
@@ -6438,7 +6449,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-05-17 22:24:34 UTC
Last updated 2017-05-18 19:28:33 UTC
</div>
</div>
</body>

View File

@@ -1483,6 +1483,10 @@ When an object is created, the system will populate this list with the current s
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_types_uid">types.UID</h3>
</div>
<div class="sect2">
<h3 id="_v1_azurefilevolumesource">v1.AzureFileVolumeSource</h3>
@@ -1531,10 +1535,6 @@ When an object is created, the system will populate this list with the current s
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_types_uid">types.UID</h3>
</div>
<div class="sect2">
<h3 id="_v1_iscsivolumesource">v1.ISCSIVolumeSource</h3>
@@ -2229,6 +2229,13 @@ When an object is created, the system will populate this list with the current s
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared</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_azuredatadiskkind">v1.AzureDataDiskKind</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@@ -5575,6 +5582,10 @@ Examples:<br>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azuredatadiskkind">v1.AzureDataDiskKind</h3>
</div>
<div class="sect2">
<h3 id="_v1_preferredschedulingterm">v1.PreferredSchedulingTerm</h3>
@@ -5680,7 +5691,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-05-17 22:25:06 UTC
Last updated 2017-05-18 19:30:11 UTC
</div>
</div>
</body>

View File

@@ -2236,6 +2236,13 @@ When an object is created, the system will populate this list with the current s
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared</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_azuredatadiskkind">v1.AzureDataDiskKind</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@@ -5554,6 +5561,10 @@ Examples:<br>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azuredatadiskkind">v1.AzureDataDiskKind</h3>
</div>
<div class="sect2">
<h3 id="_v1_preferredschedulingterm">v1.PreferredSchedulingTerm</h3>
@@ -5776,7 +5787,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-05-17 22:25:11 UTC
Last updated 2017-05-18 19:30:26 UTC
</div>
</div>
</body>

View File

@@ -3358,6 +3358,13 @@ When an object is created, the system will populate this list with the current s
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared</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_azuredatadiskkind">v1.AzureDataDiskKind</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@@ -7781,6 +7788,10 @@ Both these may change in the future. Incoming requests are matched against the h
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azuredatadiskkind">v1.AzureDataDiskKind</h3>
</div>
<div class="sect2">
<h3 id="_v1_preferredschedulingterm">v1.PreferredSchedulingTerm</h3>
@@ -8085,7 +8096,7 @@ Both these may change in the future. Incoming requests are matched against the h
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-05-17 22:25:20 UTC
Last updated 2017-05-18 19:30:55 UTC
</div>
</div>
</body>

View File

@@ -3093,6 +3093,13 @@ When an object is created, the system will populate this list with the current s
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared</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_azuredatadiskkind">v1.AzureDataDiskKind</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@@ -3616,6 +3623,10 @@ When an object is created, the system will populate this list with the current s
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azuredatadiskkind">v1.AzureDataDiskKind</h3>
</div>
<div class="sect2">
<h3 id="_v1_downwardapivolumefile">v1.DownwardAPIVolumeFile</h3>
@@ -3918,7 +3929,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-05-17 22:25:40 UTC
Last updated 2017-05-18 19:31:55 UTC
</div>
</div>
</body>

View File

@@ -3871,6 +3871,13 @@ The resulting set of endpoints can be viewed as:<br>
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared</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_azuredatadiskkind">v1.AzureDataDiskKind</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@@ -9554,6 +9561,10 @@ Examples:<br>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azuredatadiskkind">v1.AzureDataDiskKind</h3>
</div>
<div class="sect2">
<h3 id="_v1_configmapkeyselector">v1.ConfigMapKeySelector</h3>
@@ -10032,7 +10043,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-05-17 22:24:28 UTC
Last updated 2017-05-18 19:28:13 UTC
</div>
</div>
</body>

View File

@@ -10599,6 +10599,10 @@
"description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
"type": "string"
},
"kind": {
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared",
"type": "string"
},
"readOnly": {
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.",
"type": "boolean"

View File

@@ -5809,6 +5809,10 @@
"readOnly": {
"type": "boolean",
"description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts."
},
"kind": {
"$ref": "v1.AzureDataDiskKind",
"description": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared"
}
}
},
@@ -5816,6 +5820,10 @@
"id": "v1.AzureDataDiskCachingMode",
"properties": {}
},
"v1.AzureDataDiskKind": {
"id": "v1.AzureDataDiskKind",
"properties": {}
},
"v1.PhotonPersistentDiskVolumeSource": {
"id": "v1.PhotonPersistentDiskVolumeSource",
"description": "Represents a Photon Controller persistent disk resource.",

View File

@@ -3032,6 +3032,13 @@ When an object is created, the system will populate this list with the current s
<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">kind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared</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_azuredatadiskkind">v1.AzureDataDiskKind</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
@@ -6957,6 +6964,10 @@ Both these may change in the future. Incoming requests are matched against the h
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azuredatadiskkind">v1.AzureDataDiskKind</h3>
</div>
<div class="sect2">
<h3 id="_v1_preferredschedulingterm">v1.PreferredSchedulingTerm</h3>
@@ -7165,7 +7176,7 @@ Both these may change in the future. Incoming requests are matched against the h
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-05-17 22:26:29 UTC
Last updated 2017-05-18 19:40:23 UTC
</div>
</div>
</body>

View File

@@ -427,7 +427,11 @@ func coreFuncs(t apitesting.TestingCommon) []interface{} {
func(obj *api.AzureDiskVolumeSource, c fuzz.Continue) {
if obj.CachingMode == nil {
obj.CachingMode = new(api.AzureDataDiskCachingMode)
*obj.CachingMode = api.AzureDataDiskCachingNone
*obj.CachingMode = api.AzureDataDiskCachingReadWrite
}
if obj.Kind == nil {
obj.Kind = new(api.AzureDataDiskKind)
*obj.Kind = api.AzureSharedBlobDisk
}
if obj.FSType == nil {
obj.FSType = new(string)

View File

@@ -1059,11 +1059,16 @@ type PortworxVolumeSource struct {
}
type AzureDataDiskCachingMode string
type AzureDataDiskKind string
const (
AzureDataDiskCachingNone AzureDataDiskCachingMode = "None"
AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly"
AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite"
AzureSharedBlobDisk AzureDataDiskKind = "Shared"
AzureDedicatedBlobDisk AzureDataDiskKind = "Dedicated"
AzureManagedDisk AzureDataDiskKind = "Managed"
)
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
@@ -1084,6 +1089,8 @@ type AzureDiskVolumeSource struct {
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly *bool
// Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
Kind *AzureDataDiskKind
}
// ScaleIOVolumeSource represents a persistent ScaleIO volume

View File

@@ -239,7 +239,11 @@ func SetDefaults_ISCSIVolumeSource(obj *ISCSIVolumeSource) {
func SetDefaults_AzureDiskVolumeSource(obj *AzureDiskVolumeSource) {
if obj.CachingMode == nil {
obj.CachingMode = new(AzureDataDiskCachingMode)
*obj.CachingMode = AzureDataDiskCachingNone
*obj.CachingMode = AzureDataDiskCachingReadWrite
}
if obj.Kind == nil {
obj.Kind = new(AzureDataDiskKind)
*obj.Kind = AzureSharedBlobDisk
}
if obj.FSType == nil {
obj.FSType = new(string)

File diff suppressed because it is too large Load Diff

View File

@@ -120,6 +120,9 @@ message AzureDiskVolumeSource {
// the ReadOnly setting in VolumeMounts.
// +optional
optional bool readOnly = 5;
// Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
optional string kind = 6;
}
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

View File

@@ -17882,6 +17882,32 @@ func (x *AzureDataDiskCachingMode) CodecDecodeSelf(d *codec1978.Decoder) {
}
}
func (x AzureDataDiskKind) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
yym1 := z.EncBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.EncExt(x) {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x))
}
}
func (x *AzureDataDiskKind) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
yym1 := z.DecBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.DecExt(x) {
} else {
*((*string)(x)) = r.DecodeString()
}
}
func (x *AzureDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
@@ -17896,15 +17922,16 @@ func (x *AzureDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [5]bool
var yyq2 [6]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[2] = x.CachingMode != nil
yyq2[3] = x.FSType != nil
yyq2[4] = x.ReadOnly != nil
yyq2[5] = x.Kind != nil
var yynn2 int
if yyr2 || yy2arr2 {
r.EncodeArrayStart(5)
r.EncodeArrayStart(6)
} else {
yynn2 = 2
for _, b := range yyq2 {
@@ -18048,6 +18075,31 @@ func (x *AzureDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) {
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[5] {
if x.Kind == nil {
r.EncodeNil()
} else {
yy25 := *x.Kind
yy25.CodecEncodeSelf(e)
}
} else {
r.EncodeNil()
}
} else {
if yyq2[5] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("kind"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.Kind == nil {
r.EncodeNil()
} else {
yy27 := *x.Kind
yy27.CodecEncodeSelf(e)
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
@@ -18176,6 +18228,17 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod
*((*bool)(x.ReadOnly)) = r.DecodeBool()
}
}
case "kind":
if r.TryDecodeAsNil() {
if x.Kind != nil {
x.Kind = nil
}
} else {
if x.Kind == nil {
x.Kind = new(AzureDataDiskKind)
}
x.Kind.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3
@@ -18187,16 +18250,16 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj13 int
var yyb13 bool
var yyhl13 bool = l >= 0
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
var yyj14 int
var yyb14 bool
var yyhl14 bool = l >= 0
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18204,21 +18267,21 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if r.TryDecodeAsNil() {
x.DiskName = ""
} else {
yyv14 := &x.DiskName
yym15 := z.DecBinary()
_ = yym15
yyv15 := &x.DiskName
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
*((*string)(yyv14)) = r.DecodeString()
*((*string)(yyv15)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18226,21 +18289,21 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if r.TryDecodeAsNil() {
x.DataDiskURI = ""
} else {
yyv16 := &x.DataDiskURI
yym17 := z.DecBinary()
_ = yym17
yyv17 := &x.DataDiskURI
yym18 := z.DecBinary()
_ = yym18
if false {
} else {
*((*string)(yyv16)) = r.DecodeString()
*((*string)(yyv17)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18255,13 +18318,13 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
}
x.CachingMode.CodecDecodeSelf(d)
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18274,20 +18337,20 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if x.FSType == nil {
x.FSType = new(string)
}
yym20 := z.DecBinary()
_ = yym20
yym21 := z.DecBinary()
_ = yym21
if false {
} else {
*((*string)(x.FSType)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18300,25 +18363,46 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if x.ReadOnly == nil {
x.ReadOnly = new(bool)
}
yym22 := z.DecBinary()
_ = yym22
yym23 := z.DecBinary()
_ = yym23
if false {
} else {
*((*bool)(x.ReadOnly)) = r.DecodeBool()
}
}
for {
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
} else {
yyb13 = r.CheckBreak()
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb14 = r.CheckBreak()
}
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
if x.Kind != nil {
x.Kind = nil
}
if yyb13 {
} else {
if x.Kind == nil {
x.Kind = new(AzureDataDiskKind)
}
x.Kind.CodecDecodeSelf(d)
}
for {
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb14 = r.CheckBreak()
}
if yyb14 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj13-1, "")
z.DecStructFieldNotFound(yyj14-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

View File

@@ -1124,11 +1124,16 @@ type PhotonPersistentDiskVolumeSource struct {
}
type AzureDataDiskCachingMode string
type AzureDataDiskKind string
const (
AzureDataDiskCachingNone AzureDataDiskCachingMode = "None"
AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly"
AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite"
AzureSharedBlobDisk AzureDataDiskKind = "Shared"
AzureDedicatedBlobDisk AzureDataDiskKind = "Dedicated"
AzureManagedDisk AzureDataDiskKind = "Managed"
)
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
@@ -1149,6 +1154,8 @@ type AzureDiskVolumeSource struct {
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"`
// Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
Kind *AzureDataDiskKind `json:"kind,omitempty" protobuf:"bytes,6,opt,name=kind,casttype=AzureDataDiskKind"`
}
// PortworxVolumeSource represents a Portworx volume resource.

View File

@@ -76,6 +76,7 @@ var map_AzureDiskVolumeSource = map[string]string{
"cachingMode": "Host Caching mode: None, Read Only, Read Write.",
"fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
"readOnly": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.",
"kind": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared",
}
func (AzureDiskVolumeSource) SwaggerDoc() map[string]string {

View File

@@ -474,6 +474,7 @@ func autoConvert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(in *Azure
out.CachingMode = (*api.AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode))
out.FSType = (*string)(unsafe.Pointer(in.FSType))
out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly))
out.Kind = (*api.AzureDataDiskKind)(unsafe.Pointer(in.Kind))
return nil
}
@@ -488,6 +489,7 @@ func autoConvert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in *api.A
out.CachingMode = (*AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode))
out.FSType = (*string)(unsafe.Pointer(in.FSType))
out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly))
out.Kind = (*AzureDataDiskKind)(unsafe.Pointer(in.Kind))
return nil
}

View File

@@ -298,6 +298,11 @@ func DeepCopy_v1_AzureDiskVolumeSource(in interface{}, out interface{}, c *conve
*out = new(bool)
**out = **in
}
if in.Kind != nil {
in, out := &in.Kind, &out.Kind
*out = new(AzureDataDiskKind)
**out = **in
}
return nil
}
}

View File

@@ -542,10 +542,16 @@ func validateVolumeSource(source *api.VolumeSource, fldPath *field.Path) field.E
allErrs = append(allErrs, validateConfigMapVolumeSource(source.ConfigMap, fldPath.Child("configMap"))...)
}
}
if source.AzureFile != nil {
numVolumes++
allErrs = append(allErrs, validateAzureFile(source.AzureFile, fldPath.Child("azureFile"))...)
if numVolumes > 0 {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("azureFile"), "may not specify more than 1 volume type"))
} else {
numVolumes++
allErrs = append(allErrs, validateAzureFile(source.AzureFile, fldPath.Child("azureFile"))...)
}
}
if source.VsphereVolume != nil {
if numVolumes > 0 {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("vsphereVolume"), "may not specify more than 1 volume type"))
@@ -571,8 +577,12 @@ func validateVolumeSource(source *api.VolumeSource, fldPath *field.Path) field.E
}
}
if source.AzureDisk != nil {
numVolumes++
allErrs = append(allErrs, validateAzureDisk(source.AzureDisk, fldPath.Child("azureDisk"))...)
if numVolumes > 0 {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("azureDisk"), "may not specify more than 1 volume type"))
} else {
numVolumes++
allErrs = append(allErrs, validateAzureDisk(source.AzureDisk, fldPath.Child("azureDisk"))...)
}
}
if source.Projected != nil {
if numVolumes > 0 {
@@ -1017,19 +1027,39 @@ func validateAzureFile(azure *api.AzureFileVolumeSource, fldPath *field.Path) fi
return allErrs
}
var supportedCachingModes = sets.NewString(string(api.AzureDataDiskCachingNone), string(api.AzureDataDiskCachingReadOnly), string(api.AzureDataDiskCachingReadWrite))
func validateAzureDisk(azure *api.AzureDiskVolumeSource, fldPath *field.Path) field.ErrorList {
var supportedCachingModes = sets.NewString(string(api.AzureDataDiskCachingNone), string(api.AzureDataDiskCachingReadOnly), string(api.AzureDataDiskCachingReadWrite))
var supportedDiskKinds = sets.NewString(string(api.AzureSharedBlobDisk), string(api.AzureDedicatedBlobDisk), string(api.AzureManagedDisk))
diskUriSupportedManaged := []string{"/subscriptions/{sub-id}/resourcegroups/{group-name}/providers/microsoft.compute/disks/{disk-id}"}
diskUriSupportedblob := []string{"https://{account-name}.blob.core.windows.net/{container-name}/{disk-name}.vhd"}
allErrs := field.ErrorList{}
if azure.DiskName == "" {
allErrs = append(allErrs, field.Required(fldPath.Child("diskName"), ""))
}
if azure.DataDiskURI == "" {
allErrs = append(allErrs, field.Required(fldPath.Child("diskURI"), ""))
}
if azure.CachingMode != nil && !supportedCachingModes.Has(string(*azure.CachingMode)) {
allErrs = append(allErrs, field.NotSupported(fldPath.Child("cachingMode"), *azure.CachingMode, supportedCachingModes.List()))
}
if azure.Kind != nil && !supportedDiskKinds.Has(string(*azure.Kind)) {
allErrs = append(allErrs, field.NotSupported(fldPath.Child("kind"), *azure.Kind, supportedDiskKinds.List()))
}
// validate that DiskUri is the correct format
if azure.Kind != nil && *azure.Kind == api.AzureManagedDisk && strings.Index(azure.DataDiskURI, "/subscriptions/") != 0 {
allErrs = append(allErrs, field.NotSupported(fldPath.Child("diskURI"), azure.DataDiskURI, diskUriSupportedManaged))
}
if azure.Kind != nil && *azure.Kind != api.AzureManagedDisk && strings.Index(azure.DataDiskURI, "https://") != 0 {
allErrs = append(allErrs, field.NotSupported(fldPath.Child("diskURI"), azure.DataDiskURI, diskUriSupportedblob))
}
return allErrs
}
@@ -1211,9 +1241,15 @@ func ValidatePersistentVolume(pv *api.PersistentVolume) field.ErrorList {
allErrs = append(allErrs, validateFlexVolumeSource(pv.Spec.FlexVolume, specPath.Child("flexVolume"))...)
}
if pv.Spec.AzureFile != nil {
numVolumes++
allErrs = append(allErrs, validateAzureFile(pv.Spec.AzureFile, specPath.Child("azureFile"))...)
if numVolumes > 0 {
allErrs = append(allErrs, field.Forbidden(specPath.Child("azureFile"), "may not specify more than 1 volume type"))
} else {
numVolumes++
allErrs = append(allErrs, validateAzureFile(pv.Spec.AzureFile, specPath.Child("azureFile"))...)
}
}
if pv.Spec.VsphereVolume != nil {
if numVolumes > 0 {
allErrs = append(allErrs, field.Forbidden(specPath.Child("vsphereVolume"), "may not specify more than 1 volume type"))
@@ -1239,8 +1275,12 @@ func ValidatePersistentVolume(pv *api.PersistentVolume) field.ErrorList {
}
}
if pv.Spec.AzureDisk != nil {
numVolumes++
allErrs = append(allErrs, validateAzureDisk(pv.Spec.AzureDisk, specPath.Child("azureDisk"))...)
if numVolumes > 0 {
allErrs = append(allErrs, field.Forbidden(specPath.Child("azureDisk"), "may not specify more than 1 volume type"))
} else {
numVolumes++
allErrs = append(allErrs, validateAzureDisk(pv.Spec.AzureDisk, specPath.Child("azureDisk"))...)
}
}
if pv.Spec.ScaleIO != nil {
if numVolumes > 0 {

View File

@@ -300,6 +300,11 @@ func DeepCopy_api_AzureDiskVolumeSource(in interface{}, out interface{}, c *conv
*out = new(bool)
**out = **in
}
if in.Kind != nil {
in, out := &in.Kind, &out.Kind
*out = new(AzureDataDiskKind)
**out = **in
}
return nil
}
}

View File

@@ -870,10 +870,11 @@ func printAzureDiskVolumeSource(d *api.AzureDiskVolumeSource, w PrefixWriter) {
w.Write(LEVEL_2, "Type:\tAzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)\n"+
" DiskName:\t%v\n"+
" DiskURI:\t%v\n"+
" Kind: \t%v\n"+
" FSType:\t%v\n"+
" CachingMode:\t%v\n"+
" ReadOnly:\t%v\n",
d.DiskName, d.DataDiskURI, *d.FSType, *d.CachingMode, *d.ReadOnly)
d.DiskName, d.DataDiskURI, *d.Kind, *d.FSType, *d.CachingMode, *d.ReadOnly)
}
func printVsphereVolumeSource(vsphere *api.VsphereVirtualDiskVolumeSource, w PrefixWriter) {

View File

@@ -1059,11 +1059,16 @@ type PortworxVolumeSource struct {
}
type AzureDataDiskCachingMode string
type AzureDataDiskKind string
const (
AzureDataDiskCachingNone AzureDataDiskCachingMode = "None"
AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly"
AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite"
AzureSharedBlobDisk AzureDataDiskKind = "Shared"
AzureDedicatedBlobDisk AzureDataDiskKind = "Dedicated"
AzureManagedDisk AzureDataDiskKind = "Managed"
)
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
@@ -1084,6 +1089,8 @@ type AzureDiskVolumeSource struct {
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly *bool
// Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
Kind *AzureDataDiskKind
}
// ScaleIOVolumeSource represents a persistent ScaleIO volume

View File

@@ -239,7 +239,11 @@ func SetDefaults_ISCSIVolumeSource(obj *ISCSIVolumeSource) {
func SetDefaults_AzureDiskVolumeSource(obj *AzureDiskVolumeSource) {
if obj.CachingMode == nil {
obj.CachingMode = new(AzureDataDiskCachingMode)
*obj.CachingMode = AzureDataDiskCachingNone
*obj.CachingMode = AzureDataDiskCachingReadWrite
}
if obj.Kind == nil {
obj.Kind = new(AzureDataDiskKind)
*obj.Kind = AzureSharedBlobDisk
}
if obj.FSType == nil {
obj.FSType = new(string)

File diff suppressed because it is too large Load Diff

View File

@@ -120,6 +120,9 @@ message AzureDiskVolumeSource {
// the ReadOnly setting in VolumeMounts.
// +optional
optional bool readOnly = 5;
// Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
optional string kind = 6;
}
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

View File

@@ -17882,6 +17882,32 @@ func (x *AzureDataDiskCachingMode) CodecDecodeSelf(d *codec1978.Decoder) {
}
}
func (x AzureDataDiskKind) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
yym1 := z.EncBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.EncExt(x) {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x))
}
}
func (x *AzureDataDiskKind) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
yym1 := z.DecBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.DecExt(x) {
} else {
*((*string)(x)) = r.DecodeString()
}
}
func (x *AzureDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
@@ -17896,15 +17922,16 @@ func (x *AzureDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [5]bool
var yyq2 [6]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[2] = x.CachingMode != nil
yyq2[3] = x.FSType != nil
yyq2[4] = x.ReadOnly != nil
yyq2[5] = x.Kind != nil
var yynn2 int
if yyr2 || yy2arr2 {
r.EncodeArrayStart(5)
r.EncodeArrayStart(6)
} else {
yynn2 = 2
for _, b := range yyq2 {
@@ -18048,6 +18075,31 @@ func (x *AzureDiskVolumeSource) CodecEncodeSelf(e *codec1978.Encoder) {
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[5] {
if x.Kind == nil {
r.EncodeNil()
} else {
yy25 := *x.Kind
yy25.CodecEncodeSelf(e)
}
} else {
r.EncodeNil()
}
} else {
if yyq2[5] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("kind"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.Kind == nil {
r.EncodeNil()
} else {
yy27 := *x.Kind
yy27.CodecEncodeSelf(e)
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
@@ -18176,6 +18228,17 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromMap(l int, d *codec1978.Decod
*((*bool)(x.ReadOnly)) = r.DecodeBool()
}
}
case "kind":
if r.TryDecodeAsNil() {
if x.Kind != nil {
x.Kind = nil
}
} else {
if x.Kind == nil {
x.Kind = new(AzureDataDiskKind)
}
x.Kind.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3
@@ -18187,16 +18250,16 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj13 int
var yyb13 bool
var yyhl13 bool = l >= 0
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
var yyj14 int
var yyb14 bool
var yyhl14 bool = l >= 0
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18204,21 +18267,21 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if r.TryDecodeAsNil() {
x.DiskName = ""
} else {
yyv14 := &x.DiskName
yym15 := z.DecBinary()
_ = yym15
yyv15 := &x.DiskName
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
*((*string)(yyv14)) = r.DecodeString()
*((*string)(yyv15)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18226,21 +18289,21 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if r.TryDecodeAsNil() {
x.DataDiskURI = ""
} else {
yyv16 := &x.DataDiskURI
yym17 := z.DecBinary()
_ = yym17
yyv17 := &x.DataDiskURI
yym18 := z.DecBinary()
_ = yym18
if false {
} else {
*((*string)(yyv16)) = r.DecodeString()
*((*string)(yyv17)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18255,13 +18318,13 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
}
x.CachingMode.CodecDecodeSelf(d)
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18274,20 +18337,20 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if x.FSType == nil {
x.FSType = new(string)
}
yym20 := z.DecBinary()
_ = yym20
yym21 := z.DecBinary()
_ = yym21
if false {
} else {
*((*string)(x.FSType)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@@ -18300,25 +18363,46 @@ func (x *AzureDiskVolumeSource) codecDecodeSelfFromArray(l int, d *codec1978.Dec
if x.ReadOnly == nil {
x.ReadOnly = new(bool)
}
yym22 := z.DecBinary()
_ = yym22
yym23 := z.DecBinary()
_ = yym23
if false {
} else {
*((*bool)(x.ReadOnly)) = r.DecodeBool()
}
}
for {
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
} else {
yyb13 = r.CheckBreak()
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb14 = r.CheckBreak()
}
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
if x.Kind != nil {
x.Kind = nil
}
if yyb13 {
} else {
if x.Kind == nil {
x.Kind = new(AzureDataDiskKind)
}
x.Kind.CodecDecodeSelf(d)
}
for {
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb14 = r.CheckBreak()
}
if yyb14 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj13-1, "")
z.DecStructFieldNotFound(yyj14-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

View File

@@ -1124,11 +1124,16 @@ type PhotonPersistentDiskVolumeSource struct {
}
type AzureDataDiskCachingMode string
type AzureDataDiskKind string
const (
AzureDataDiskCachingNone AzureDataDiskCachingMode = "None"
AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly"
AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite"
AzureSharedBlobDisk AzureDataDiskKind = "Shared"
AzureDedicatedBlobDisk AzureDataDiskKind = "Dedicated"
AzureManagedDisk AzureDataDiskKind = "Managed"
)
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
@@ -1149,6 +1154,8 @@ type AzureDiskVolumeSource struct {
// the ReadOnly setting in VolumeMounts.
// +optional
ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"`
// Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
Kind *AzureDataDiskKind `json:"kind,omitempty" protobuf:"bytes,6,opt,name=kind,casttype=AzureDataDiskKind"`
}
// PortworxVolumeSource represents a Portworx volume resource.

View File

@@ -76,6 +76,7 @@ var map_AzureDiskVolumeSource = map[string]string{
"cachingMode": "Host Caching mode: None, Read Only, Read Write.",
"fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.",
"readOnly": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.",
"kind": "Expected values Shared: mulitple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared",
}
func (AzureDiskVolumeSource) SwaggerDoc() map[string]string {

View File

@@ -474,6 +474,7 @@ func autoConvert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(in *Azure
out.CachingMode = (*api.AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode))
out.FSType = (*string)(unsafe.Pointer(in.FSType))
out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly))
out.Kind = (*api.AzureDataDiskKind)(unsafe.Pointer(in.Kind))
return nil
}
@@ -488,6 +489,7 @@ func autoConvert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in *api.A
out.CachingMode = (*AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode))
out.FSType = (*string)(unsafe.Pointer(in.FSType))
out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly))
out.Kind = (*AzureDataDiskKind)(unsafe.Pointer(in.Kind))
return nil
}

View File

@@ -298,6 +298,11 @@ func DeepCopy_v1_AzureDiskVolumeSource(in interface{}, out interface{}, c *conve
*out = new(bool)
**out = **in
}
if in.Kind != nil {
in, out := &in.Kind, &out.Kind
*out = new(AzureDataDiskKind)
**out = **in
}
return nil
}
}

View File

@@ -300,6 +300,11 @@ func DeepCopy_api_AzureDiskVolumeSource(in interface{}, out interface{}, c *conv
*out = new(bool)
**out = **in
}
if in.Kind != nil {
in, out := &in.Kind, &out.Kind
*out = new(AzureDataDiskKind)
**out = **in
}
return nil
}
}