Documentation ¶
Index ¶
Constants ¶
View Source
const CollectorConfigPath = "/etc/otelcol-contrib/config.yaml"
View Source
const CollectorImageName = "ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest"
CollectorImageName is the default Docker image used
View Source
const ConfigFilePath = "/config.json"
ConfigFilePath is the path to proxy config file.
View Source
const ProxyImageName = "ghcr.io/github/dependabot-update-job-proxy/dependabot-update-job-proxy:latest"
ProxyImageName is the default Docker image used by the proxy
Variables ¶
View Source
var CertSubject = pkix.Name{ CommonName: "Dependabot Internal CA", OrganizationalUnit: []string{"Dependabot"}, Organization: []string{"GitHub Inc."}, Locality: []string{"San Francisco"}, Province: []string{"California"}, Country: []string{"US"}, }
View Source
var ErrInvalidVolume = fmt.Errorf("invalid volume syntax")
View Source
var (
ErrWriteAccess = fmt.Errorf("for security, credentials used in update are not allowed to have write access to GitHub API")
)
Functions ¶
Types ¶
type BasicAuthCredentials ¶
type BasicAuthCredentials struct { Username string `json:"username"` Password string `json:"password"` }
BasicAuthCredentials represents credentials required for HTTP basic auth
type CertificateAuthority ¶
CertificateAuthority includes the MITM CA certificate and private key
func GenerateCertificateAuthority ¶
func GenerateCertificateAuthority() (CertificateAuthority, error)
GenerateCertificateAuthority generates a new proxy keypair CA
type Collector ¶ added in v1.38.0
type Collector struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { Credentials []model.Credential `json:"all_credentials"` CA CertificateAuthority `json:"ca"` }
Config is the structure of the proxy's config file
type Networks ¶
type Networks struct { NoInternet types.NetworkCreateResponse Internet types.NetworkCreateResponse // contains filtered or unexported fields }
type RunParams ¶
type RunParams struct { // Input file Input string // job definition passed to the updater Job *model.Job // expectations asserted at the end of a test Expected []model.Output // directory to copy into the updater container as the repo LocalDir string // credentials passed to the proxy Creds []model.Credential // local directory used for caching CacheDir string // write output to a file Output string // ProxyCertPath is the path to a cert for the proxy to trust ProxyCertPath string // attempt to pull images if they aren't local? PullImages bool // run an interactive shell? Debug bool // generate performance metrics? Flamegraph bool // Volumes are used to mount directories in Docker Volumes []string // Timeout specifies an optional maximum duration the CLI will run an update. // If Timeout is <= 0 it will never time out. Timeout time.Duration // ExtraHosts adds /etc/hosts entries to the proxy for testing. ExtraHosts []string // UpdaterImage is the image to use for the updater UpdaterImage string // ProxyImage is the image to use for the proxy ProxyImage string // CollectorImage is the image to use for the OpenTelemetry collector CollectorImage string // CollectorConfigPath is the path to the OpenTelemetry collector configuration file CollectorConfigPath string // Writer is where API calls will be written to Writer io.Writer InputName string InputRaw []byte ApiUrl string }
type Updater ¶
type Updater struct { // ExitCode is set once an Updater command has completed. ExitCode *int // contains filtered or unexported fields }
func NewUpdater ¶
func NewUpdater(ctx context.Context, cli *client.Client, net *Networks, params *RunParams, prox *Proxy, collector *Collector) (*Updater, error)
NewUpdater starts the update container interactively running /bin/sh, so it does not stop.
func (*Updater) Close ¶
Close kills and deletes the container and deletes updater mount paths related to the run.
func (*Updater) RunCmd ¶ added in v1.22.0
RunCmd executes the update scripts as the dependabot user, blocks until complete.
Click to show internal directories.
Click to hide internal directories.