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
c3ba4f1d
Commit
c3ba4f1d
authored
Apr 25, 2018
by
Mayank Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary else clauses
parent
d4b67803
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
validation.go
pkg/apis/core/validation/validation.go
+6
-12
No files found.
pkg/apis/core/validation/validation.go
View file @
c3ba4f1d
...
...
@@ -379,29 +379,25 @@ func ValidateVolumes(volumes []core.Volume, fldPath *field.Path) (map[string]cor
func
IsMatchedVolume
(
name
string
,
volumes
map
[
string
]
core
.
VolumeSource
)
bool
{
if
_
,
ok
:=
volumes
[
name
];
ok
{
return
true
}
else
{
return
false
}
return
false
}
func
isMatchedDevice
(
name
string
,
volumes
map
[
string
]
core
.
VolumeSource
)
(
bool
,
bool
)
{
if
source
,
ok
:=
volumes
[
name
];
ok
{
if
source
.
PersistentVolumeClaim
!=
nil
{
return
true
,
true
}
else
{
return
true
,
false
}
}
else
{
return
false
,
false
return
true
,
false
}
return
false
,
false
}
func
mountNameAlreadyExists
(
name
string
,
devices
map
[
string
]
string
)
bool
{
if
_
,
ok
:=
devices
[
name
];
ok
{
return
true
}
else
{
return
false
}
return
false
}
func
mountPathAlreadyExists
(
mountPath
string
,
devices
map
[
string
]
string
)
bool
{
...
...
@@ -417,9 +413,8 @@ func mountPathAlreadyExists(mountPath string, devices map[string]string) bool {
func
deviceNameAlreadyExists
(
name
string
,
mounts
map
[
string
]
string
)
bool
{
if
_
,
ok
:=
mounts
[
name
];
ok
{
return
true
}
else
{
return
false
}
return
false
}
func
devicePathAlreadyExists
(
devicePath
string
,
mounts
map
[
string
]
string
)
bool
{
...
...
@@ -4201,9 +4196,8 @@ func isLocalStorageResource(name string) bool {
if
name
==
string
(
core
.
ResourceEphemeralStorage
)
||
name
==
string
(
core
.
ResourceRequestsEphemeralStorage
)
||
name
==
string
(
core
.
ResourceLimitsEphemeralStorage
)
{
return
true
}
else
{
return
false
}
return
false
}
// Validate resource names that can go in a resource quota
...
...
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