Skip to content

Commit

Permalink
Merge pull request #2454 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2453-to-release-1.28

[release-1.28] fix: create snapshot failure in edge zone
  • Loading branch information
andyzhangx authored Aug 5, 2024
2 parents 1677a29 + cb8d7e4 commit 462d4ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/azuredisk/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
cloudprovider "k8s.io/cloud-provider"
volerr "k8s.io/cloud-provider/volume/errors"
"k8s.io/klog/v2"
"k8s.io/utils/pointer"

consts "sigs.k8s.io/azuredisk-csi-driver/pkg/azureconstants"
"sigs.k8s.io/azuredisk-csi-driver/pkg/azureutils"
Expand Down Expand Up @@ -912,6 +913,14 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ
Tags: tags,
}

if d.cloud.HasExtendedLocation() {
klog.V(2).Infof("extended location Name:%s Type:%s is set on snapshot %s, source volume %s", d.cloud.ExtendedLocationName, d.cloud.ExtendedLocationType, snapshotName, sourceVolumeID)
snapshot.ExtendedLocation = &compute.ExtendedLocation{
Name: pointer.String(d.cloud.ExtendedLocationName),
Type: compute.ExtendedLocationTypes(d.cloud.ExtendedLocationType),
}
}

if dataAccessAuthMode != "" {
if err := azureutils.ValidateDataAccessAuthMode(dataAccessAuthMode); err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
Expand Down

0 comments on commit 462d4ae

Please sign in to comment.