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

Add Go and Rust client bindings #2389

Open
cgwalters opened this issue Dec 14, 2020 · 3 comments
Open

Add Go and Rust client bindings #2389

cgwalters opened this issue Dec 14, 2020 · 3 comments

Comments

@cgwalters
Copy link
Member

cgwalters commented Dec 14, 2020

Motivated by openshift/machine-config-operator#2302
and the zincati bit in coreos/coreos-assembler#1964

Basically let's create e.g. github.com/coreos/rpm-ostree-client-go and github.com/coreos/rpm-ostree-client-rust bindings that mostly have:

  • A way to deserialize the output of status --json into strongly typed structs (as both the MCD and Zincati do)
  • A simple subprocess invocation API which mostly just invokes rpm-ostree ... with arguments but also kind of requires them to set the RPMOSTREE_CLIENT_ID env var (maybe via a Context struct or so?)

Of course these bindings could directly invoke via DBus too but that greatly increases the scope.

@cgwalters
Copy link
Member Author

@lucab
Copy link
Contributor

lucab commented Dec 15, 2020

Of course these bindings could directly invoke via DBus too but that greatly increases the scope.

That's the route we took with go-systemd and at least on the Go side it is probably a better idea.

On the Rust side, Zincati has a bunch of CLI-parsing methods here, but that's probably good enough for now as there isn't yet a good non-blocking DBus library.

cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Feb 12, 2021
This is intended to be published to https://crates.io/crates/rpmostree-client
Part of coreos#2389

This directly imports the code from
https://github.com/ostreedev/ostree/blob/5551c54c6e6eba8145b95bd3b28223f1941a9e8d/tests/inst/src/rpmostree.rs

Once merged and released I'll try converting the ostree test suite
over as well as Zincati.

Internally add a testutils helper to validate it works.
cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Feb 16, 2021
This is intended to be published to https://crates.io/crates/rpmostree-client
Part of coreos#2389

This directly imports the code from
https://github.com/ostreedev/ostree/blob/5551c54c6e6eba8145b95bd3b28223f1941a9e8d/tests/inst/src/rpmostree.rs

Once merged and released I'll try converting the ostree test suite
over as well as Zincati.

Internally add a testutils helper to validate it works.
cgwalters added a commit to cgwalters/rpm-ostree that referenced this issue Feb 16, 2021
This is intended to be published to https://crates.io/crates/rpmostree-client
Part of coreos#2389

This directly imports the code from
https://github.com/ostreedev/ostree/blob/5551c54c6e6eba8145b95bd3b28223f1941a9e8d/tests/inst/src/rpmostree.rs

Once merged and released I'll try converting the ostree test suite
over as well as Zincati.

Internally add a testutils helper to validate it works.
openshift-merge-robot pushed a commit that referenced this issue Feb 17, 2021
This is intended to be published to https://crates.io/crates/rpmostree-client
Part of #2389

This directly imports the code from
https://github.com/ostreedev/ostree/blob/5551c54c6e6eba8145b95bd3b28223f1941a9e8d/tests/inst/src/rpmostree.rs

Once merged and released I'll try converting the ostree test suite
over as well as Zincati.

Internally add a testutils helper to validate it works.
@cgwalters
Copy link
Member Author

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

No branches or pull requests

2 participants