Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
123590d9
Commit
123590d9
authored
Jan 23, 2019
by
Andrew Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace pkg/util/io with k8s.io/utils/io
parent
e321cdae
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
76 deletions
+7
-76
.import-restrictions
pkg/controller/.import-restrictions
+3
-2
.import-restrictions
pkg/kubectl/.import-restrictions
+2
-1
BUILD
pkg/util/BUILD
+0
-1
BUILD
pkg/util/io/BUILD
+0
-25
consistentread.go
pkg/util/io/consistentread.go
+0
-45
BUILD
pkg/util/mount/BUILD
+1
-1
mount_linux.go
pkg/util/mount/mount_linux.go
+1
-1
No files found.
pkg/controller/.import-restrictions
View file @
123590d9
...
@@ -321,8 +321,7 @@
...
@@ -321,8 +321,7 @@
"k8s.io/kubernetes/pkg/util/resizefs",
"k8s.io/kubernetes/pkg/util/resizefs",
"k8s.io/kubernetes/pkg/util/version",
"k8s.io/kubernetes/pkg/util/version",
"k8s.io/kubernetes/pkg/apis/apps",
"k8s.io/kubernetes/pkg/apis/apps",
"k8s.io/kubernetes/pkg/version",
"k8s.io/kubernetes/pkg/version"
"k8s.io/kubernetes/pkg/util/io"
]
]
},
},
{
{
...
@@ -343,6 +342,8 @@
...
@@ -343,6 +342,8 @@
"k8s.io/metrics/pkg/client/custom_metrics/fake",
"k8s.io/metrics/pkg/client/custom_metrics/fake",
"k8s.io/metrics/pkg/client/external_metrics",
"k8s.io/metrics/pkg/client/external_metrics",
"k8s.io/metrics/pkg/client/external_metrics/fake",
"k8s.io/metrics/pkg/client/external_metrics/fake",
"k8s.io/utils/nsenter",
"k8s.io/utils/io",
"k8s.io/utils/pointer",
"k8s.io/utils/pointer",
"k8s.io/utils/exec"
"k8s.io/utils/exec"
]
]
...
...
pkg/kubectl/.import-restrictions
View file @
123590d9
...
@@ -131,7 +131,6 @@
...
@@ -131,7 +131,6 @@
"k8s.io/kubernetes/pkg/util/goroutinemap",
"k8s.io/kubernetes/pkg/util/goroutinemap",
"k8s.io/kubernetes/pkg/util/hash",
"k8s.io/kubernetes/pkg/util/hash",
"k8s.io/kubernetes/pkg/util/interrupt",
"k8s.io/kubernetes/pkg/util/interrupt",
"k8s.io/kubernetes/pkg/util/io",
"k8s.io/kubernetes/pkg/util/labels",
"k8s.io/kubernetes/pkg/util/labels",
"k8s.io/kubernetes/pkg/util/metrics",
"k8s.io/kubernetes/pkg/util/metrics",
"k8s.io/kubernetes/pkg/util/mount",
"k8s.io/kubernetes/pkg/util/mount",
...
@@ -145,6 +144,8 @@
...
@@ -145,6 +144,8 @@
"k8s.io/kubernetes/pkg/version/prometheus",
"k8s.io/kubernetes/pkg/version/prometheus",
"k8s.io/kubernetes/pkg/volume",
"k8s.io/kubernetes/pkg/volume",
"k8s.io/kubernetes/pkg/volume/util",
"k8s.io/kubernetes/pkg/volume/util",
"k8s.io/utils/nsenter",
"k8s.io/utils/io",
"k8s.io/utils/pointer"
"k8s.io/utils/pointer"
],
],
"ForbiddenPrefixes": []
"ForbiddenPrefixes": []
...
...
pkg/util/BUILD
View file @
123590d9
...
@@ -28,7 +28,6 @@ filegroup(
...
@@ -28,7 +28,6 @@ filegroup(
"//pkg/util/hash:all-srcs",
"//pkg/util/hash:all-srcs",
"//pkg/util/initsystem:all-srcs",
"//pkg/util/initsystem:all-srcs",
"//pkg/util/interrupt:all-srcs",
"//pkg/util/interrupt:all-srcs",
"//pkg/util/io:all-srcs",
"//pkg/util/ipconfig:all-srcs",
"//pkg/util/ipconfig:all-srcs",
"//pkg/util/ipset:all-srcs",
"//pkg/util/ipset:all-srcs",
"//pkg/util/iptables:all-srcs",
"//pkg/util/iptables:all-srcs",
...
...
pkg/util/io/BUILD
deleted
100644 → 0
View file @
e321cdae
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["consistentread.go"],
importpath = "k8s.io/kubernetes/pkg/util/io",
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
pkg/util/io/consistentread.go
deleted
100644 → 0
View file @
e321cdae
/*
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
io
import
(
"bytes"
"fmt"
"io/ioutil"
)
// ConsistentRead repeatedly reads a file until it gets the same content twice.
// This is useful when reading files in /proc that are larger than page size
// and kernel may modify them between individual read() syscalls.
func
ConsistentRead
(
filename
string
,
attempts
int
)
([]
byte
,
error
)
{
oldContent
,
err
:=
ioutil
.
ReadFile
(
filename
)
if
err
!=
nil
{
return
nil
,
err
}
for
i
:=
0
;
i
<
attempts
;
i
++
{
newContent
,
err
:=
ioutil
.
ReadFile
(
filename
)
if
err
!=
nil
{
return
nil
,
err
}
if
bytes
.
Compare
(
oldContent
,
newContent
)
==
0
{
return
newContent
,
nil
}
// Files are different, continue reading
oldContent
=
newContent
}
return
nil
,
fmt
.
Errorf
(
"could not get consistent content of %s after %d attempts"
,
filename
,
attempts
)
}
pkg/util/mount/BUILD
View file @
123590d9
...
@@ -36,10 +36,10 @@ go_library(
...
@@ -36,10 +36,10 @@ go_library(
],
],
"@io_bazel_rules_go//go/platform:linux": [
"@io_bazel_rules_go//go/platform:linux": [
"//pkg/util/file:go_default_library",
"//pkg/util/file:go_default_library",
"//pkg/util/io:go_default_library",
"//pkg/util/nsenter:go_default_library",
"//pkg/util/nsenter:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/golang.org/x/sys/unix:go_default_library",
"//vendor/golang.org/x/sys/unix:go_default_library",
"//vendor/k8s.io/utils/io:go_default_library",
],
],
"@io_bazel_rules_go//go/platform:nacl": [
"@io_bazel_rules_go//go/platform:nacl": [
"//pkg/util/nsenter:go_default_library",
"//pkg/util/nsenter:go_default_library",
...
...
pkg/util/mount/mount_linux.go
View file @
123590d9
...
@@ -34,8 +34,8 @@ import (
...
@@ -34,8 +34,8 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog"
"k8s.io/klog"
utilfile
"k8s.io/kubernetes/pkg/util/file"
utilfile
"k8s.io/kubernetes/pkg/util/file"
utilio
"k8s.io/kubernetes/pkg/util/io"
utilexec
"k8s.io/utils/exec"
utilexec
"k8s.io/utils/exec"
utilio
"k8s.io/utils/io"
)
)
const
(
const
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment