diff --git a/.circleci/config.yml b/.circleci/config.yml index 792840db5b..14e78ff810 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -765,9 +765,9 @@ jobs: false fi - run: - name: "Verify Kurtosis cleaned up all its volumes (except for the log storage and github auth storage volumes)" + name: "Verify Kurtosis cleaned up all its volumes (except for the log storage, github auth storage, docker auth config storage volumes)" command: | - if ! [ $(docker volume ls | grep -v kurtosis-logs-collector-vol | grep -v kurtosis-logs-db-vol | tail -n+2 | wc -l ) -eq 2 ]; then + if ! [ $(docker volume ls | grep -v kurtosis-logs-collector-vol | grep -v kurtosis-logs-db-vol | tail -n+2 | wc -l ) -eq 3 ]; then docker volume ls false fi diff --git a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go index 1f3879d7ff..e956126d92 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go @@ -40,19 +40,27 @@ func loadDockerAuth() (RegistryAuthConfig, error) { if errors.Is(err, os.ErrNotExist) { // If the auth config doesn't exist, return an empty auth config logrus.Debugf("No docker config found at '%s'. Returning empty registry auth config.", configFilePath) - return RegistryAuthConfig{}, nil + return emptyRegistryAuthConfig(), nil } else if err != nil { - return RegistryAuthConfig{}, stacktrace.Propagate(err, "error reading Docker config file at '%s'", configFilePath) + return emptyRegistryAuthConfig(), stacktrace.Propagate(err, "error reading Docker config file at '%s'", configFilePath) } var authConfig RegistryAuthConfig if err := json.Unmarshal(file, &authConfig); err != nil { - return RegistryAuthConfig{}, stacktrace.Propagate(err, "error unmarshalling Docker config file at '%s'", configFilePath) + return emptyRegistryAuthConfig(), stacktrace.Propagate(err, "error unmarshalling Docker config file at '%s'", configFilePath) } return authConfig, nil } +func emptyRegistryAuthConfig() RegistryAuthConfig { + return RegistryAuthConfig{ + Auths: map[string]registry.AuthConfig{}, + CredHelpers: map[string]string{}, + CredsStore: "", + } +} + // getRegistriesFromCredsStore fetches all registries from a Docker credential helper (credStore) func getRegistriesFromCredsStore(credHelper string) ([]string, error) { credHelperCmd := "docker-credential-" + credHelper @@ -105,7 +113,11 @@ func getCredentialsFromStore(credHelper string, registryURL string) (*registry.A Username string `json:"Username"` Secret string `json:"Secret"` ServerURL string `json:"ServerURL"` - }{} + }{ + Username: "", + Secret: "", + ServerURL: "", + } if err := json.Unmarshal(out.Bytes(), &creds); err != nil { return nil, stacktrace.Propagate(err, "error parsing credentials from store")