Unverified Commit 82852718 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #63180 from krmayankk/removcode

Automatic merge from submit-queue (batch tested with PRs 63251, 59166, 63250, 63180, 63169). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. remove unnecessary else clauses Remove unecessary else clause and simplify logic ```release-note none ```
parents 7884cc54 c3ba4f1d
...@@ -379,29 +379,25 @@ func ValidateVolumes(volumes []core.Volume, fldPath *field.Path) (map[string]cor ...@@ -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 { func IsMatchedVolume(name string, volumes map[string]core.VolumeSource) bool {
if _, ok := volumes[name]; ok { if _, ok := volumes[name]; ok {
return true return true
} else {
return false
} }
return false
} }
func isMatchedDevice(name string, volumes map[string]core.VolumeSource) (bool, bool) { func isMatchedDevice(name string, volumes map[string]core.VolumeSource) (bool, bool) {
if source, ok := volumes[name]; ok { if source, ok := volumes[name]; ok {
if source.PersistentVolumeClaim != nil { if source.PersistentVolumeClaim != nil {
return true, true return true, true
} else {
return true, false
} }
} else { return true, false
return false, false
} }
return false, false
} }
func mountNameAlreadyExists(name string, devices map[string]string) bool { func mountNameAlreadyExists(name string, devices map[string]string) bool {
if _, ok := devices[name]; ok { if _, ok := devices[name]; ok {
return true return true
} else {
return false
} }
return false
} }
func mountPathAlreadyExists(mountPath string, devices map[string]string) bool { func mountPathAlreadyExists(mountPath string, devices map[string]string) bool {
...@@ -417,9 +413,8 @@ 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 { func deviceNameAlreadyExists(name string, mounts map[string]string) bool {
if _, ok := mounts[name]; ok { if _, ok := mounts[name]; ok {
return true return true
} else {
return false
} }
return false
} }
func devicePathAlreadyExists(devicePath string, mounts map[string]string) bool { func devicePathAlreadyExists(devicePath string, mounts map[string]string) bool {
...@@ -4201,9 +4196,8 @@ func isLocalStorageResource(name string) bool { ...@@ -4201,9 +4196,8 @@ func isLocalStorageResource(name string) bool {
if name == string(core.ResourceEphemeralStorage) || name == string(core.ResourceRequestsEphemeralStorage) || if name == string(core.ResourceEphemeralStorage) || name == string(core.ResourceRequestsEphemeralStorage) ||
name == string(core.ResourceLimitsEphemeralStorage) { name == string(core.ResourceLimitsEphemeralStorage) {
return true return true
} else {
return false
} }
return false
} }
// Validate resource names that can go in a resource quota // Validate resource names that can go in a resource quota
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment