Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix owner issues with app create #4537

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from 1 commit
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
17 changes: 4 additions & 13 deletions lib/cli/src/commands/app/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ struct AppCreator {

struct AppCreatorOutput {
app: AppConfigV1,
pkg: StringWebcIdent,
api_pkg: Option<Package>,
local_package: Option<(PathBuf, wasmer_toml::Manifest)>,
}
Expand All @@ -138,12 +137,6 @@ impl AppCreator {
let outer_pkg_name =
crate::utils::prompts::prompt_for_ident("Package name", Some(&default_name))?;
let outer_pkg_full_name = format!("{}/{}", self.owner, outer_pkg_name);
let outer_pkg = StringWebcIdent(edge_schema::schema::WebcIdent {
repository: None,
namespace: self.owner.clone(),
name: outer_pkg_name.clone(),
tag: None,
});

eprintln!("What should be the name of the app?");

Expand Down Expand Up @@ -219,7 +212,6 @@ impl AppCreator {

Ok(AppCreatorOutput {
app: app_cfg,
pkg: outer_pkg,
api_pkg: None,
local_package: Some((self.dir, manifest)),
})
Expand Down Expand Up @@ -340,7 +332,7 @@ impl AppCreator {
// TODO: check if name already exists.
let cfg = AppConfigV1 {
app_id: None,
owner: None,
owner: Some(self.owner.clone()),
volumes: None,
name,
env: Default::default(),
Expand All @@ -360,7 +352,6 @@ impl AppCreator {
Ok(AppCreatorOutput {
app: cfg,
api_pkg,
pkg,
local_package,
})
}
Expand Down Expand Up @@ -490,7 +481,7 @@ impl AsyncCliCommand for CmdAppCreate {
type_,
interactive,
dir: base_dir,
owner,
owner: owner.clone(),
api,
user,
local_package,
Expand All @@ -507,8 +498,8 @@ impl AsyncCliCommand for CmdAppCreate {
let AppCreatorOutput {
app: cfg,
api_pkg,
pkg,
local_package,
..
} = output;

let deploy_now = if self.offline {
Expand Down Expand Up @@ -559,7 +550,7 @@ impl AsyncCliCommand for CmdAppCreate {
original_config: None,
allow_create: true,
make_default: true,
owner: Some(pkg.0.namespace.clone()),
owner: Some(owner.clone()),
wait: wait_mode,
};
let (_app, app_version) = deploy_app_verbose(&api, opts).await?;
Expand Down
Loading