Merge pull request #2634 from piotrnosek/nosekfix

Fix accessing empty array in e2e tests
This commit is contained in:
Kubernetes Prow Robot 2019-12-10 12:40:06 -08:00 committed by GitHub
commit 2d80cb340d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -226,7 +226,7 @@ func getCronJob(c clientset.Interface, ns, name string) (*batchv1beta1.CronJob,
// SetupHamsterCronJob creates and sets up a new CronJob
func SetupHamsterCronJob(f *framework.Framework, schedule, cpu, memory string, replicas int32) {
cronJob := NewTestCronJob("hamster-cronjob", schedule)
cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0] = SetupHamsterContainer(cpu, memory)
cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers = []apiv1.Container{SetupHamsterContainer(cpu, memory)}
for label, value := range hamsterLabels {
cronJob.Spec.JobTemplate.Spec.Template.Labels[label] = value
}

View File

@ -226,7 +226,7 @@ func getCronJob(c clientset.Interface, ns, name string) (*batchv1beta1.CronJob,
// SetupHamsterCronJob creates and sets up a new CronJob
func SetupHamsterCronJob(f *framework.Framework, schedule, cpu, memory string, replicas int32) {
cronJob := NewTestCronJob("hamster-cronjob", schedule)
cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0] = SetupHamsterContainer(cpu, memory)
cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers = []apiv1.Container{SetupHamsterContainer(cpu, memory)}
for label, value := range hamsterLabels {
cronJob.Spec.JobTemplate.Spec.Template.Labels[label] = value
}