54
54
csrDir string
55
55
)
56
56
57
- // certsData defines the behavior that a runtime data struct passed to the certs phase should
58
- // have. Please note that we are using an interface in order to make this phase reusable in different workflows
59
- // (and thus with different runtime data struct, all of them requested to be compliant to this interface)
60
- type certsData interface {
61
- Cfg () * kubeadmapi.InitConfiguration
62
- ExternalCA () bool
63
- CertificateDir () string
64
- CertificateWriteDir () string
65
- }
66
-
67
57
// NewCertsPhase returns the phase for the certs
68
58
func NewCertsPhase () workflow.Phase {
69
59
return workflow.Phase {
@@ -193,7 +183,7 @@ func getSANDescription(certSpec *certsphase.KubeadmCert) string {
193
183
}
194
184
195
185
func runCertsSa (c workflow.RunData ) error {
196
- data , ok := c .(certsData )
186
+ data , ok := c .(InitData )
197
187
if ! ok {
198
188
return errors .New ("certs phase invoked with an invalid data struct" )
199
189
}
@@ -209,7 +199,7 @@ func runCertsSa(c workflow.RunData) error {
209
199
}
210
200
211
201
func runCerts (c workflow.RunData ) error {
212
- data , ok := c .(certsData )
202
+ data , ok := c .(InitData )
213
203
if ! ok {
214
204
return errors .New ("certs phase invoked with an invalid data struct" )
215
205
}
@@ -220,7 +210,7 @@ func runCerts(c workflow.RunData) error {
220
210
221
211
func runCAPhase (ca * certsphase.KubeadmCert ) func (c workflow.RunData ) error {
222
212
return func (c workflow.RunData ) error {
223
- data , ok := c .(certsData )
213
+ data , ok := c .(InitData )
224
214
if ! ok {
225
215
return errors .New ("certs phase invoked with an invalid data struct" )
226
216
}
@@ -252,7 +242,7 @@ func runCAPhase(ca *certsphase.KubeadmCert) func(c workflow.RunData) error {
252
242
253
243
func runCertPhase (cert * certsphase.KubeadmCert , caCert * certsphase.KubeadmCert ) func (c workflow.RunData ) error {
254
244
return func (c workflow.RunData ) error {
255
- data , ok := c .(certsData )
245
+ data , ok := c .(InitData )
256
246
if ! ok {
257
247
return errors .New ("certs phase invoked with an invalid data struct" )
258
248
}
0 commit comments