mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Merge pull request #127315 from neolit123/1.32-remove-deprecated-upgrade-flags
kubeadm: add default paths to 'upgrade diff'
This commit is contained in:
commit
7ad1eaa66b
@ -57,8 +57,11 @@ type diffFlags struct {
|
|||||||
// newCmdDiff returns the cobra command for `kubeadm upgrade diff`
|
// newCmdDiff returns the cobra command for `kubeadm upgrade diff`
|
||||||
func newCmdDiff(out io.Writer) *cobra.Command {
|
func newCmdDiff(out io.Writer) *cobra.Command {
|
||||||
flags := &diffFlags{
|
flags := &diffFlags{
|
||||||
kubeConfigPath: constants.GetAdminKubeConfigPath(),
|
kubeConfigPath: constants.GetAdminKubeConfigPath(),
|
||||||
out: out,
|
out: out,
|
||||||
|
apiServerManifestPath: constants.GetStaticPodFilepath(constants.KubeAPIServer, constants.GetStaticPodDirectory()),
|
||||||
|
controllerManagerManifestPath: constants.GetStaticPodFilepath(constants.KubeControllerManager, constants.GetStaticPodDirectory()),
|
||||||
|
schedulerManifestPath: constants.GetStaticPodFilepath(constants.KubeScheduler, constants.GetStaticPodDirectory()),
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
@ -88,9 +91,6 @@ func newCmdDiff(out io.Writer) *cobra.Command {
|
|||||||
|
|
||||||
func validateManifestsPath(manifests ...string) (err error) {
|
func validateManifestsPath(manifests ...string) (err error) {
|
||||||
for _, manifestPath := range manifests {
|
for _, manifestPath := range manifests {
|
||||||
if len(manifestPath) == 0 {
|
|
||||||
return errors.New("empty manifest path")
|
|
||||||
}
|
|
||||||
s, err := os.Stat(manifestPath)
|
s, err := os.Stat(manifestPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
|
@ -113,13 +113,6 @@ diff:
|
|||||||
cfgPath: "missing-path-to-a-config",
|
cfgPath: "missing-path-to-a-config",
|
||||||
expectedError: true,
|
expectedError: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "invalid: valid config but empty manifest path",
|
|
||||||
cfgPath: testUpgradeDiffConfig,
|
|
||||||
setManifestPath: true,
|
|
||||||
manifestPath: "",
|
|
||||||
expectedError: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "invalid: valid config but bad manifest path",
|
name: "invalid: valid config but bad manifest path",
|
||||||
cfgPath: testUpgradeDiffConfig,
|
cfgPath: testUpgradeDiffConfig,
|
||||||
|
Loading…
Reference in New Issue
Block a user