Skip to content

Commit

Permalink
fix: ignore snapshot keys in snapshot storage class
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Sep 20, 2024
1 parent 8bf4dba commit 0044ec7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/azureconstants/azure_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ const (
PvcNamespaceTag = "kubernetes.io-created-for-pvc-namespace"
PvcNameTag = "kubernetes.io-created-for-pvc-name"
PvNameKey = "csi.storage.k8s.io/pv/name"
VolumeSnapshotNameKey = "csi.storage.k8s.io/volumesnapshot/name"
VolumeSnapshotNamespaceKey = "csi.storage.k8s.io/volumesnapshot/namespace"
VolumeSnapshotContentNameKey = "csi.storage.k8s.io/volumesnapshotcontent/name"
PvNameTag = "kubernetes.io-created-for-pv-name"
RateLimited = "rate limited"
RequestedSizeGib = "requestedsizegib"
Expand Down
6 changes: 6 additions & 0 deletions pkg/azuredisk/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,12 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ
dataAccessAuthMode = v
case consts.TagValueDelimiterField:
tagValueDelimiter = v
case consts.VolumeSnapshotNameKey:
// ignore the key
case consts.VolumeSnapshotNamespaceKey:
// ignore the key
case consts.VolumeSnapshotContentNameKey:
// ignore the key
default:
return nil, status.Errorf(codes.Internal, "AzureDisk - invalid option %s in VolumeSnapshotClass", k)
}
Expand Down

0 comments on commit 0044ec7

Please sign in to comment.