MCPcopy Create free account
hub / github.com/compozy/agh / failAppliedUpdate

Function failAppliedUpdate

internal/cli/update.go:243–265  ·  view source on GitHub ↗
(
	cmd *cobra.Command,
	manager updateManager,
	applied aghupdate.AppliedBinary,
	deps commandDeps,
	runtime *runtimeContext,
	record updateRecord,
	prefix string,
	cause error,
	attemptRecoveryStart bool,
)

Source from the content-addressed store, hash-verified

241}
242
243func failAppliedUpdate(
244 cmd *cobra.Command,
245 manager updateManager,
246 applied aghupdate.AppliedBinary,
247 deps commandDeps,
248 runtime *runtimeContext,
249 record updateRecord,
250 prefix string,
251 cause error,
252 attemptRecoveryStart bool,
253) error {
254 rollbackErr := rollbackAppliedUpdate(
255 cmd.Context(),
256 manager,
257 applied,
258 deps,
259 runtime,
260 attemptRecoveryStart,
261 )
262 record.Status = string(aghupdate.StatusFailed)
263 record.Message = combineUpdateErrors(prefix, cause, rollbackErr)
264 return writeUpdateFailure(cmd, record, errors.Join(cause, rollbackErr))
265}
266
267func updateRecordFromState(state aghupdate.State) updateRecord {
268 return updateRecord{

Callers 1

restartDaemonAfterUpdateFunction · 0.85

Calls 3

rollbackAppliedUpdateFunction · 0.85
combineUpdateErrorsFunction · 0.85
writeUpdateFailureFunction · 0.85

Tested by

no test coverage detected