Open github-actions[bot] opened 2 years ago
add real dry run support
https://github.com/pacoxu/kubeadm-operator/blob/8bc13edcc9b7da9cbe29d14fbadfc03349d3df6d/commands/kubeadm_upgrade_apply.go#L32
import ( "fmt" "strings" "github.com/go-logr/logr" "github.com/pkg/errors" operatorv1 "k8s.io/kubeadm/operator/api/v1alpha1" ) // runKubeadmUpgradeApply runs the kubeadm upgrade apply command func runKubeadmUpgradeApply(spec *operatorv1.KubeadmUpgradeApplyCommandSpec, log logr.Logger) error { var cmd *cmd // TODO: add real dry run support cmd = newCmd("kubeadm", "upgrade", "apply", spec.KubernetesVersion, "--yes", "--v=4") if spec.DryRun { cmd = newCmd("kubeadm", "upgrade", "apply", spec.KubernetesVersion, "--yes", "--dry-run", "--v=4") } lines, err := cmd.RunAndCapture() if err != nil { log.Error(err, "kubeadm upgrade apply failed", strings.Join(lines, "\n")) return errors.WithStack(errors.WithMessage(err, strings.Join(lines, "\n"))) } log.Info(fmt.Sprintf("%s", strings.Join(lines, "\n"))) return nil } ndex 5f59a43..bb89918 100644 ++ b/config/crd/bases/operator.kubeadm.x-k8s.io_operations.yaml
7277cee350b74297c311eb83e67e2a2420c956c7
add real dry run support
https://github.com/pacoxu/kubeadm-operator/blob/8bc13edcc9b7da9cbe29d14fbadfc03349d3df6d/commands/kubeadm_upgrade_apply.go#L32
7277cee350b74297c311eb83e67e2a2420c956c7