Add generated file
This PR adds generated files under pkg/client and vendor folder.
This commit is contained in:
94
vendor/k8s.io/kubernetes/pkg/util/resizefs/BUILD
generated
vendored
Normal file
94
vendor/k8s.io/kubernetes/pkg/util/resizefs/BUILD
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = select({
|
||||
"@io_bazel_rules_go//go/platform:android": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:darwin": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:dragonfly": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:freebsd": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"resizefs_linux.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:nacl": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:netbsd": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:openbsd": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:plan9": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:solaris": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:windows": [
|
||||
"resizefs_unsupported.go",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
importpath = "k8s.io/kubernetes/pkg/util/resizefs",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = select({
|
||||
"@io_bazel_rules_go//go/platform:android": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:darwin": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:dragonfly": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:freebsd": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:nacl": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:netbsd": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:openbsd": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:plan9": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:solaris": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:windows": [
|
||||
"//pkg/util/mount:go_default_library",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
86
vendor/k8s.io/kubernetes/pkg/util/resizefs/resizefs_linux.go
generated
vendored
Normal file
86
vendor/k8s.io/kubernetes/pkg/util/resizefs/resizefs_linux.go
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
// +build linux
|
||||
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package resizefs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
)
|
||||
|
||||
// ResizeFs Provides support for resizing file systems
|
||||
type ResizeFs struct {
|
||||
mounter *mount.SafeFormatAndMount
|
||||
}
|
||||
|
||||
// NewResizeFs returns new instance of resizer
|
||||
func NewResizeFs(mounter *mount.SafeFormatAndMount) *ResizeFs {
|
||||
return &ResizeFs{mounter: mounter}
|
||||
}
|
||||
|
||||
// Resize perform resize of file system
|
||||
func (resizefs *ResizeFs) Resize(devicePath string, deviceMountPath string) (bool, error) {
|
||||
format, err := resizefs.mounter.GetDiskFormat(devicePath)
|
||||
|
||||
if err != nil {
|
||||
formatErr := fmt.Errorf("ResizeFS.Resize - error checking format for device %s: %v", devicePath, err)
|
||||
return false, formatErr
|
||||
}
|
||||
|
||||
// If disk has no format, there is no need to resize the disk because mkfs.*
|
||||
// by default will use whole disk anyways.
|
||||
if format == "" {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
glog.V(3).Infof("ResizeFS.Resize - Expanding mounted volume %s", devicePath)
|
||||
switch format {
|
||||
case "ext3", "ext4":
|
||||
return resizefs.extResize(devicePath)
|
||||
case "xfs":
|
||||
return resizefs.xfsResize(deviceMountPath)
|
||||
}
|
||||
return false, fmt.Errorf("ResizeFS.Resize - resize of format %s is not supported for device %s mounted at %s", format, devicePath, deviceMountPath)
|
||||
}
|
||||
|
||||
func (resizefs *ResizeFs) extResize(devicePath string) (bool, error) {
|
||||
output, err := resizefs.mounter.Exec.Run("resize2fs", devicePath)
|
||||
if err == nil {
|
||||
glog.V(2).Infof("Device %s resized successfully", devicePath)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
resizeError := fmt.Errorf("resize of device %s failed: %v. resize2fs output: %s", devicePath, err, string(output))
|
||||
return false, resizeError
|
||||
|
||||
}
|
||||
|
||||
func (resizefs *ResizeFs) xfsResize(deviceMountPath string) (bool, error) {
|
||||
args := []string{"-d", deviceMountPath}
|
||||
output, err := resizefs.mounter.Exec.Run("xfs_growfs", args...)
|
||||
|
||||
if err == nil {
|
||||
glog.V(2).Infof("Device %s resized successfully", deviceMountPath)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
resizeError := fmt.Errorf("resize of device %s failed: %v. xfs_growfs output: %s", deviceMountPath, err, string(output))
|
||||
return false, resizeError
|
||||
}
|
40
vendor/k8s.io/kubernetes/pkg/util/resizefs/resizefs_unsupported.go
generated
vendored
Normal file
40
vendor/k8s.io/kubernetes/pkg/util/resizefs/resizefs_unsupported.go
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
// +build !linux
|
||||
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package resizefs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
)
|
||||
|
||||
// ResizeFs Provides support for resizing file systems
|
||||
type ResizeFs struct {
|
||||
mounter *mount.SafeFormatAndMount
|
||||
}
|
||||
|
||||
// NewResizeFs returns new instance of resizer
|
||||
func NewResizeFs(mounter *mount.SafeFormatAndMount) *ResizeFs {
|
||||
return &ResizeFs{mounter: mounter}
|
||||
}
|
||||
|
||||
// Resize perform resize of file system
|
||||
func (resizefs *ResizeFs) Resize(devicePath string, deviceMountPath string) (bool, error) {
|
||||
return false, fmt.Errorf("Resize is not supported for this build")
|
||||
}
|
Reference in New Issue
Block a user