mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
Improve dry-run error messages for clarity
This commit is contained in:
@@ -355,7 +355,7 @@ func newInitData(cmd *cobra.Command, args []string, initOptions *initOptions, ou
|
||||
dryRunDir := ""
|
||||
if initOptions.dryRun || cfg.DryRun {
|
||||
if dryRunDir, err = kubeadmconstants.GetDryRunDir(kubeadmconstants.EnvVarInitDryRunDir, "kubeadm-init-dryrun", klog.Warningf); err != nil {
|
||||
return nil, errors.Wrap(err, "could not create a temporary directory")
|
||||
return nil, errors.Wrap(err, "could not create a temporary directory on dryrun")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -467,7 +467,7 @@ func newJoinData(cmd *cobra.Command, args []string, opt *joinOptions, out io.Wri
|
||||
dryRunDir := ""
|
||||
if opt.dryRun || cfg.DryRun {
|
||||
if dryRunDir, err = kubeadmconstants.GetDryRunDir(kubeadmconstants.EnvVarJoinDryRunDir, "kubeadm-join-dryrun", klog.Warningf); err != nil {
|
||||
return nil, errors.Wrap(err, "could not create a temporary directory")
|
||||
return nil, errors.Wrap(err, "could not create a temporary directory on dryrun")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ func newApplyData(cmd *cobra.Command, args []string, applyFlags *applyFlags) (*a
|
||||
dryRunDir := ""
|
||||
if *dryRun {
|
||||
if dryRunDir, err = constants.GetDryRunDir(constants.EnvVarUpgradeDryRunDir, "kubeadm-upgrade-apply-dryrun", klog.Warningf); err != nil {
|
||||
return nil, errors.Wrap(err, "could not create a temporary directory")
|
||||
return nil, errors.Wrap(err, "could not create a temporary directory on dryrun")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ func newNodeData(cmd *cobra.Command, nodeOptions *nodeOptions, out io.Writer) (*
|
||||
dryRunDir := ""
|
||||
if *dryRun {
|
||||
if dryRunDir, err = constants.GetDryRunDir(constants.EnvVarUpgradeDryRunDir, "kubeadm-upgrade-node-dryrun", klog.Warningf); err != nil {
|
||||
return nil, errors.Wrap(err, "couldn't create a temporary directory")
|
||||
return nil, errors.Wrap(err, "couldn't create a temporary directory on dryrun")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user