func (pvc *PersistentVolumeConfiguration) Create(options Options) (*component.Summary, error) {
	if pvc.persistentVolume == nil {
		return nil, errors.New("Persistent Volume is nil")
	}
	pv := pvc.persistentVolume

	accessModes := getAccessModesAsString(pv.Spec.AccessModes)
	storage := pv.Spec.Capacity[v1.ResourceStorage]
	capacity := storage.String()

	var sections component.SummarySections
	sections.AddText("Reclaim Policy", string(pv.Spec.PersistentVolumeReclaimPolicy))
	sections.AddText("Storage Class", pv.Spec.StorageClassName)
	sections.AddText("Access Modes", accessModes)
	sections.AddText("Capacity", capacity)
	sections.AddText("Host Path", pv.Spec.HostPath.Path)

	summary := component.NewSummary("Configuration", sections...)
	return summary, nil
}
// Create the Configuration Summary component for a Persistent Volume
Create the Configuration Summary component for a Persistent Volume
// Create the Configuration Summary component for a Persistent Volume
func (pvc *PersistentVolumeConfiguration) Create(options Options) (*component.Summary, error) {
	if pvc.persistentVolume == nil {
		return nil, errors.New("Persistent Volume is nil")
	}
	pv := pvc.persistentVolume
	accessModes := getAccessModesAsString(pv.Spec.AccessModes)
	storage := pv.Spec.Capacity[v1.ResourceStorage]
	capacity := storage.String()
	var sections component.SummarySections
	sections.AddText("Reclaim Policy", string(pv.Spec.PersistentVolumeReclaimPolicy))
	sections.AddText("Storage Class", pv.Spec.StorageClassName)
	sections.AddText("Access Modes", accessModes)
	sections.AddText("Capacity", capacity)
	sections.AddText("Host Path", pv.Spec.HostPath.Path)
	summary := component.NewSummary("Configuration", sections...)
	return summary, nil
}
func ( pvc * PersistentVolumeConfiguration ) Create ( options Options ) ( * component . Summary , error ) { if pvc . persistentVolume == nil { return nil , errors . New ( " " ) } pv := pvc . persistentVolume accessModes := getAccessModesAsString ( pv . Spec . AccessModes ) storage := pv . Spec . Capacity [ v1 . ResourceStorage ] capacity := storage . String ( ) var sections component . SummarySections sections . AddText ( " " , string ( pv . Spec . PersistentVolumeReclaimPolicy ) ) sections . AddText ( " " , pv . Spec . StorageClassName ) sections . AddText ( " " , accessModes ) sections . AddText ( " " , capacity ) sections . AddText ( " " , pv . Spec . HostPath . Path ) summary := component . NewSummary ( " " , sections ... ) return summary , nil }
Create the Configuration Summary component for a Persistent Volume
Create the Configuration Summary component for a Persistent Volume