Skip to content

Commit

Permalink
throw an error if the serviceaccount has not link to secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Sucharevich committed Jan 15, 2019
1 parent fe87f21 commit 3723381
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.2
5 changes: 5 additions & 0 deletions pkg/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ func goOverContext(options *getOverContextOptions) error {
options.logger.Warn(message)
return fmt.Errorf(message)
}
if len(sa.Secrets) == 0 {
message := fmt.Sprintf("Service account has no secrect configured for serviceaccount: %s", options.serviceaccount)
options.logger.Warn(message)
return fmt.Errorf(message)
}
secretName := string(sa.Secrets[0].Name)
namespace := sa.Namespace
options.logger.WithFields(log.Fields{
Expand Down

0 comments on commit 3723381

Please sign in to comment.