mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: bump k8s.io/kubernetes from 1.23.1 to 1.23.2
Bumps [k8s.io/kubernetes](https://github.com/kubernetes/kubernetes) from 1.23.1 to 1.23.2. - [Release notes](https://github.com/kubernetes/kubernetes/releases) - [Commits](https://github.com/kubernetes/kubernetes/compare/v1.23.1...v1.23.2) --- updated-dependencies: - dependency-name: k8s.io/kubernetes dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
3a445cfc36
commit
901a1368ab
2
vendor/k8s.io/api/autoscaling/v2beta1/types.go
generated
vendored
2
vendor/k8s.io/api/autoscaling/v2beta1/types.go
generated
vendored
@ -449,7 +449,7 @@ type ExternalMetricStatus struct {
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.8
|
||||
// +k8s:prerelease-lifecycle-gen:deprecated=1.22
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=autoscaling,v2beta2,HorizontalPodAutoscaler
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=autoscaling,v2,HorizontalPodAutoscaler
|
||||
|
||||
// HorizontalPodAutoscaler is the configuration for a horizontal pod
|
||||
// autoscaler, which automatically manages the replica count of any resource
|
||||
|
2
vendor/k8s.io/api/autoscaling/v2beta1/zz_generated.prerelease-lifecycle.go
generated
vendored
2
vendor/k8s.io/api/autoscaling/v2beta1/zz_generated.prerelease-lifecycle.go
generated
vendored
@ -40,7 +40,7 @@ func (in *HorizontalPodAutoscaler) APILifecycleDeprecated() (major, minor int) {
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *HorizontalPodAutoscaler) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "autoscaling", Version: "v2beta2", Kind: "HorizontalPodAutoscaler"}
|
||||
return schema.GroupVersionKind{Group: "autoscaling", Version: "v2", Kind: "HorizontalPodAutoscaler"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
|
1
vendor/k8s.io/api/autoscaling/v2beta2/types.go
generated
vendored
1
vendor/k8s.io/api/autoscaling/v2beta2/types.go
generated
vendored
@ -28,6 +28,7 @@ import (
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.12
|
||||
// +k8s:prerelease-lifecycle-gen:deprecated=1.23
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=autoscaling,v2,HorizontalPodAutoscaler
|
||||
|
||||
// HorizontalPodAutoscaler is the configuration for a horizontal pod
|
||||
// autoscaler, which automatically manages the replica count of any resource
|
||||
|
10
vendor/k8s.io/api/autoscaling/v2beta2/zz_generated.prerelease-lifecycle.go
generated
vendored
10
vendor/k8s.io/api/autoscaling/v2beta2/zz_generated.prerelease-lifecycle.go
generated
vendored
@ -21,6 +21,10 @@ limitations under the License.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
|
||||
func (in *HorizontalPodAutoscaler) APILifecycleIntroduced() (major, minor int) {
|
||||
@ -33,6 +37,12 @@ func (in *HorizontalPodAutoscaler) APILifecycleDeprecated() (major, minor int) {
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *HorizontalPodAutoscaler) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "autoscaling", Version: "v2", Kind: "HorizontalPodAutoscaler"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *HorizontalPodAutoscaler) APILifecycleRemoved() (major, minor int) {
|
||||
|
8
vendor/k8s.io/api/flowcontrol/v1alpha1/types.go
generated
vendored
8
vendor/k8s.io/api/flowcontrol/v1alpha1/types.go
generated
vendored
@ -63,7 +63,7 @@ const (
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.18
|
||||
// +k8s:prerelease-lifecycle-gen:deprecated=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:removed=1.21
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta1,FlowSchema
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,FlowSchema
|
||||
|
||||
// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with
|
||||
// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher".
|
||||
@ -87,7 +87,7 @@ type FlowSchema struct {
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.18
|
||||
// +k8s:prerelease-lifecycle-gen:deprecated=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:removed=1.21
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta1,FlowSchemaList
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,FlowSchemaList
|
||||
|
||||
// FlowSchemaList is a list of FlowSchema objects.
|
||||
type FlowSchemaList struct {
|
||||
@ -344,7 +344,7 @@ type FlowSchemaConditionType string
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.18
|
||||
// +k8s:prerelease-lifecycle-gen:deprecated=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:removed=1.21
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta1,PriorityLevelConfiguration
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,PriorityLevelConfiguration
|
||||
|
||||
// PriorityLevelConfiguration represents the configuration of a priority level.
|
||||
type PriorityLevelConfiguration struct {
|
||||
@ -367,7 +367,7 @@ type PriorityLevelConfiguration struct {
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.18
|
||||
// +k8s:prerelease-lifecycle-gen:deprecated=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:removed=1.21
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta1,PriorityLevelConfigurationList
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,PriorityLevelConfigurationList
|
||||
|
||||
// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
|
||||
type PriorityLevelConfigurationList struct {
|
||||
|
8
vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.prerelease-lifecycle.go
generated
vendored
8
vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.prerelease-lifecycle.go
generated
vendored
@ -40,7 +40,7 @@ func (in *FlowSchema) APILifecycleDeprecated() (major, minor int) {
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *FlowSchema) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Kind: "FlowSchema"}
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "FlowSchema"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
@ -64,7 +64,7 @@ func (in *FlowSchemaList) APILifecycleDeprecated() (major, minor int) {
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *FlowSchemaList) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Kind: "FlowSchemaList"}
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "FlowSchemaList"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
@ -88,7 +88,7 @@ func (in *PriorityLevelConfiguration) APILifecycleDeprecated() (major, minor int
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *PriorityLevelConfiguration) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Kind: "PriorityLevelConfiguration"}
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "PriorityLevelConfiguration"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
@ -112,7 +112,7 @@ func (in *PriorityLevelConfigurationList) APILifecycleDeprecated() (major, minor
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *PriorityLevelConfigurationList) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Kind: "PriorityLevelConfigurationList"}
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "PriorityLevelConfigurationList"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
|
4
vendor/k8s.io/api/flowcontrol/v1beta1/types.go
generated
vendored
4
vendor/k8s.io/api/flowcontrol/v1beta1/types.go
generated
vendored
@ -105,6 +105,7 @@ const (
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,FlowSchema
|
||||
|
||||
// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with
|
||||
// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher".
|
||||
@ -126,6 +127,7 @@ type FlowSchema struct {
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,FlowSchemaList
|
||||
|
||||
// FlowSchemaList is a list of FlowSchema objects.
|
||||
type FlowSchemaList struct {
|
||||
@ -380,6 +382,7 @@ type FlowSchemaConditionType string
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,PriorityLevelConfiguration
|
||||
|
||||
// PriorityLevelConfiguration represents the configuration of a priority level.
|
||||
type PriorityLevelConfiguration struct {
|
||||
@ -400,6 +403,7 @@ type PriorityLevelConfiguration struct {
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.20
|
||||
// +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta2,PriorityLevelConfigurationList
|
||||
|
||||
// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
|
||||
type PriorityLevelConfigurationList struct {
|
||||
|
28
vendor/k8s.io/api/flowcontrol/v1beta1/zz_generated.prerelease-lifecycle.go
generated
vendored
28
vendor/k8s.io/api/flowcontrol/v1beta1/zz_generated.prerelease-lifecycle.go
generated
vendored
@ -21,6 +21,10 @@ limitations under the License.
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.
|
||||
func (in *FlowSchema) APILifecycleIntroduced() (major, minor int) {
|
||||
@ -33,6 +37,12 @@ func (in *FlowSchema) APILifecycleDeprecated() (major, minor int) {
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *FlowSchema) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "FlowSchema"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *FlowSchema) APILifecycleRemoved() (major, minor int) {
|
||||
@ -51,6 +61,12 @@ func (in *FlowSchemaList) APILifecycleDeprecated() (major, minor int) {
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *FlowSchemaList) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "FlowSchemaList"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *FlowSchemaList) APILifecycleRemoved() (major, minor int) {
|
||||
@ -69,6 +85,12 @@ func (in *PriorityLevelConfiguration) APILifecycleDeprecated() (major, minor int
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *PriorityLevelConfiguration) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "PriorityLevelConfiguration"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *PriorityLevelConfiguration) APILifecycleRemoved() (major, minor int) {
|
||||
@ -87,6 +109,12 @@ func (in *PriorityLevelConfigurationList) APILifecycleDeprecated() (major, minor
|
||||
return 1, 23
|
||||
}
|
||||
|
||||
// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=<group>,<version>,<kind>" tags in types.go.
|
||||
func (in *PriorityLevelConfigurationList) APILifecycleReplacement() schema.GroupVersionKind {
|
||||
return schema.GroupVersionKind{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "PriorityLevelConfigurationList"}
|
||||
}
|
||||
|
||||
// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.
|
||||
// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.
|
||||
func (in *PriorityLevelConfigurationList) APILifecycleRemoved() (major, minor int) {
|
||||
|
5
vendor/k8s.io/client-go/tools/pager/pager.go
generated
vendored
5
vendor/k8s.io/client-go/tools/pager/pager.go
generated
vendored
@ -78,6 +78,7 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti
|
||||
options.Limit = p.PageSize
|
||||
}
|
||||
requestedResourceVersion := options.ResourceVersion
|
||||
requestedResourceVersionMatch := options.ResourceVersionMatch
|
||||
var list *metainternalversion.List
|
||||
paginatedResult := false
|
||||
|
||||
@ -102,6 +103,7 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti
|
||||
options.Limit = 0
|
||||
options.Continue = ""
|
||||
options.ResourceVersion = requestedResourceVersion
|
||||
options.ResourceVersionMatch = requestedResourceVersionMatch
|
||||
result, err := p.PageFn(ctx, options)
|
||||
return result, paginatedResult, err
|
||||
}
|
||||
@ -135,10 +137,11 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti
|
||||
|
||||
// set the next loop up
|
||||
options.Continue = m.GetContinue()
|
||||
// Clear the ResourceVersion on the subsequent List calls to avoid the
|
||||
// Clear the ResourceVersion(Match) on the subsequent List calls to avoid the
|
||||
// `specifying resource version is not allowed when using continue` error.
|
||||
// See https://github.com/kubernetes/kubernetes/issues/85221#issuecomment-553748143.
|
||||
options.ResourceVersion = ""
|
||||
options.ResourceVersionMatch = ""
|
||||
// At this point, result is already paginated.
|
||||
paginatedResult = true
|
||||
}
|
||||
|
14
vendor/k8s.io/mount-utils/mount_helper_common.go
generated
vendored
14
vendor/k8s.io/mount-utils/mount_helper_common.go
generated
vendored
@ -135,17 +135,3 @@ func removePathIfNotMountPoint(mountPath string, mounter Interface, extensiveMou
|
||||
}
|
||||
return notMnt, nil
|
||||
}
|
||||
|
||||
// PathExists returns true if the specified path exists.
|
||||
// TODO: clean this up to use pkg/util/file/FileExists
|
||||
func PathExists(path string) (bool, error) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
} else if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
} else if IsCorruptedMnt(err) {
|
||||
return true, err
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
|
28
vendor/k8s.io/mount-utils/mount_helper_unix.go
generated
vendored
28
vendor/k8s.io/mount-utils/mount_helper_unix.go
generated
vendored
@ -20,12 +20,15 @@ limitations under the License.
|
||||
package mount
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
utilio "k8s.io/utils/io"
|
||||
)
|
||||
|
||||
@ -51,6 +54,8 @@ func IsCorruptedMnt(err error) bool {
|
||||
underlyingError = pe.Err
|
||||
case *os.SyscallError:
|
||||
underlyingError = pe.Err
|
||||
case syscall.Errno:
|
||||
underlyingError = err
|
||||
}
|
||||
|
||||
return underlyingError == syscall.ENOTCONN || underlyingError == syscall.ESTALE || underlyingError == syscall.EIO || underlyingError == syscall.EACCES || underlyingError == syscall.EHOSTDOWN
|
||||
@ -157,3 +162,26 @@ func isMountPointMatch(mp MountPoint, dir string) bool {
|
||||
deletedDir := fmt.Sprintf("%s\\040(deleted)", dir)
|
||||
return ((mp.Path == dir) || (mp.Path == deletedDir))
|
||||
}
|
||||
|
||||
// PathExists returns true if the specified path exists.
|
||||
// TODO: clean this up to use pkg/util/file/FileExists
|
||||
func PathExists(path string) (bool, error) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
} else if errors.Is(err, fs.ErrNotExist) {
|
||||
err = syscall.Access(path, syscall.F_OK)
|
||||
if err == nil {
|
||||
// The access syscall says the file exists, the stat syscall says it
|
||||
// doesn't. This was observed on CIFS when the path was removed at
|
||||
// the server somehow. POSIX calls this a stale file handle, let's fake
|
||||
// that error and treat the path as existing but corrupted.
|
||||
klog.Warningf("Potential stale file handle detected: %s", path)
|
||||
return true, syscall.ESTALE
|
||||
}
|
||||
return false, nil
|
||||
} else if IsCorruptedMnt(err) {
|
||||
return true, err
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
|
14
vendor/k8s.io/mount-utils/mount_helper_windows.go
generated
vendored
14
vendor/k8s.io/mount-utils/mount_helper_windows.go
generated
vendored
@ -95,3 +95,17 @@ func ValidateDiskNumber(disk string) error {
|
||||
func isMountPointMatch(mp MountPoint, dir string) bool {
|
||||
return mp.Path == dir
|
||||
}
|
||||
|
||||
// PathExists returns true if the specified path exists.
|
||||
// TODO: clean this up to use pkg/util/file/FileExists
|
||||
func PathExists(path string) (bool, error) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
} else if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
} else if IsCorruptedMnt(err) {
|
||||
return true, err
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user