MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / reset

Method reset

extras/dagger/main.go:804–831  ·  view source on GitHub ↗

Call `chainloop reset` to mark the attestation as either failed or cancelled.

(ctx context.Context,
	// +optional
	// The trigger that caused the reset.
	// May be "failure" or "cancellation"
	trigger string,
	// The reason for the reset, in human-readable form
	// +optional
	reason string,
)

Source from the content-addressed store, hash-verified

802
803// Call `chainloop reset` to mark the attestation as either failed or cancelled.
804func (att *Attestation) reset(ctx context.Context,
805 // +optional
806 // The trigger that caused the reset.
807 // May be "failure" or "cancellation"
808 trigger string,
809 // The reason for the reset, in human-readable form
810 // +optional
811 reason string,
812) error {
813 args := []string{
814 "attestation", "reset",
815 "--attestation-id", att.AttestationID,
816 }
817
818 if reason != "" {
819 args = append(args, "--reason", reason)
820 }
821
822 if trigger != "" {
823 args = append(args, "--trigger", trigger)
824 }
825
826 _, err := att.
827 Container(0).
828 WithExec(args, execOpts).
829 Sync(ctx)
830 return err
831}
832
833/// standalone API calls
834

Callers 2

MarkFailedMethod · 0.95
MarkCanceledMethod · 0.95

Calls 2

ContainerMethod · 0.95
SyncMethod · 0.80

Tested by

no test coverage detected