( ctx context.Context, spec *v1.PodSpec, conf *config.JobConfig, util config.UtilityConfig, vars templateVars, annotation string, jobName string, resolver ImageResolver, )
| 360 | } |
| 361 | |
| 362 | func processPeriodicContainers( |
| 363 | ctx context.Context, |
| 364 | spec *v1.PodSpec, |
| 365 | conf *config.JobConfig, |
| 366 | util config.UtilityConfig, |
| 367 | vars templateVars, |
| 368 | annotation string, |
| 369 | jobName string, |
| 370 | resolver ImageResolver, |
| 371 | ) error { |
| 372 | if spec == nil { |
| 373 | return nil |
| 374 | } |
| 375 | |
| 376 | for idx := range spec.Containers { |
| 377 | container := &spec.Containers[idx] |
| 378 | container.Image = fixImage(container.Image, vars.Version) |
| 379 | container.Env = fixEnvVars(container.Env, vars.Version) |
| 380 | |
| 381 | var err error |
| 382 | |
| 383 | container.Image, err = resolveImage(ctx, resolver, container.Image) |
| 384 | if err != nil { |
| 385 | return fmt.Errorf("%s: %w", jobName, err) |
| 386 | } |
| 387 | |
| 388 | if !shouldDecorate(conf, util) { |
| 389 | container.Command = fixBootstrapArgs(container.Command, vars.Version) |
| 390 | container.Args = fixBootstrapArgs(container.Args, vars.Version) |
| 391 | } |
| 392 | |
| 393 | container.Command, err = performReplacement(container.Command, vars, annotation) |
| 394 | if err != nil { |
| 395 | return fmt.Errorf("%s: %w", jobName, err) |
| 396 | } |
| 397 | |
| 398 | container.Args, err = performReplacement(container.Args, vars, annotation) |
| 399 | if err != nil { |
| 400 | return fmt.Errorf("%s: %w", jobName, err) |
| 401 | } |
| 402 | |
| 403 | for envIdx := range container.Env { |
| 404 | container.Env[envIdx].Name, |
| 405 | container.Env[envIdx].Value, |
| 406 | err = performEnvReplacement( |
| 407 | container.Env[envIdx].Name, |
| 408 | container.Env[envIdx].Value, |
| 409 | vars, annotation, |
| 410 | ) |
| 411 | if err != nil { |
| 412 | return fmt.Errorf("%s: %w", jobName, err) |
| 413 | } |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | return nil |
| 418 | } |
| 419 |
no test coverage detected