MCPcopy Create free account
hub / github.com/DBCDK/morph / execUploadSecrets

Function execUploadSecrets

morph.go:499–523  ·  view source on GitHub ↗
(sshContext *ssh.SSHContext, hosts []nix.Host, phase *string)

Source from the content-addressed store, hash-verified

497}
498
499func execUploadSecrets(sshContext *ssh.SSHContext, hosts []nix.Host, phase *string) error {
500 for _, host := range hosts {
501 if host.BuildOnly {
502 fmt.Fprintf(os.Stderr, "Secret upload is disabled for build-only host: %s\n", host.Name)
503 continue
504 }
505 singleHostInList := []nix.Host{host}
506
507 err := secretsUpload(sshContext, singleHostInList, phase)
508 if err != nil {
509 return err
510 }
511
512 if !skipHealthChecks {
513 err = healthchecks.PerformHealthChecks(sshContext, &host, timeout)
514 if err != nil {
515 fmt.Fprintln(os.Stderr)
516 fmt.Fprintln(os.Stderr, "Not uploading to additional hosts, since a host health check failed.")
517 return err
518 }
519 }
520 }
521
522 return nil
523}
524
525func execListSecrets(hosts []nix.Host) {
526 for _, host := range hosts {

Callers 2

mainFunction · 0.85
execDeployFunction · 0.85

Calls 2

PerformHealthChecksFunction · 0.92
secretsUploadFunction · 0.85

Tested by

no test coverage detected