flipt-io / cup

Git Contribution Automation
https://cup.flipt.io
Apache License 2.0
76 stars 1 forks source link

Implement WASI Controller Put #5

Closed GeorgeMac closed 1 year ago

GeorgeMac commented 1 year ago

Supports #2

This issue tracks implementing the Put function for the WASM/WASI Controller.

The role of this function is to invoke the put <kind> over the wasm binary for the provided FS mounted at root.

The controller needs to:

  1. Build a wazero execution environment with the target FS mounted at /
  2. Validate the proposed resource matches the desired resource definition schema
  3. Invoke the wasm binary with the arguments ["put", kind] and the desired resource marshalled on STDIN
func (*Controller) Put(context.Context, *PutRequest) error { /**/ }

Success

The Controller can adjust the state of the described target filesystem based on the new state of the request resource.