Skip to content

Commit 86e9a13

Browse files
muhammadnnpdgm
authored andcommitted
change naming since passwords can be any password determined by passwords.yml key value (we are using pkcs12: key in this case, more container types can be added later
1 parent d1f6b06 commit 86e9a13

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

internal/certificate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type certificateRef struct {
7070
kubeSecret v1.Secret
7171
kubeConfigMap v1.ConfigMap
7272
kubeSecretKey string
73-
p12Password string
73+
password string
7474

7575
}
7676

@@ -108,7 +108,7 @@ func (cert *certificateRef) parse() error {
108108
case certificateFormatKubeConfigMap:
109109
cert.certificates, err = readAndParseKubeConfigMap(&cert.kubeConfigMap, cert.kubeSecretKey)
110110
case certificateFormatP12:
111-
cert.certificates, err = readAndParsePasswordPkcsFile(cert.path, cert.p12Password)
111+
cert.certificates, err = readAndParsePasswordPkcsFile(cert.path, cert.password)
112112
}
113113
return err
114114
}

internal/exporter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ func (exporter *Exporter) collectMatchingPaths(pattern string, format certificat
259259
continue
260260
}
261261

262-
var p12Password string
262+
var password string
263263
if strings.HasSuffix(file.Name(), ".p12") || strings.HasSuffix(file.Name(), ".jks") {
264264
format = certificateFormatP12
265-
p12Password, err = exporter.obtainP12Passwords(path.Clean(path.Join(dir, file.Name())))
265+
password, err = exporter.obtainP12Passwords(path.Clean(path.Join(dir, file.Name())))
266266
if err != nil {
267267
outputErrors = append(outputErrors, err)
268268
continue
@@ -274,7 +274,7 @@ func (exporter *Exporter) collectMatchingPaths(pattern string, format certificat
274274
output = append(output, &certificateRef{
275275
path: path.Clean(path.Join(dir, file.Name())),
276276
format: format,
277-
p12Password: p12Password,
277+
password: password,
278278
})
279279
}
280280
} else {

0 commit comments

Comments
 (0)