Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hooks",
"version": "0.7.0",
"version": "0.7.1",
"description": "Three projects are included - k8s: a kubernetes hook implementation that spins up pods dynamically to run a job - docker: A hook implementation of the runner's docker implementation - A hook lib, which contains shared typescript definitions and utilities that the other packages consume",
"main": "",
"directories": {
Expand Down
7 changes: 3 additions & 4 deletions packages/docker/src/dockerCommands/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,17 +314,16 @@ export async function getContainerEnvValue(
}

export async function registryLogin(registry?: Registry): Promise<string> {
const configLocation =
env.DOCKER_CONFIG || `${env.RUNNER_TEMP}/.docker_${uuidv4()}`
// if registry credentials are not provided, skip login and return default docker config location
if (!registry) {
return env.DOCKER_CONFIG || `${env.HOME}/.docker`
return configLocation
}
const credentials = {
username: registry.username,
password: registry.password
}

const configLocation = `${env.RUNNER_TEMP}/.docker_${uuidv4()}`
fs.mkdirSync(configLocation)
try {
await dockerLogin(configLocation, registry.serverUrl, credentials)
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion releaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Features

- conditionally skip docker login step to fallback on default docker config if no registry credentials are provided
- always run docker login and use env-provided docker config location

<!-- ## Bugs -->

Expand Down
Loading