Skip to content

Commit

Permalink
uses errors.Is and os.ErrNotExist
Browse files Browse the repository at this point in the history
  • Loading branch information
hyposcaler-bot committed Nov 14, 2024
1 parent 9b0c2a6 commit 38c3675
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions runtime/docker/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ func getDockerConfigPath(configPath string) string {
// with parts of the docker config.
func GetDockerConfig(configPath string) (*DockerConfig, error) {
var dockerConfig DockerConfig
var pathErr *os.PathError

dockerConfigPath := getDockerConfigPath(configPath)

file, err := os.ReadFile(dockerConfigPath)
if err != nil {
if errors.As(err, &pathErr) {
if errors.Is(err, os.ErrNotExist) {
log.Debugf("Could not read docker config: %v", err)
} else {
log.Infof("Could not read docker config: %v", err)
Expand Down

0 comments on commit 38c3675

Please sign in to comment.