MCPcopy
hub / github.com/redspread/spread / validateRC

Function validateRC

pkg/entity/replicationcontroller.go:170–186  ·  view source on GitHub ↗
(rc *kube.ReplicationController)

Source from the content-addressed store, hash-verified

168}
169
170func validateRC(rc *kube.ReplicationController) error {
171 errList := validation.ValidateReplicationController(rc).Filter(
172 // remove errors about missing template
173 func(e error) bool {
174 return e.Error() == "spec.template: Required value"
175 },
176 )
177
178 meta := rc.GetObjectMeta()
179 if len(meta.GetName()) == 0 && len(meta.GetGenerateName()) > 0 {
180 errList = errList.Filter(func(e error) bool {
181 return e.Error() == "metadata.name: Required value: name or generateName is required"
182 })
183 }
184
185 return errList.ToAggregate()
186}
187
188var (
189 // ErrMissingPod is when the RC is being used in a context where it must be valid and doesn't have a Pod.

Callers 1

NewReplicationControllerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected