Pantavisor 019 Features: Status Goal

Modifying the Status Goal of a Container

Let us get back to our previous example and go to the cloned checkout of our device:

cd home_rpi64_latest
ls

In there, we will find the container container-ready-demo that we just installed with pvr. Inside the container-ready-demo container, we will find the src.json and the run.json files. The first one will be used by pvr, while the second one will be parsed by Pantavisor itself. Let us first take a look at the configured status goal in the run.json first:

$ jq .status_goal container-ready-demo/run.json 
"READY"

As we can see, pvr app add has set that status_goal from the one we last set with the --status-goal option. If we want to change that without having to reinstall the container, we have to do it in the src.json, as run.json is not meant to be directly edited:

$ jq .args.PV_STATUS_GOAL container-ready-demo/src.json 
"READY"

And manually edit it to look like this:

$ jq .args.PV_STATUS_GOAL container-ready-demo/src.json 
"STARTED"

Now, if we use the pvr app install command:

pvr app install container-ready-demo

The pvr tool will take the value from the src.json file and apply it at the run.json:

$ jq .status_goal container-ready-demo/run.json 
"STARTED"

Now, again, you can commit and post the changes to start using them in your device:

pvr add .
pvr commit
pvr post -m "change container-ready-demo status goal to STARTED"