MCPcopy Create free account
hub / github.com/buildkite/agent-stack-k8s / validatePodSpecPatch

Function validatePodSpecPatch

cmd/controller/flags.go:336–348  ·  view source on GitHub ↗
(podSpec *corev1.PodSpec, allowCmdMod bool)

Source from the content-addressed store, hash-verified

334}
335
336func validatePodSpecPatch(podSpec *corev1.PodSpec, allowCmdMod bool) error {
337 for idx, c := range podSpec.Containers {
338 if c.Image != strings.ToLower(c.Image) {
339 return fmt.Errorf("container image for container at index %d contains uppercase letters: %s", idx, c.Image)
340 }
341
342 if !allowCmdMod && (len(c.Command) != 0 || len(c.Args) != 0) {
343 return fmt.Errorf("container at index %d (image: %s): %w", idx, c.Image, scheduler.ErrNoCommandModification)
344 }
345 }
346
347 return nil
348}

Callers 1

validateConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected