Skip to content

Commit f50d358

Browse files
author
Oleg Sucharevich
committed
fix a bug when service account not been found cause index out of range error
1 parent a93eba3 commit f50d358

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.1.4
1+
1.1.5

pkg/kubernetes/kubernetes.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ func goOverContext(options *getOverContextOptions) error {
7777
options.logger.Warn(message)
7878
return e
7979
}
80+
if sa == nil {
81+
message := fmt.Sprintf("Service account: %s not found in namespace: %s", options.serviceaccount, options.namespace)
82+
options.logger.Warn(message)
83+
return fmt.Errorf(message)
84+
}
8085
secretName := string(sa.Secrets[0].Name)
8186
namespace := sa.Namespace
8287
options.logger.WithFields(log.Fields{

0 commit comments

Comments
 (0)