Skip to content

Support CSI Snapshot for legacy PVCs and PVs #1315

@0xLeo258

Description

@0xLeo258

Is your feature request related to a problem?/Why is this needed

The remaining PVCs and PVs that are still configured with the legacy in-tree StorageClass, where the provisioner is set to kubernetes.io/aws-ebs rather than the newer ebs.csi.aws.com.

While these persistent volumes should have been automatically migrated to the CSI driver using the annotation-based migration feature, CSI snapshot doesn't work on them.

Describe the solution you'd like in detail

Add an edge case(draft below) to enable creating VolumeSnapshotContent for CSI annotated PV

isPVMigratedToCSI := func(pv *corev1api.PersistentVolume) bool {
	if pv == nil || pv.Annotations == nil {
		return false
	}
	migratedTo, ok := pv.Annotations["pv.kubernetes.io/migrated-to"]
	return ok && strings.Contains(strings.ToLower(migratedTo), "csi")
}

Describe alternatives you've considered

N/A
Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions