Skip to content

Commit

Permalink
check if key not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
agrevtsev committed Dec 20, 2023
1 parent 5473892 commit fdd0336
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internal/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ func (exporter *Exporter) parseAllKubeSecrets() ([]*certificateRef, []error) {
}

for _, secret := range secrets {
output = append(output, &certificateRef{
path: fmt.Sprintf("k8s/%s/%s", namespace, secret.GetName()),
format: certificateFormatKubeSecret,
kubeSecret: secret,
kubeSecretKey: typeAndKey[1],
})
if len(secret.Data[typeAndKey[1]]) > 0 {
output = append(output, &certificateRef{
path: fmt.Sprintf("k8s/%s/%s", namespace, secret.GetName()),
format: certificateFormatKubeSecret,
kubeSecret: secret,
kubeSecretKey: typeAndKey[1],
})
}
}
}
}
Expand Down

0 comments on commit fdd0336

Please sign in to comment.