Skip to content

Commit

Permalink
fix: add http env to workers execution
Browse files Browse the repository at this point in the history
This commit adds:
yggdrasil proxy related env variable when starts the worker.
How to send data messages to echo workers added in HACKING file.

Signed-off-by: Alba Hita Catala <ahitacat@redhat.com>
  • Loading branch information
ahitacat committed Nov 15, 2023
1 parent b75da0d commit c114022
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export CONSUMER_ID=$(openssl x509 -in cert.pem -subject -nocert | cut -f3 -d" ")
mosquitto_pub --host 127.0.0.1 --port 1883 --topic "yggdrasil/${CONSUMER_ID}/control/in" --message "{\"type\":\"command\",\"message_id\":\"$(uuidgen | tr -d '\n')\",\"version\":1,\"sent\":\"$(date --iso-8601=seconds --utc | tr -d '\n')\",\"content\":{\"command\":\"ping\"}}"
```

Send a data message to `echo worker`
```
mosquitto_pub --host 127.0.0.1 --port 1883 --topic yggdrasil/${CONSUMER_ID}/data/in --message "{\"type\":\"data\",\"message_id\":\"$(uuidgen | tr -d '\n')\", \"response_to\":\" \",\"version\":1,\"sent\":\"$(date --iso-8601=seconds --utc | tr -d '\n')\",\"directive\":\"echo\",\"metadata\":\"{}\",\"content\":{\"hello world\"}}"
```


# Call Graphs

Call graphs can be generated to provide a high-level overview of the
Expand Down
5 changes: 5 additions & 0 deletions cmd/yggd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ func main() {
env := []string{
"YGG_SOCKET_ADDR=unix:" + c.String("socket-addr"),
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"http_proxy=" + os.Getenv("http_proxy"),
"https_proxy=" + os.Getenv("https_proxy"),
"HTTPS_PROXY=" + os.Getenv("HTTPS_PROXY"),
"no_proxy=" + os.Getenv("no_proxy"),
"NO_PROXY=" + os.Getenv("NO_PROXY"),
}
for _, info := range fileInfos {
if strings.HasSuffix(info.Name(), "worker") {
Expand Down

0 comments on commit c114022

Please sign in to comment.