mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Fix typecheck errors
This commit is contained in:
parent
b51cbb1d17
commit
fbce6bd610
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package volume
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@ -24,6 +25,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/tools/record"
|
||||
volumetypes "k8s.io/kubernetes/pkg/volume/util/types"
|
||||
)
|
||||
|
||||
// Volume represents a directory used by pods or hosts on a node. All method
|
||||
@ -134,6 +136,19 @@ type MounterArgs struct {
|
||||
Recorder record.EventRecorder
|
||||
}
|
||||
|
||||
type VolumeOwnership struct {
|
||||
mounter Mounter
|
||||
dir string
|
||||
fsGroup *int64
|
||||
fsGroupChangePolicy *v1.PodFSGroupChangePolicy
|
||||
completionCallback func(volumetypes.CompleteFuncParam)
|
||||
|
||||
// for monitoring progress of permission change operation
|
||||
pod *v1.Pod
|
||||
fileCounter atomic.Int64
|
||||
recorder record.EventRecorder
|
||||
}
|
||||
|
||||
// Mounter interface provides methods to set up/mount the volume.
|
||||
type Mounter interface {
|
||||
// Uses Interface to provide the path for Docker binds.
|
||||
|
@ -23,7 +23,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
|
||||
"os"
|
||||
@ -44,19 +43,7 @@ const (
|
||||
progressReportDuration = 60 * time.Second
|
||||
)
|
||||
|
||||
type VolumeOwnership struct {
|
||||
mounter Mounter
|
||||
dir string
|
||||
fsGroup *int64
|
||||
fsGroupChangePolicy *v1.PodFSGroupChangePolicy
|
||||
completionCallback func(types.CompleteFuncParam)
|
||||
|
||||
// for monitoring progress of permission change operation
|
||||
pod *v1.Pod
|
||||
fileCounter atomic.Int64
|
||||
recorder record.EventRecorder
|
||||
}
|
||||
|
||||
// NewVolumeOwnership returns an interface that can be used to recursively change volume permissions and ownership
|
||||
func NewVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) *VolumeOwnership {
|
||||
vo := &VolumeOwnership{
|
||||
mounter: mounter,
|
||||
|
@ -21,11 +21,19 @@ package volume
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/client-go/tools/record"
|
||||
"k8s.io/kubernetes/pkg/volume/util/types"
|
||||
)
|
||||
|
||||
// SetVolumeOwnership sets the ownership of a volume to the specified user and group.
|
||||
// It typically modifies the user and group ownership of the volume's file system.
|
||||
func SetVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) error {
|
||||
// NewVolumeOwnership returns an interface that can be used to recursively change volume permissions and ownership
|
||||
func NewVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) *VolumeOwnership {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (vo *VolumeOwnership) AddProgressNotifier(pod *v1.Pod, recorder record.EventRecorder) *VolumeOwnership {
|
||||
return vo
|
||||
}
|
||||
|
||||
func (vo *VolumeOwnership) ChangePermissions() error {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user