@@ -32,7 +32,7 @@ var ConfigFolders = []string{httpFolder, secretsFolder}
32
32
// This interface is used for testing purposes only.
33
33
type Generator interface {
34
34
// Generate generates NGINX configuration files from internal representation.
35
- Generate (configuration dataplane.Configuration ) ( []file.File , int )
35
+ Generate (configuration * dataplane.Configuration ) []file.File
36
36
}
37
37
38
38
// GeneratorImpl is an implementation of Generator.
@@ -61,19 +61,20 @@ type executeFunc func(configuration dataplane.Configuration) []byte
61
61
// It is the responsibility of the caller to validate the configuration before calling this function.
62
62
// In case of invalid configuration, NGINX will fail to reload or could be configured with malicious configuration.
63
63
// To validate, use the validators from the validation package.
64
- func (g * GeneratorImpl ) Generate (conf dataplane.Configuration ) ( []file.File , int ) {
64
+ func (g * GeneratorImpl ) Generate (conf * dataplane.Configuration ) []file.File {
65
65
g .configVersion ++
66
+ conf .Version = g .configVersion
66
67
files := make ([]file.File , 0 , len (conf .SSLKeyPairs )+ 1 /* http config */ )
67
68
68
69
for id , pair := range conf .SSLKeyPairs {
69
70
files = append (files , generatePEM (id , pair .Cert , pair .Key ))
70
71
}
71
72
72
- files = append (files , generateHTTPConfig (conf ))
73
+ files = append (files , generateHTTPConfig (* conf ))
73
74
74
75
files = append (files , generateConfigVersion (g .configVersion ))
75
76
76
- return files , g . configVersion
77
+ return files
77
78
}
78
79
79
80
func generatePEM (id dataplane.SSLKeyPairID , cert []byte , key []byte ) file.File {
0 commit comments