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

Function validateAgentConfig

cmd/controller/flags.go:314–334  ·  view source on GitHub ↗
(agentConfig *config.AgentConfig)

Source from the content-addressed store, hash-verified

312}
313
314func validateAgentConfig(agentConfig *config.AgentConfig) error {
315 if agentConfig == nil {
316 return nil
317 }
318
319 var errs []error
320 for i, h := range agentConfig.AdditionalHooks {
321 if h.Path == "" {
322 errs = append(errs, fmt.Errorf("agent-config.additional-hooks[%d].path is required", i))
323 }
324 if h.Volume == nil {
325 errs = append(errs, fmt.Errorf("agent-config.additional-hooks[%d].volume is required", i))
326 continue
327 }
328 if h.Volume.Name == "" {
329 errs = append(errs, fmt.Errorf("agent-config.additional-hooks[%d].volume.name is required", i))
330 }
331 }
332
333 return errors.Join(errs...)
334}
335
336func validatePodSpecPatch(podSpec *corev1.PodSpec, allowCmdMod bool) error {
337 for idx, c := range podSpec.Containers {

Callers 1

validateConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected