Build an ephemeral container with everything needed to process the attestation
( // Cache TTL for chainloop commands, in seconds // Defaults to 0: no caching // +optional // +default=0 ttl int, )
| 685 | |
| 686 | // Build an ephemeral container with everything needed to process the attestation |
| 687 | func (att *Attestation) Container( |
| 688 | // Cache TTL for chainloop commands, in seconds |
| 689 | // Defaults to 0: no caching |
| 690 | // +optional |
| 691 | // +default=0 |
| 692 | ttl int, |
| 693 | ) *dagger.Container { |
| 694 | ctr := cliContainer(ttl, att.Token, att.Client.Instance, att.parentCIContext, att.githubEventFile, att.Client.Enterprise) |
| 695 | if att.repository != nil { |
| 696 | ctr = ctr.WithDirectory(".", att.repository) |
| 697 | } |
| 698 | |
| 699 | if addr := att.RegistryAuth.Address; addr != "" { |
| 700 | ctr = ctr.WithEnvVariable("CHAINLOOP_REGISTRY_SERVER", addr) |
| 701 | } |
| 702 | |
| 703 | if user := att.RegistryAuth.Username; user != "" { |
| 704 | ctr = ctr.WithEnvVariable("CHAINLOOP_REGISTRY_USERNAME", user) |
| 705 | } |
| 706 | |
| 707 | if pw := att.RegistryAuth.Password; pw != nil { |
| 708 | ctr = ctr.WithSecretVariable("CHAINLOOP_REGISTRY_PASSWORD", pw) |
| 709 | } |
| 710 | |
| 711 | return ctr |
| 712 | } |
| 713 | |
| 714 | type OutputFormat string |
| 715 |
no test coverage detected