Class: CDK8sPlus25::K8S::VolumeAttachmentSource
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- CDK8sPlus25::K8S::VolumeAttachmentSource
- Defined in:
- k8_s/volume_attachment_source.rb
Overview
VolumeAttachmentSource represents a volume that should be attached.
Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.
Instance Attribute Summary collapse
-
#inline_volume_spec ⇒ CDK8sPlus25::K8S::PersistentVolumeSpec?
readonly
inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod's inline VolumeSource.
-
#persistent_volume_name ⇒ String?
readonly
Name of the persistent volume to attach.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(inline_volume_spec: nil, persistent_volume_name: nil) ⇒ VolumeAttachmentSource
constructor
A new instance of VolumeAttachmentSource.
- #to_jsii ⇒ Object
Constructor Details
#initialize(inline_volume_spec: nil, persistent_volume_name: nil) ⇒ VolumeAttachmentSource
Returns a new instance of VolumeAttachmentSource.
11 12 13 14 15 16 |
# File 'k8_s/volume_attachment_source.rb', line 11 def initialize(inline_volume_spec: nil, persistent_volume_name: nil) @inline_volume_spec = inline_volume_spec.is_a?(Hash) ? ::CDK8sPlus25::K8S::PersistentVolumeSpec.new(**inline_volume_spec.transform_keys(&:to_sym)) : inline_volume_spec Jsii::Type.check_type(@inline_volume_spec, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5QZXJzaXN0ZW50Vm9sdW1lU3BlYyJ9", "inlineVolumeSpec") unless @inline_volume_spec.nil? @persistent_volume_name = persistent_volume_name Jsii::Type.check_type(@persistent_volume_name, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "persistentVolumeName") unless @persistent_volume_name.nil? end |
Instance Attribute Details
#inline_volume_spec ⇒ CDK8sPlus25::K8S::PersistentVolumeSpec? (readonly)
inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod's inline VolumeSource.
This field is populated only for the CSIMigration feature. It contains translated fields from a pod's inline VolumeSource to a PersistentVolumeSpec. This field is beta-level and is only honored by servers that enabled the CSIMigration feature.
23 24 25 |
# File 'k8_s/volume_attachment_source.rb', line 23 def inline_volume_spec @inline_volume_spec end |
#persistent_volume_name ⇒ String? (readonly)
Name of the persistent volume to attach.
27 28 29 |
# File 'k8_s/volume_attachment_source.rb', line 27 def persistent_volume_name @persistent_volume_name end |
Class Method Details
.jsii_properties ⇒ Object
29 30 31 32 33 34 |
# File 'k8_s/volume_attachment_source.rb', line 29 def self.jsii_properties { :inline_volume_spec => "inlineVolumeSpec", :persistent_volume_name => "persistentVolumeName", } end |
Instance Method Details
#to_jsii ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'k8_s/volume_attachment_source.rb', line 36 def to_jsii result = {} result.merge!({ "inlineVolumeSpec" => @inline_volume_spec, "persistentVolumeName" => @persistent_volume_name, }) result.compact end |