diff --git a/Cargo.lock b/Cargo.lock index d29a810..aad31a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,7 +62,7 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "amp-apiserver" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-common", "amp-resources", @@ -89,7 +89,7 @@ dependencies = [ [[package]] name = "amp-builder" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-common", "amp-resources", @@ -103,8 +103,8 @@ dependencies = [ [[package]] name = "amp-common" -version = "0.8.3" -source = "git+https://github.com/amphitheatre-app/common?tag=v0.8.3#9c59e1ed87e2ce67aa10cad6f464b35c823de656" +version = "0.9.0" +source = "git+https://github.com/amphitheatre-app/common?tag=v0.9.0#3221376c736d1101f8aaf410bd6462aae4c207d3" dependencies = [ "anyhow", "chrono", @@ -131,7 +131,7 @@ dependencies = [ [[package]] name = "amp-controllers" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-common", "amp-resources", @@ -152,7 +152,7 @@ dependencies = [ [[package]] name = "amp-crdgen" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-common", "clap", @@ -164,7 +164,7 @@ dependencies = [ [[package]] name = "amp-resolver" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-common", "amp-resources", @@ -177,7 +177,7 @@ dependencies = [ [[package]] name = "amp-resources" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-common", "anyhow", @@ -197,7 +197,7 @@ dependencies = [ [[package]] name = "amp-syncer" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-common", "async-nats", @@ -213,7 +213,7 @@ dependencies = [ [[package]] name = "amp-workflow" -version = "0.8.26" +version = "0.9.0" dependencies = [ "amp-builder", "amp-common", diff --git a/Cargo.toml b/Cargo.toml index d3d4797..759f013 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "0.8.26" +version = "0.9.0" edition = "2021" license = "Apache-2.0" repository = "https://github.com/amphitheatre-app/amphitheatre" @@ -22,7 +22,7 @@ members = [ # https://doc.rust-lang.org/cargo/reference/workspaces.html#the-workspacedependencies-table [workspace.dependencies] amp-builder = { path = "builder" } -amp-common = { git = "https://github.com/amphitheatre-app/common", tag = "v0.8.3" } +amp-common = { git = "https://github.com/amphitheatre-app/common", tag = "v0.9.0" } amp-resolver = { path = "resolver" } amp-resources = { path = "resources" } amp-workflow = { path = "workflow" } diff --git a/resolver/src/errors.rs b/resolver/src/errors.rs index c88b64e..cbcbf40 100644 --- a/resolver/src/errors.rs +++ b/resolver/src/errors.rs @@ -58,6 +58,9 @@ pub enum ResolveError { #[error("SourceNotSet")] SourceNotSet, + + #[error("NameNotSet")] + NameNotSet, } pub type Result = std::result::Result; diff --git a/resolver/src/preface.rs b/resolver/src/preface.rs index 8132b54..1e1a1d2 100644 --- a/resolver/src/preface.rs +++ b/resolver/src/preface.rs @@ -22,10 +22,11 @@ use kube::Client as KubeClient; /// Load manifest from different sources and return the actor spec. pub async fn load(client: &KubeClient, credentials: &Credentials, preface: &Preface) -> Result { if let Some(p) = &preface.registry { + let name = preface.name.as_ref().ok_or(ResolveError::NameNotSet)?; let registry = p.registry.clone().unwrap_or_else(|| "catalog".to_string()); return match registry.as_str() { - "catalog" => load_from_catalog(credentials, &preface.name, &p.version), - "hub" => load_from_cluster(client, &preface.name).await, + "catalog" => load_from_catalog(credentials, name, &p.version), + "hub" => load_from_cluster(client, name).await, x => Err(ResolveError::UnknownCharacterRegistry(x.to_string())), }; }