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

feat: Use wadm-client and wadm-types crates for wadm interactions #38

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

joonas
Copy link
Member

@joonas joonas commented Jun 7, 2024

Feature or Problem

Switching us from using wash-lib to the newly available wadm-client and wadm-types crates instead, which cleans things up nicely!

cc @thomastaylor312

Related Issues

Release Information

Consumer Impact

Testing

Unit Test(s)

Acceptance or Integration

Manual Verification

@joonas joonas requested a review from protochron June 7, 2024 23:41
Comment on lines +275 to +276
let wadm_client =
WadmClient::from_nats_client(&lattice_id, None, watcher.nats_client.clone());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't necessarily love this, having to instantiate a new wadm_client::Client each time we reconcile, maybe it should be possible to do something like .set_lattice(...) with the wadm_client::Client to switch between them, since all that currently does is generate different subjects for the various endpoints

Copy link
Contributor

@thomastaylor312 thomastaylor312 Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a code perspective, there really isn't a ton of overhead since it is just storing the nats client (which is a shallow clone) and the lattice string, but if there is an improvement to the client you need, let me know

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I thinking it would be nice to store a WadmClient instance instead of the async_nats::Client in the Watcher since it isn't interacting with anything other than wadm in this case, which having the ability to swap between lattices would enable.

I'm not pressed either way, it felt like not having to recreate the WadmClient every time you want to operate on a different lattice could be a nice improvement from usability perspective

Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothin' but nits

src/resources/application.rs Outdated Show resolved Hide resolved
src/resources/application.rs Outdated Show resolved Hide resolved
src/resources/application.rs Outdated Show resolved Hide resolved
@joonas joonas force-pushed the feat/use-wadm-client-and-types-crates branch from b97c924 to ebe0c71 Compare June 12, 2024 23:28
Signed-off-by: Joonas Bergius <joonas@cosmonic.com>
@joonas joonas force-pushed the feat/use-wadm-client-and-types-crates branch from ebe0c71 to b1d8881 Compare June 27, 2024 15:16
@joonas joonas merged commit 7dcb409 into wasmCloud:main Jun 27, 2024
5 checks passed
@joonas joonas deleted the feat/use-wadm-client-and-types-crates branch June 27, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants