本文整理汇总了Golang中k8s/io/kubernetes/pkg/api.VolumeMount类的典型用法代码示例。如果您正苦于以下问题:Golang VolumeMount类的具体用法?Golang VolumeMount怎么用?Golang VolumeMount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VolumeMount类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeVolumeMount
func writeVolumeMount(m map[string]interface{}, item *api.VolumeMount) {
if x, ok := m["name"].(string); ok {
item.Name = x
}
if x, ok := m["read_only"].(bool); ok {
item.ReadOnly = x
}
if x, ok := m["mount_path"].(string); ok {
item.MountPath = x
}
}
示例2: VolumeMounts
func VolumeMounts(userVolumeMounts []interface{}) []api.VolumeMount {
if len(userVolumeMounts) == 0 {
return nil
}
var volumeMounts []api.VolumeMount
for _, v := range userVolumeMounts {
userVolumeMount := v.(map[string]interface{})
volumeMount := api.VolumeMount{
Name: userVolumeMount["name"].(string),
MountPath: userVolumeMount["mount_path"].(string),
}
if _, ok := userVolumeMount["read_only"]; ok {
volumeMount.ReadOnly = userVolumeMount["read_only"].(bool)
}
volumeMounts = append(volumeMounts, volumeMount)
}
return volumeMounts
}
示例3: deepCopy_api_VolumeMount
func deepCopy_api_VolumeMount(in api.VolumeMount, out *api.VolumeMount, c *conversion.Cloner) error {
out.Name = in.Name
out.ReadOnly = in.ReadOnly
out.MountPath = in.MountPath
return nil
}