diff --git a/pkg/store/kubeconfig_store_vault.go b/pkg/store/kubeconfig_store_vault.go index 16be73eb..6f59d115 100644 --- a/pkg/store/kubeconfig_store_vault.go +++ b/pkg/store/kubeconfig_store_vault.go @@ -299,6 +299,10 @@ func (s *VaultStore) GetKubeconfigForPath(path string, _ map[string]string) ([]b if err != nil { return nil, fmt.Errorf("cannot read kubeconfig from %q: %v", secretsPath, err) } + if len(bytes) == 0 { + s.Logger.Debugf("vault: data is empty from %q", secretsPath) + return nil, fmt.Errorf("kubeconfig is empty from %q", secretsPath) + } return bytes, nil } }