@@ -38,7 +38,7 @@ type Manifest struct {
38
38
// certs is a map from subject name to CertificateManifest.
39
39
certs map [string ]* CertificateManifest
40
40
41
- // hashes is a map from subject name to hash of CertificateManifest struct.
41
+ // hashes is a map from file name (typically subject name) to hash of CertificateManifest struct.
42
42
// It is stored and read from certyaml's .state file between consequent executions of certyaml.
43
43
hashes map [string ]string
44
44
@@ -107,7 +107,7 @@ func GenerateCertificates(output io.Writer, manifestFile, stateFile, destDir str
107
107
}
108
108
109
109
// Compare hash from state file to hash of the loaded certificate.
110
- hash , ok := m .hashes [c .Subject ]
110
+ hash , ok := m .hashes [c .Filename ]
111
111
if ok && c .GeneratedCert != nil && hash == c .hash () {
112
112
fmt .Fprintf (output , "No changes: skipping %s\n " , c .Filename )
113
113
continue // Continue to next certificate in manifest.
@@ -117,12 +117,12 @@ func GenerateCertificates(output io.Writer, manifestFile, stateFile, destDir str
117
117
// "adopt" the existing certificate like we would have generated it.
118
118
if ! ok && c .GeneratedCert != nil {
119
119
fmt .Fprintf (output , "Recognized existing certificate: skipping %s\n " , c .Filename )
120
- m .hashes [c .Subject ] = c .hash ()
120
+ m .hashes [c .Filename ] = c .hash ()
121
121
continue // Continue to next certificate in manifest.
122
122
}
123
123
124
124
// Store hash of the current state of the certificate.
125
- m .hashes [c .Subject ] = c .hash ()
125
+ m .hashes [c .Filename ] = c .hash ()
126
126
127
127
// Write the certificate and key to data dir.
128
128
certFile := path .Join (m .dataDir , c .Filename + ".pem" )
0 commit comments