Skip to content

Commit 67cfe9e

Browse files
authored
Merge pull request #70 from s04/fix/robot-empty-credentials
fix: Return nil robot client when credentials are empty
2 parents 62eaaca + 50f1f79 commit 67cfe9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/robot/client/cache/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ func NewCachedRobotClient(rootDir string, httpClient *http.Client, baseURL strin
7272
if err != nil {
7373
return nil, fmt.Errorf("%s: %w", op, err)
7474
}
75+
if robotUser == "" || robotPassword == "" {
76+
klog.Infof("Hetzner robot is not supported because of insufficient credentials: credentials file exists but username or password is empty")
77+
return nil, nil
78+
}
7579
}
7680
c := hrobot.NewBasicAuthClientWithCustomHttpClient(robotUser, robotPassword, httpClient)
7781
if baseURL != "" {

0 commit comments

Comments
 (0)