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

Merge pull request #59728 from wgliang/master.append

Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). 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>. more concise to merge the slice **What this PR does / why we need it**: more concise to merge the slice **Special notes for your reviewer**:
parents 8c2e1cca 31aad753
......@@ -247,9 +247,8 @@ func TestUpdateNodesInExternalLoadBalancer(t *testing.T) {
controller, cloud, _ := newController()
var services []*v1.Service
for _, service := range item.services {
services = append(services, service)
}
services = append(services, item.services...)
if err := controller.updateLoadBalancerHosts(services, nodes); err != nil {
t.Errorf("unexpected error: %v", err)
}
......
......@@ -404,9 +404,8 @@ func TestGenericScheduler(t *testing.T) {
cache.AddNode(&v1.Node{ObjectMeta: metav1.ObjectMeta{Name: name}})
}
pvcs := []*v1.PersistentVolumeClaim{}
for _, pvc := range test.pvcs {
pvcs = append(pvcs, pvc)
}
pvcs = append(pvcs, test.pvcs...)
pvcLister := schedulertesting.FakePersistentVolumeClaimLister(pvcs)
scheduler := NewGenericScheduler(
......
......@@ -590,9 +590,7 @@ func (r *rbdVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
switch dstrings.ToLower(k) {
case "monitors":
arr := dstrings.Split(v, ",")
for _, m := range arr {
r.Mon = append(r.Mon, m)
}
r.Mon = append(r.Mon, arr...)
case "adminid":
r.adminId = v
case "adminsecretname":
......
......@@ -276,9 +276,8 @@ func TestGCAdmission(t *testing.T) {
func TestBlockOwnerDeletionAdmission(t *testing.T) {
podWithOwnerRefs := func(refs ...metav1.OwnerReference) *api.Pod {
var refSlice []metav1.OwnerReference
for _, ref := range refs {
refSlice = append(refSlice, ref)
}
refSlice = append(refSlice, refs...)
return &api.Pod{
ObjectMeta: metav1.ObjectMeta{
OwnerReferences: refSlice,
......
......@@ -112,9 +112,8 @@ func TestNamedCertKeyArrayFlag(t *testing.T) {
for i, test := range tests {
fs := pflag.NewFlagSet("testNamedCertKeyArray", pflag.ContinueOnError)
var nkcs []NamedCertKey
for _, d := range test.def {
nkcs = append(nkcs, d)
}
nkcs = append(nkcs, test.def...)
fs.Var(NewNamedCertKeyArray(&nkcs), "tls-sni-cert-key", "usage")
args := []string{}
......
......@@ -220,9 +220,7 @@ func (r *ResourceCollector) GetBasicCPUStats(containerName string) map[float64]f
// We must make a copy of array, otherwise the timeseries order is changed.
usages := make([]*framework.ContainerResourceUsage, 0)
for _, usage := range r.buffers[containerName] {
usages = append(usages, usage)
}
usages = append(usages, r.buffers[containerName]...)
sort.Sort(resourceUsageByCPU(usages))
for _, q := range percentiles {
......
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