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
2ff043e7
Commit
2ff043e7
authored
Oct 19, 2015
by
Paul Morie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ownership inspection to mount tester image
parent
b896a666
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
3 deletions
+35
-3
excluded-flags.txt
hack/verify-flags/excluded-flags.txt
+2
-0
Dockerfile
test/images/mount-tester-user/Dockerfile
+1
-1
Makefile
test/images/mount-tester-user/Makefile
+1
-1
Makefile
test/images/mount-tester/Makefile
+1
-1
mt.go
test/images/mount-tester/mt.go
+30
-0
No files found.
hack/verify-flags/excluded-flags.txt
View file @
2ff043e7
...
@@ -3,6 +3,7 @@ concurrent_rc_syncs
...
@@ -3,6 +3,7 @@ concurrent_rc_syncs
etcd_mutation_timeout
etcd_mutation_timeout
file_content
file_content
file_mode
file_mode
file_owner
file_perm
file_perm
fs_type
fs_type
gke_context
gke_context
...
@@ -12,6 +13,7 @@ kube_master_url
...
@@ -12,6 +13,7 @@ kube_master_url
max_in_flight
max_in_flight
max_par
max_par
new_file_0644
new_file_0644
new_file_0660
new_file_0666
new_file_0666
new_file_0777
new_file_0777
pods_per_node
pods_per_node
...
...
test/images/mount-tester-user/Dockerfile
View file @
2ff043e7
...
@@ -12,5 +12,5 @@
...
@@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
FROM
gcr.io/google_containers/mounttest:0.
4
FROM
gcr.io/google_containers/mounttest:0.
5
USER
1001
USER
1001
test/images/mount-tester-user/Makefile
View file @
2ff043e7
all
:
push
all
:
push
TAG
=
0.
2
TAG
=
0.
3
image
:
image
:
sudo
docker build
-t
gcr.io/google_containers/mounttest-user:
$(TAG)
.
sudo
docker build
-t
gcr.io/google_containers/mounttest-user:
$(TAG)
.
...
...
test/images/mount-tester/Makefile
View file @
2ff043e7
all
:
push
all
:
push
TAG
=
0.
4
TAG
=
0.
5
mt
:
mt.go
mt
:
mt.go
CGO_ENABLED
=
0
GOOS
=
linux go build
-a
-installsuffix
cgo
-ldflags
'-w'
./mt.go
CGO_ENABLED
=
0
GOOS
=
linux go build
-a
-installsuffix
cgo
-ldflags
'-w'
./mt.go
...
...
test/images/mount-tester/mt.go
View file @
2ff043e7
...
@@ -29,8 +29,10 @@ var (
...
@@ -29,8 +29,10 @@ var (
fsTypePath
=
""
fsTypePath
=
""
fileModePath
=
""
fileModePath
=
""
filePermPath
=
""
filePermPath
=
""
fileOwnerPath
=
""
newFilePath0644
=
""
newFilePath0644
=
""
newFilePath0666
=
""
newFilePath0666
=
""
newFilePath0660
=
""
newFilePath0777
=
""
newFilePath0777
=
""
readFileContentPath
=
""
readFileContentPath
=
""
readFileContentInLoopPath
=
""
readFileContentInLoopPath
=
""
...
@@ -41,8 +43,10 @@ func init() {
...
@@ -41,8 +43,10 @@ func init() {
flag
.
StringVar
(
&
fsTypePath
,
"fs_type"
,
""
,
"Path to print the fs type for"
)
flag
.
StringVar
(
&
fsTypePath
,
"fs_type"
,
""
,
"Path to print the fs type for"
)
flag
.
StringVar
(
&
fileModePath
,
"file_mode"
,
""
,
"Path to print the mode bits of"
)
flag
.
StringVar
(
&
fileModePath
,
"file_mode"
,
""
,
"Path to print the mode bits of"
)
flag
.
StringVar
(
&
filePermPath
,
"file_perm"
,
""
,
"Path to print the perms of"
)
flag
.
StringVar
(
&
filePermPath
,
"file_perm"
,
""
,
"Path to print the perms of"
)
flag
.
StringVar
(
&
fileOwnerPath
,
"file_owner"
,
""
,
"Path to print the owning UID and GID of"
)
flag
.
StringVar
(
&
newFilePath0644
,
"new_file_0644"
,
""
,
"Path to write to and read from with perm 0644"
)
flag
.
StringVar
(
&
newFilePath0644
,
"new_file_0644"
,
""
,
"Path to write to and read from with perm 0644"
)
flag
.
StringVar
(
&
newFilePath0666
,
"new_file_0666"
,
""
,
"Path to write to and read from with perm 0666"
)
flag
.
StringVar
(
&
newFilePath0666
,
"new_file_0666"
,
""
,
"Path to write to and read from with perm 0666"
)
flag
.
StringVar
(
&
newFilePath0660
,
"new_file_0660"
,
""
,
"Path to write to and read from with perm 0660"
)
flag
.
StringVar
(
&
newFilePath0777
,
"new_file_0777"
,
""
,
"Path to write to and read from with perm 0777"
)
flag
.
StringVar
(
&
newFilePath0777
,
"new_file_0777"
,
""
,
"Path to write to and read from with perm 0777"
)
flag
.
StringVar
(
&
readFileContentPath
,
"file_content"
,
""
,
"Path to read the file content from"
)
flag
.
StringVar
(
&
readFileContentPath
,
"file_content"
,
""
,
"Path to read the file content from"
)
flag
.
StringVar
(
&
readFileContentInLoopPath
,
"file_content_in_loop"
,
""
,
"Path to read the file content in loop from"
)
flag
.
StringVar
(
&
readFileContentInLoopPath
,
"file_content_in_loop"
,
""
,
"Path to read the file content in loop from"
)
...
@@ -86,6 +90,11 @@ func main() {
...
@@ -86,6 +90,11 @@ func main() {
errs
=
append
(
errs
,
err
)
errs
=
append
(
errs
,
err
)
}
}
err
=
readWriteNewFile
(
newFilePath0660
,
0660
)
if
err
!=
nil
{
errs
=
append
(
errs
,
err
)
}
err
=
readWriteNewFile
(
newFilePath0777
,
0777
)
err
=
readWriteNewFile
(
newFilePath0777
,
0777
)
if
err
!=
nil
{
if
err
!=
nil
{
errs
=
append
(
errs
,
err
)
errs
=
append
(
errs
,
err
)
...
@@ -101,6 +110,11 @@ func main() {
...
@@ -101,6 +110,11 @@ func main() {
errs
=
append
(
errs
,
err
)
errs
=
append
(
errs
,
err
)
}
}
err
=
fileOwner
(
fileOwnerPath
)
if
err
!=
nil
{
errs
=
append
(
errs
,
err
)
}
err
=
readFileContent
(
readFileContentPath
)
err
=
readFileContent
(
readFileContentPath
)
if
err
!=
nil
{
if
err
!=
nil
{
errs
=
append
(
errs
,
err
)
errs
=
append
(
errs
,
err
)
...
@@ -171,6 +185,22 @@ func filePerm(path string) error {
...
@@ -171,6 +185,22 @@ func filePerm(path string) error {
return
nil
return
nil
}
}
func
fileOwner
(
path
string
)
error
{
if
path
==
""
{
return
nil
}
buf
:=
syscall
.
Stat_t
{}
if
err
:=
syscall
.
Stat
(
path
,
&
buf
);
err
!=
nil
{
fmt
.
Printf
(
"error from stat(%q): %v
\n
"
,
path
,
err
)
return
err
}
fmt
.
Printf
(
"owner UID of %q: %v
\n
"
,
path
,
buf
.
Uid
)
fmt
.
Printf
(
"owner GID of %q: %v
\n
"
,
path
,
buf
.
Gid
)
return
nil
}
func
readFileContent
(
path
string
)
error
{
func
readFileContent
(
path
string
)
error
{
if
path
==
""
{
if
path
==
""
{
return
nil
return
nil
...
...
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