wasmCloud / wadm

wasmCloud Application Deployment Manager (wadm) is a Wasm-native orchestrator for managing and scaling declarative wasmCloud applications.
https://wasmcloud.com
Apache License 2.0
108 stars 28 forks source link

[Bug]: wasm-types manifesh doesnt match with what is expected by wadm. #414

Closed ritesh089 closed 2 months ago

ritesh089 commented 2 months ago

Currently , Link property struct is defined as :

pub struct LinkProperty {
    /// WIT namespace for the link
    pub namespace: String,
    /// WIT package for the link
    pub package: String,
    /// WIT interfaces for the link
    pub interfaces: Vec<String>,
    /// Configuration to apply to the source of the link
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<ConfigDefinition>,
    /// Configuration to apply to the target of the link
    pub target: TargetConfig,
    /// The name of this link
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    #[serde(default, skip_serializing)]
    #[deprecated(since = "0.13.0")]
    pub source_config: Option<Vec<ConfigProperty>>,

    #[serde(default, skip_serializing)]
    #[deprecated(since = "0.13.0")]
    pub target_config: Option<Vec<ConfigProperty>>,
}

But WADM requires target to be a string :

 - type: link
          properties:
            target: http-component
            namespace: wasi
            package: http
            interfaces: [incoming-handler]
brooksmtownsend commented 2 months ago

@ritesh089 this is actually by design, since we've moved to the new format of

target:
  name: <name>

instead of just a String name. You can see below in the custom deserialize code how we're converting the older format to thew new https://github.com/wasmCloud/wadm/blob/main/crates/wadm-types/src/lib.rs#L432

ritesh089 commented 2 months ago

Thank you. Closing the issue .