Skip to content

Commit 770eb2c

Browse files
authored
Merge pull request kubernetes#94871 from neolit123/1.20-kubeadm-remove-experimental-kustomize
kubeadm: remove the --experimental-kustomize feature
2 parents b58777e + a87eb55 commit 770eb2c

35 files changed

+32
-1251
lines changed

cmd/kubeadm/app/apis/kubeadm/validation/validation.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ func isAllowedFlag(flagName string) bool {
462462
kubeadmcmdoptions.NodeCRISocket,
463463
kubeadmcmdoptions.KubeconfigDir,
464464
kubeadmcmdoptions.UploadCerts,
465-
kubeadmcmdoptions.Kustomize,
466465
kubeadmcmdoptions.Patches,
467466
"print-join-command", "rootfs", "v")
468467
if knownFlags.Has(flagName) {

cmd/kubeadm/app/cmd/init.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ type initOptions struct {
102102
externalClusterCfg *kubeadmapiv1beta2.ClusterConfiguration
103103
uploadCerts bool
104104
skipCertificateKeyPrint bool
105-
kustomizeDir string
106105
patchesDir string
107106
}
108107

@@ -125,7 +124,6 @@ type initData struct {
125124
outputWriter io.Writer
126125
uploadCerts bool
127126
skipCertificateKeyPrint bool
128-
kustomizeDir string
129127
patchesDir string
130128
}
131129

@@ -282,7 +280,6 @@ func AddInitOtherFlags(flagSet *flag.FlagSet, initOptions *initOptions) {
282280
&initOptions.skipCertificateKeyPrint, options.SkipCertificateKeyPrint, initOptions.skipCertificateKeyPrint,
283281
"Don't print the key used to encrypt the control-plane certificates.",
284282
)
285-
options.AddKustomizePodsFlag(flagSet, &initOptions.kustomizeDir)
286283
options.AddPatchesFlag(flagSet, &initOptions.patchesDir)
287284
}
288285

@@ -419,7 +416,6 @@ func newInitData(cmd *cobra.Command, args []string, options *initOptions, out io
419416
outputWriter: out,
420417
uploadCerts: options.uploadCerts,
421418
skipCertificateKeyPrint: options.skipCertificateKeyPrint,
422-
kustomizeDir: options.kustomizeDir,
423419
patchesDir: options.patchesDir,
424420
}, nil
425421
}
@@ -553,11 +549,6 @@ func (d *initData) Tokens() []string {
553549
return tokens
554550
}
555551

556-
// KustomizeDir returns the folder where kustomize patches for static pod manifest are stored
557-
func (d *initData) KustomizeDir() string {
558-
return d.kustomizeDir
559-
}
560-
561552
// PatchesDir returns the folder where patches for components are stored
562553
func (d *initData) PatchesDir() string {
563554
return d.patchesDir

cmd/kubeadm/app/cmd/join.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ type joinOptions struct {
129129
ignorePreflightErrors []string
130130
externalcfg *kubeadmapiv1beta2.JoinConfiguration
131131
joinControlPlane *kubeadmapiv1beta2.JoinControlPlane
132-
kustomizeDir string
133132
patchesDir string
134133
}
135134

@@ -145,7 +144,6 @@ type joinData struct {
145144
clientSet *clientset.Clientset
146145
ignorePreflightErrors sets.String
147146
outputWriter io.Writer
148-
kustomizeDir string
149147
patchesDir string
150148
}
151149

@@ -287,7 +285,6 @@ func addJoinOtherFlags(flagSet *flag.FlagSet, joinOptions *joinOptions) {
287285
&joinOptions.controlPlane, options.ControlPlane, joinOptions.controlPlane,
288286
"Create a new control plane instance on this node",
289287
)
290-
options.AddKustomizePodsFlag(flagSet, &joinOptions.kustomizeDir)
291288
options.AddPatchesFlag(flagSet, &joinOptions.patchesDir)
292289
}
293290

@@ -443,7 +440,6 @@ func newJoinData(cmd *cobra.Command, args []string, opt *joinOptions, out io.Wri
443440
tlsBootstrapCfg: tlsBootstrapCfg,
444441
ignorePreflightErrors: ignorePreflightErrorsSet,
445442
outputWriter: out,
446-
kustomizeDir: opt.kustomizeDir,
447443
patchesDir: opt.patchesDir,
448444
}, nil
449445
}
@@ -510,11 +506,6 @@ func (j *joinData) OutputWriter() io.Writer {
510506
return j.outputWriter
511507
}
512508

513-
// KustomizeDir returns the folder where kustomize patches for static pod manifest are stored
514-
func (j *joinData) KustomizeDir() string {
515-
return j.kustomizeDir
516-
}
517-
518509
// PatchesDir returns the folder where patches for components are stored
519510
func (j *joinData) PatchesDir() string {
520511
return j.patchesDir

cmd/kubeadm/app/cmd/options/constant.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ const (
143143
// EtcdUpgrade flag instruct kubeadm to execute etcd upgrade during upgrades
144144
EtcdUpgrade = "etcd-upgrade"
145145

146-
// Kustomize flag sets the folder where kustomize patches for static pod manifest are stored
147-
Kustomize = "experimental-kustomize"
148-
149146
// Patches flag sets the folder where kubeadm component patches are stored
150147
Patches = "experimental-patches"
151148
)

cmd/kubeadm/app/cmd/options/generic.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package options
1818

1919
import (
20-
"fmt"
2120
"strings"
2221

2322
"github.com/spf13/pflag"
@@ -90,12 +89,6 @@ func AddKubeadmOtherFlags(flagSet *pflag.FlagSet, rootfsPath *string) {
9089
)
9190
}
9291

93-
// AddKustomizePodsFlag adds the --kustomize flag to the given flagset
94-
func AddKustomizePodsFlag(fs *pflag.FlagSet, kustomizeDir *string) {
95-
fs.StringVarP(kustomizeDir, Kustomize, "k", *kustomizeDir, "The path where kustomize patches for static pod manifests are stored.")
96-
fs.MarkDeprecated(Kustomize, fmt.Sprintf("This flag is deprecated and will be removed in a future version. Please use %s instead.", Patches))
97-
}
98-
9992
// AddPatchesFlag adds the --patches flag to the given flagset
10093
func AddPatchesFlag(fs *pflag.FlagSet, patchesDir *string) {
10194
fs.StringVar(patchesDir, Patches, *patchesDir, `Path to a directory that contains files named `+

cmd/kubeadm/app/cmd/phases/init/controlplane.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ func getControlPlanePhaseFlags(name string) []string {
100100
options.CertificatesDir,
101101
options.KubernetesVersion,
102102
options.ImageRepository,
103-
options.Kustomize,
104103
}
105104
if name == "all" || name == kubeadmconstants.KubeAPIServer {
106105
flags = append(flags,
@@ -145,6 +144,6 @@ func runControlPlaneSubphase(component string) func(c workflow.RunData) error {
145144
cfg := data.Cfg()
146145

147146
fmt.Printf("[control-plane] Creating static Pod manifest for %q\n", component)
148-
return controlplane.CreateStaticPodFiles(data.ManifestDir(), data.KustomizeDir(), data.PatchesDir(), &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint, component)
147+
return controlplane.CreateStaticPodFiles(data.ManifestDir(), data.PatchesDir(), &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint, component)
149148
}
150149
}

cmd/kubeadm/app/cmd/phases/init/data.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,5 @@ type InitData interface {
4545
OutputWriter() io.Writer
4646
Client() (clientset.Interface, error)
4747
Tokens() []string
48-
KustomizeDir() string
4948
PatchesDir() string
5049
}

cmd/kubeadm/app/cmd/phases/init/data_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ func (t *testInitData) ExternalCA() bool { return false }
4848
func (t *testInitData) OutputWriter() io.Writer { return nil }
4949
func (t *testInitData) Client() (clientset.Interface, error) { return nil, nil }
5050
func (t *testInitData) Tokens() []string { return nil }
51-
func (t *testInitData) KustomizeDir() string { return "" }
5251
func (t *testInitData) PatchesDir() string { return "" }

cmd/kubeadm/app/cmd/phases/init/etcd.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ func getEtcdPhaseFlags() []string {
6969
options.CertificatesDir,
7070
options.CfgPath,
7171
options.ImageRepository,
72-
options.Kustomize,
7372
options.Patches,
7473
}
7574
return flags
@@ -95,7 +94,7 @@ func runEtcdPhaseLocal() func(c workflow.RunData) error {
9594
fmt.Printf("[dryrun] Would ensure that %q directory is present\n", cfg.Etcd.Local.DataDir)
9695
}
9796
fmt.Printf("[etcd] Creating static Pod manifest for local etcd in %q\n", data.ManifestDir())
98-
if err := etcdphase.CreateLocalEtcdStaticPodManifestFile(data.ManifestDir(), data.KustomizeDir(), data.PatchesDir(), cfg.NodeRegistration.Name, &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint); err != nil {
97+
if err := etcdphase.CreateLocalEtcdStaticPodManifestFile(data.ManifestDir(), data.PatchesDir(), cfg.NodeRegistration.Name, &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint); err != nil {
9998
return errors.Wrap(err, "error creating local etcd static pod manifest file")
10099
}
101100
} else {

cmd/kubeadm/app/cmd/phases/join/controlplanejoin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func getControlPlaneJoinPhaseFlags(name string) []string {
4444
options.NodeName,
4545
}
4646
if name == "etcd" {
47-
flags = append(flags, options.Kustomize, options.Patches)
47+
flags = append(flags, options.Patches)
4848
}
4949
if name != "mark-control-plane" {
5050
flags = append(flags, options.APIServerAdvertiseAddress)
@@ -147,7 +147,7 @@ func runEtcdPhase(c workflow.RunData) error {
147147
// because it needs two members as majority to agree on the consensus. You will only see this behavior between the time
148148
// etcdctl member add informs the cluster about the new member and the new member successfully establishing a connection to the
149149
// existing one."
150-
if err := etcdphase.CreateStackedEtcdStaticPodManifestFile(client, kubeadmconstants.GetStaticPodDirectory(), data.KustomizeDir(), data.PatchesDir(), cfg.NodeRegistration.Name, &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint); err != nil {
150+
if err := etcdphase.CreateStackedEtcdStaticPodManifestFile(client, kubeadmconstants.GetStaticPodDirectory(), data.PatchesDir(), cfg.NodeRegistration.Name, &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint); err != nil {
151151
return errors.Wrap(err, "error creating local etcd static pod manifest file")
152152
}
153153

0 commit comments

Comments
 (0)