Skip to content

Commit fdd0336

Browse files
committed
check if key not empty
1 parent 5473892 commit fdd0336

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

internal/kubernetes.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ func (exporter *Exporter) parseAllKubeSecrets() ([]*certificateRef, []error) {
4646
}
4747

4848
for _, secret := range secrets {
49-
output = append(output, &certificateRef{
50-
path: fmt.Sprintf("k8s/%s/%s", namespace, secret.GetName()),
51-
format: certificateFormatKubeSecret,
52-
kubeSecret: secret,
53-
kubeSecretKey: typeAndKey[1],
54-
})
49+
if len(secret.Data[typeAndKey[1]]) > 0 {
50+
output = append(output, &certificateRef{
51+
path: fmt.Sprintf("k8s/%s/%s", namespace, secret.GetName()),
52+
format: certificateFormatKubeSecret,
53+
kubeSecret: secret,
54+
kubeSecretKey: typeAndKey[1],
55+
})
56+
}
5557
}
5658
}
5759
}

0 commit comments

Comments
 (0)