Setting to control "transparent init" behavior #8664
Labels
area/init
kind/friction
Issues causing user pain that do not have a workaround
priority/p2
May take a couple of releases
Executing various skaffold subcommands (
skaffold run
, etc.) in the wrong directory will invoke the "transparent init" behavior. (proposed in #1273, implemented in #5186) This feature can be useful when invoked within a project directory, but also extremely undesirable when not. For example, if a user with a large home directory structure accidentally pastesskaffold run
into their terminal from the base of their home directory (wrong terminal, mistaken working directory, etc.), this will trigger an init scan of their home directory that is unexpected and in some cases time consuming. This init can sometimes be difficult to break out of with ctrl-c.It is a given that software need not adhere to the principle of least astonishment to the point of inconvenience, but ignoring it should not result in inconvenience or potentially disruptive behaviors by default.
Expected behavior
skaffold init
should not be an unrequested behavior. Some suggestions:transparent-init
for now, since it is consistent with the name used internally to refer to this feature.transparent-init
setting:yes
: The current default. Immediately invokeskaffold init
with no prompting. It should be the default when a terminal is not present, but non-interactive tools should be able to requestno
via the commandline option if it is undesirable. This would maintain backward compatibility with unattended execution that relies on the current default, such as with scripts or VS Code plugins.no
: Fail normally with no prompting. This was the behavior prior to Add transparent init #5186 if I'm not mistaken.ask
: A new mode that I am proposing below. It should be the default when a terminal is present.ask
mode would be new and is intended to be a compromise between the two previous behaviors.ask
should be treated asyes
.skaffold init
, and a message should be printed that drives the user's attention to the existence of the newtransparent-init
option that makes this prompt go away. (by setting the mode toyes
orno
)There is a lot of impact to consider with this change, and the above proposal is intended to be flexible while minimizing the impact to external dependencies. Please offer feedback and alternatives.
Information
Steps to reproduce the behavior
skaffold
that redirects the user intoskaffold init
if a configuration file is not found, such asskaffold run
.The text was updated successfully, but these errors were encountered: