當前位置: 首頁>>代碼示例>>Golang>>正文


Golang volume.CalculateTimeoutForVolume函數代碼示例

本文整理匯總了Golang中k8s/io/kubernetes/pkg/volume.CalculateTimeoutForVolume函數的典型用法代碼示例。如果您正苦於以下問題:Golang CalculateTimeoutForVolume函數的具體用法?Golang CalculateTimeoutForVolume怎麽用?Golang CalculateTimeoutForVolume使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CalculateTimeoutForVolume函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: newRecycler

func newRecycler(spec *volume.Spec, host volume.VolumeHost, config volume.VolumeConfig) (volume.Recycler, error) {
	if spec.PersistentVolume == nil || spec.PersistentVolume.Spec.HostPath == nil {
		return nil, fmt.Errorf("spec.PersistentVolumeSource.HostPath is nil")
	}
	return &hostPathRecycler{
		name:    spec.Name(),
		path:    spec.PersistentVolume.Spec.HostPath.Path,
		host:    host,
		config:  config,
		timeout: volume.CalculateTimeoutForVolume(config.RecyclerMinimumTimeout, config.RecyclerTimeoutIncrement, spec.PersistentVolume),
	}, nil
}
開發者ID:rohansingh,項目名稱:kubernetes-model,代碼行數:12,代碼來源:host_path.go

示例2: newRecycler

func newRecycler(spec *volume.Spec, host volume.VolumeHost, volumeConfig *volume.VolumeConfig) (volume.Recycler, error) {
	if spec.PersistentVolume == nil || spec.PersistentVolume.Spec.NFS == nil {
		return nil, fmt.Errorf("spec.PersistentVolumeSource.NFS is nil")
	}
	return &nfsRecycler{
		name:         spec.Name,
		server:       spec.PersistentVolume.Spec.NFS.Server,
		path:         spec.PersistentVolume.Spec.NFS.Path,
		host:         host,
		volumeConfig: volumeConfig,
		timeout:      volume.CalculateTimeoutForVolume(volumeConfig.PersistentVolumeRecyclerMinTimeoutNfs, volumeConfig.PersistentVolumeRecyclerTimeoutIncrementNfs, spec.PersistentVolume),
	}, nil
}
開發者ID:MarWestermann,項目名稱:gofabric8,代碼行數:13,代碼來源:nfs.go

示例3: newRecycler

func newRecycler(pvName string, spec *volume.Spec, eventRecorder volume.RecycleEventRecorder, host volume.VolumeHost, volumeConfig volume.VolumeConfig) (volume.Recycler, error) {
	if spec.PersistentVolume == nil || spec.PersistentVolume.Spec.NFS == nil {
		return nil, fmt.Errorf("spec.PersistentVolumeSource.NFS is nil")
	}
	return &nfsRecycler{
		name:          spec.Name(),
		server:        spec.PersistentVolume.Spec.NFS.Server,
		path:          spec.PersistentVolume.Spec.NFS.Path,
		host:          host,
		config:        volumeConfig,
		timeout:       volume.CalculateTimeoutForVolume(volumeConfig.RecyclerMinimumTimeout, volumeConfig.RecyclerTimeoutIncrement, spec.PersistentVolume),
		pvName:        pvName,
		eventRecorder: eventRecorder,
	}, nil
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:15,代碼來源:nfs.go


注:本文中的k8s/io/kubernetes/pkg/volume.CalculateTimeoutForVolume函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。