{"record":{"id":"d6e8c5f2b85cc5f5","repo":"kubernetes/kubernetes","slug":"won-t-proceed-the-user-didn-t-answer-y-y-in-ord","errorCode":null,"errorMessage":"won't proceed; the user didn't answer (Y|y) in order to continue","messagePattern":"won't proceed; the user didn't answer \\(Y\\|y\\) in order to continue","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/kubeadm/app/cmd/util/cmdutil.go","lineNumber":111,"sourceCode":"\t\tcriSocket, options.NodeCRISocket, *criSocket,\n\t\t\"Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.\",\n\t)\n}\n\n// InteractivelyConfirmAction asks the user whether they _really_ want to take the action.\nfunc InteractivelyConfirmAction(action, question string, r io.Reader) error {\n\tfmt.Printf(\"[%s] %s [y/N]: \", action, question)\n\tscanner := bufio.NewScanner(r)\n\tscanner.Scan()\n\tif err := scanner.Err(); err != nil {\n\t\treturn errors.Wrap(err, \"couldn't read from standard input\")\n\t}\n\tanswer := scanner.Text()\n\tif strings.EqualFold(answer, \"y\") || strings.EqualFold(answer, \"yes\") {\n\t\treturn nil\n\t}\n\n\treturn errors.New(\"won't proceed; the user didn't answer (Y|y) in order to continue\")\n}\n\n// ValueFromFlagsOrConfig checks if the \"name\" flag has been set. If yes, it returns the value of the flag, otherwise it returns the value from config.\nfunc ValueFromFlagsOrConfig(flagSet *pflag.FlagSet, name string, cfgValue interface{}, flagValue interface{}) interface{} {\n\tif flagSet.Changed(name) {\n\t\treturn flagValue\n\t}\n\n\t// covert the nil to false if this is a bool, this will help to get rid of nil dereference error.\n\tcfg, ok := cfgValue.(*bool)\n\tif ok && cfg == nil {\n\t\treturn ptr.To(false)\n\t}\n\n\t// assume config has all the defaults set correctly.\n\treturn cfgValue\n}\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/kubernetes/kubernetes/blob/b882c60b4023bdf09264c2d5d30a2cadebc240fb/cmd/kubeadm/app/cmd/util/cmdutil.go#L93-L129","documentation":"Returned by `InteractivelyConfirmAction` (cmdutil.go:99-112) when the user's response to the `[action] question [y/N]:` prompt is not `y` or `yes` (case-insensitive). This is the deliberate safety gate for destructive operations like `kubeadm reset`.","triggerScenarios":"Any kubeadm command that calls `InteractivelyConfirmAction` (reset, certain init/upgrade confirmations) where stdin receives anything other than `y`/`yes` — including `n`, empty input, EOF, or piped non-affirmative content.","commonSituations":"Operators pressing Enter (empty = default N), typing `no`, or piping a script's stdout into kubeadm's stdin that does not contain `y`. Also when running kubeadm non-interactively without `--yes`/`-y`/`--force` so stdin is a TTY returning EOF.","solutions":["Answer the prompt with `y` or `yes`.","Pass the non-interactive confirm flag for the command (e.g. `kubeadm reset --yes` or `--force`, depending on the subcommand) to skip the prompt.","Pipe an affirmative: `echo y | kubeadm reset` (only in trusted automation)."],"exampleFix":"# before\nkubeadm reset   # then press Enter at prompt\n# after\nkubeadm reset --yes","handlingStrategy":"validation","validationCode":"// in non-interactive runs, pass the confirm flag and skip InteractivelyConfirmAction\nif nonInteractive {\n    // use --yes / --force instead of relying on stdin\n} else {\n    // ensure stdin will receive 'y'\n}","typeGuard":"func isAffirmative(answer string) bool {\n\ta := strings.ToLower(strings.TrimSpace(answer))\n\treturn a == \"y\" || a == \"yes\"\n}","tryCatchPattern":null,"preventionTips":["Pass --yes / --force in CI and scripts to avoid stdin dependence.","Document that empty input defaults to No.","When piping, guarantee an affirmative 'y' is the first stdin line."],"tags":["kubeadm","cli","interactive","confirmation","user-input"],"analyzedSha":"b882c60b4023bdf09264c2d5d30a2cadebc240fb","analyzedAt":"2026-08-07T04:07:48.144Z","schemaVersion":2},"datasetVersion":"2026-08-07T07:17:06.508Z"}