Skip to content

Commit 3723381

Browse files
author
Oleg Sucharevich
committed
throw an error if the serviceaccount has not link to secret
1 parent fe87f21 commit 3723381

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.1
1+
1.3.2

pkg/kubernetes/kubernetes.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ func goOverContext(options *getOverContextOptions) error {
8181
options.logger.Warn(message)
8282
return fmt.Errorf(message)
8383
}
84+
if len(sa.Secrets) == 0 {
85+
message := fmt.Sprintf("Service account has no secrect configured for serviceaccount: %s", options.serviceaccount)
86+
options.logger.Warn(message)
87+
return fmt.Errorf(message)
88+
}
8489
secretName := string(sa.Secrets[0].Name)
8590
namespace := sa.Namespace
8691
options.logger.WithFields(log.Fields{

0 commit comments

Comments
 (0)