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

Function handleDefaultUpdateConfirmation

app/cli/cmd/casbackend.go:188–198  ·  view source on GitHub ↗

handleDefaultUpdateConfirmation centralizes the confirmation logic when the --default flag is provided. It returns (true, nil) when it's ok to proceed, (false, nil) when the user declined confirmation, or (false, err) when an error happened.

(actionOpts *action.ActionsOpts, name string)

Source from the content-addressed store, hash-verified

186// is provided. It returns (true, nil) when it's ok to proceed, (false, nil) when the user
187// declined confirmation, or (false, err) when an error happened.
188func handleDefaultUpdateConfirmation(actionOpts *action.ActionsOpts, name string) (bool, error) {
189 if isDefaultCASBackendUpdateOption == nil {
190 return true, nil
191 }
192
193 if *isDefaultCASBackendUpdateOption {
194 return confirmDefaultCASBackendOverride(actionOpts, name)
195 }
196
197 return confirmDefaultCASBackendUnset(name, "You are setting the default CAS backend to false", actionOpts)
198}

Tested by

no test coverage detected