Skip to content

Commit

Permalink
feat: add DataSourceTypeExportFromVolumeParameterFileSyncHTTPClientTi…
Browse files Browse the repository at this point in the history
…meout

Signed-off-by: PoAn Yang <poan.yang@suse.com>
  • Loading branch information
FrankYang0529 committed Dec 1, 2023
1 parent 89d3c11 commit 2ec9f7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions controller/backing_image_data_source_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,12 @@ func (c *BackingImageDataSourceController) prepareRunningParameters(bids *longho
return fmt.Errorf("failed to get an available replica from volume %v during backing image %v exporting", v.Name, bids.Name)
}

fileSyncHTTPClientTimeout, err := c.ds.GetSettingAsInt(types.SettingNameReplicaFileSyncHTTPClientTimeout)
if err != nil {
return err
}
bids.Status.RunningParameters[longhorn.DataSourceTypeExportFromVolumeParameterFileSyncHTTPClientTimeout] = strconv.FormatInt(fileSyncHTTPClientTimeout, 10)

return nil
}

Expand Down
9 changes: 5 additions & 4 deletions k8s/pkg/apis/longhorn/v1beta2/backingimagedatasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ const (
BackingImageDataSourceTypeUpload = BackingImageDataSourceType("upload")
BackingImageDataSourceTypeExportFromVolume = BackingImageDataSourceType("export-from-volume")

DataSourceTypeExportFromVolumeParameterVolumeName = "volume-name"
DataSourceTypeExportFromVolumeParameterVolumeSize = "volume-size"
DataSourceTypeExportFromVolumeParameterSnapshotName = "snapshot-name"
DataSourceTypeExportFromVolumeParameterSenderAddress = "sender-address"
DataSourceTypeExportFromVolumeParameterVolumeName = "volume-name"
DataSourceTypeExportFromVolumeParameterVolumeSize = "volume-size"
DataSourceTypeExportFromVolumeParameterSnapshotName = "snapshot-name"
DataSourceTypeExportFromVolumeParameterSenderAddress = "sender-address"
DataSourceTypeExportFromVolumeParameterFileSyncHTTPClientTimeout = "file-sync-http-client-timeout"
)

// BackingImageDataSourceSpec defines the desired state of the Longhorn backing image data source
Expand Down

0 comments on commit 2ec9f7e

Please sign in to comment.