MCPcopy Create free account
hub / github.com/cloudbase/garm / validateAgentID

Method validateAgentID

database/sql/instances.go:303–308  ·  view source on GitHub ↗

validateAgentID checks agent ID consistency

(currentAgentID, newAgentID int64)

Source from the content-addressed store, hash-verified

301
302// validateAgentID checks agent ID consistency
303func (s *sqlDatabase) validateAgentID(currentAgentID, newAgentID int64) error {
304 if currentAgentID != 0 && newAgentID != 0 && currentAgentID != newAgentID {
305 return runnerErrors.NewBadRequestError("agent ID mismatch")
306 }
307 return nil
308}
309
310// validateRunnerStatusTransition validates runner status state transition
311func (s *sqlDatabase) validateRunnerStatusTransition(current, newStatus params.RunnerStatus) error {

Callers 1

updateInstanceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected