Skip to content

Commit

Permalink
adjust enclave continuity ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Oct 29, 2024
1 parent 4f923a5 commit f63af84
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit f63af84

Please sign in to comment.