Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions src/commands/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct LoginCommand {
}

/// Transitional for compatibility: this will be removed as part of vendor-neutrality work.
const DEFAULT_DEPLOY_PLUGIN: &str = "cloud";
const DEFAULT_DEPLOY_PLUGIN: &str = "<plugin>";

/// The environment variable for setting the plugin to be used for operations relating
/// to remote hosts. This allows the `spin deploy` and `spin login` shortcuts instead of
Expand Down Expand Up @@ -60,20 +60,15 @@ fn deployment_plugin(cmd: &str) -> anyhow::Result<String> {
match std::env::var(DEPLOY_PLUGIN_ENV) {
Ok(v) => Ok(v),
Err(std::env::VarError::NotPresent) => {
terminal::ceprintln!(terminal::colors::bold_red(), "******** IMPORTANT! ********");
terminal::ceprint!(terminal::colors::bold_red(), "Future breaking change: ");
eprintln!("`spin {cmd}` needs to be told which deployment plugin to use. Either:");
terminal::error!(
"`spin {cmd}` needs to be told which deployment plugin to use. Either:"
);
terminal::step!(
"*",
"Run a plugin command (e.g. `spin {DEFAULT_DEPLOY_PLUGIN} {cmd}`); or"
);
terminal::step!("*", "Set the `{DEPLOY_PLUGIN_ENV}` environment variable.");
eprintln!("For now, Spin will default to the `{DEFAULT_DEPLOY_PLUGIN}` plugin.");
terminal::ceprintln!(
terminal::colors::bold_red(),
"This will be a hard error in a future version."
);
Ok(DEFAULT_DEPLOY_PLUGIN.to_string())
anyhow::bail!("Unable to {cmd}");
}
Err(_) => anyhow::bail!("{DEPLOY_PLUGIN_ENV} was defined but its value could not be read"),
}
Expand Down
5 changes: 1 addition & 4 deletions src/commands/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ fn parse_subcommand(mut cmd: Vec<String>) -> anyhow::Result<(String, Vec<String>
))
}

const PREDEFINED_EXTERNALS: &[(&str, &str)] = &[(
"cloud",
"Commands for publishing applications to the Fermyon Cloud.",
)];
const PREDEFINED_EXTERNALS: &[(&str, &str)] = &[];

pub fn predefined_externals() -> Vec<(String, String)> {
PREDEFINED_EXTERNALS
Expand Down
24 changes: 0 additions & 24 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,30 +1154,6 @@ route = "/..."
Ok(())
}

// TODO: Test on Windows
#[cfg(not(target_os = "windows"))]
#[test]
fn test_cloud_plugin_autoinstall() -> anyhow::Result<()> {
let env = test_environment::TestEnvironment::<()>::boot(ServicesConfig::none())?;

let mut login = std::process::Command::new(spin_binary());
login
.args(["login", "--help"])
// Ensure that spin installs the plugins into the temporary directory
.env("SPIN_DATA_DIR", "./plugins");
let output = env.run_in(&mut login)?;

// Verify plugin successfully wrote to output file
assert!(std::str::from_utf8(&output.stdout)?
.trim()
.contains("The `cloud` plugin is required. Installing now."));
// Ensure login help info is displayed
assert!(std::str::from_utf8(&output.stdout)?
.trim()
.contains("Log into Fermyon Cloud"));
Ok(())
}

#[test]
fn test_build_command() -> anyhow::Result<()> {
do_test_build_command("tests/testcases/simple-build")
Expand Down