@@ -99,6 +99,7 @@ type initOptions struct {
99
99
uploadCerts bool
100
100
skipCertificateKeyPrint bool
101
101
kustomizeDir string
102
+ patchesDir string
102
103
}
103
104
104
105
// compile-time assert that the local data object satisfies the phases data interface.
@@ -121,6 +122,7 @@ type initData struct {
121
122
uploadCerts bool
122
123
skipCertificateKeyPrint bool
123
124
kustomizeDir string
125
+ patchesDir string
124
126
}
125
127
126
128
// NewCmdInit returns "kubeadm init" command.
@@ -277,6 +279,7 @@ func AddInitOtherFlags(flagSet *flag.FlagSet, initOptions *initOptions) {
277
279
"Don't print the key used to encrypt the control-plane certificates." ,
278
280
)
279
281
options .AddKustomizePodsFlag (flagSet , & initOptions .kustomizeDir )
282
+ options .AddPatchesFlag (flagSet , & initOptions .patchesDir )
280
283
}
281
284
282
285
// newInitOptions returns a struct ready for being used for creating cmd init flags.
@@ -413,6 +416,7 @@ func newInitData(cmd *cobra.Command, args []string, options *initOptions, out io
413
416
uploadCerts : options .uploadCerts ,
414
417
skipCertificateKeyPrint : options .skipCertificateKeyPrint ,
415
418
kustomizeDir : options .kustomizeDir ,
419
+ patchesDir : options .patchesDir ,
416
420
}, nil
417
421
}
418
422
@@ -550,6 +554,11 @@ func (d *initData) KustomizeDir() string {
550
554
return d .kustomizeDir
551
555
}
552
556
557
+ // PatchesDir returns the folder where patches for components are stored
558
+ func (d * initData ) PatchesDir () string {
559
+ return d .patchesDir
560
+ }
561
+
553
562
func printJoinCommand (out io.Writer , adminKubeConfigPath , token string , i * initData ) error {
554
563
joinControlPlaneCommand , err := cmdutil .GetJoinControlPlaneCommand (adminKubeConfigPath , token , i .CertificateKey (), i .skipTokenPrint , i .skipCertificateKeyPrint )
555
564
if err != nil {
0 commit comments