Remove unreachable warning on volume name dup
Volume names are validated to be unique and always have been. The cited issues are all about apply getting messed up, not the aspiserver allowing dups. ``` $ k create -f /tmp/bad.yaml The Deployment "bad-volumes-test" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "config" $ k apply --server-side -f /tmp/bad.yaml Error from server: failed to create typed patch object (default/bad-volumes-test; apps/v1, Kind=Deployment): .spec.template.spec.volumes: duplicate entries for key [name="config"] $ k apply -f /tmp/bad.yaml -o json | jq '.spec.template.spec.volumes' The Deployment "bad-volumes-test" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "config" ```
This commit is contained in:
@@ -192,18 +192,6 @@ func warningsForPodSpecAndMeta(fieldPath *field.Path, podSpec *api.PodSpec, meta
|
||||
}
|
||||
}
|
||||
|
||||
// duplicate volume names (#78266, #58477)
|
||||
if len(podSpec.Volumes) > 1 {
|
||||
items := sets.NewString()
|
||||
for i, item := range podSpec.Volumes {
|
||||
if items.Has(item.Name) {
|
||||
warnings = append(warnings, fmt.Sprintf("%s: duplicate name %q", fieldPath.Child("spec", "volumes").Index(i).Child("name"), item.Name))
|
||||
} else {
|
||||
items.Insert(item.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fractional memory/ephemeral-storage requests/limits (#79950, #49442, #18538)
|
||||
if value, ok := podSpec.Overhead[api.ResourceMemory]; ok && value.MilliValue()%int64(1000) != int64(0) {
|
||||
warnings = append(warnings, fmt.Sprintf("%s: fractional byte value %q is invalid, must be an integer", fieldPath.Child("spec", "overhead").Key(string(api.ResourceMemory)), value.String()))
|
||||
|
Reference in New Issue
Block a user