Skip to content

Commit

Permalink
Merge pull request #215 from itowlson/no-deps
Browse files Browse the repository at this point in the history
Enable dependencies in cloud
  • Loading branch information
itowlson authored Dec 2, 2024
2 parents db9f89c + 49729f6 commit 8f6757d
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ fn validate_cloud_app(app: &DeployableApp) -> Result<()> {
check_safe_app_name(app.name()?)?;
ensure!(!app.components().is_empty(), "No components in spin.toml!");
check_no_duplicate_routes(app)?;
check_no_dependencies(app)?;
Ok(())
}

Expand All @@ -625,25 +624,6 @@ fn check_no_duplicate_routes(app: &DeployableApp) -> Result<()> {
}
}

fn check_no_dependencies(app: &DeployableApp) -> Result<()> {
let dep_messages: Vec<_> = app
.components()
.iter()
.flat_map(|c| {
c.dependencies()
.iter()
.map(|d| format!("- Dependency '{d}' appears in component '{}'", c.name()))
.collect::<Vec<_>>()
})
.collect();

if dep_messages.is_empty() {
Ok(())
} else {
Err(anyhow!("This application uses component dependencies, which are not supported on Fermyon Cloud\n{}", dep_messages.join("\n")))
}
}

#[derive(Clone)]
struct DeployableApp(locked::LockedApp);

Expand Down Expand Up @@ -761,14 +741,6 @@ impl DeployableComponent {
.map(|s| s.to_owned())
.collect()
}

fn dependencies(&self) -> Vec<String> {
self.0.dependencies.keys().map(|n| n.to_string()).collect()
}

fn name(&self) -> &str {
&self.0.id
}
}

fn build_app_base_url(app_domain: &str, cloud_url: &Url) -> Result<Url> {
Expand Down

0 comments on commit 8f6757d

Please sign in to comment.