Fix slice init length (#3018)
Signed-off-by: cuishuang <imcusg@gmail.com>
This commit is contained in:
@@ -301,7 +301,7 @@ func (cfg *Config) addFetcherToPodSpecWithCommand(podSpec *apiv1.PodSpec, mainCo
|
||||
podSpec.Containers[ix] = container
|
||||
}
|
||||
if !found {
|
||||
existingContainerNames := make([]string, len(podSpec.Containers))
|
||||
existingContainerNames := make([]string, 0, len(podSpec.Containers))
|
||||
for _, existingContainer := range podSpec.Containers {
|
||||
existingContainerNames = append(existingContainerNames, existingContainer.Name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user