From 0ab2406db9b4d5dac2348dd033d5fd37abd92a94 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Thu, 17 Feb 2022 13:28:17 -0500 Subject: [PATCH] engine: Pass through the program version We forgot this in a few places. --- engine/graph/engine.go | 2 ++ engine/graph/state.go | 2 ++ engine/resources.go | 3 +++ gapi/gapi.go | 1 + langpuppet/gapi.go | 2 ++ lib/main.go | 2 ++ 6 files changed, 12 insertions(+) diff --git a/engine/graph/engine.go b/engine/graph/engine.go index 3c6d0cca..eb8076bb 100644 --- a/engine/graph/engine.go +++ b/engine/graph/engine.go @@ -43,6 +43,7 @@ const ( // Engine encapsulates a generic graph and manages its operations. type Engine struct { Program string + Version string Hostname string World engine.World @@ -198,6 +199,7 @@ func (obj *Engine) Commit() error { Vertex: vertex, Program: obj.Program, + Version: obj.Version, Hostname: obj.Hostname, World: obj.World, diff --git a/engine/graph/state.go b/engine/graph/state.go index 7ae37305..0d532bfe 100644 --- a/engine/graph/state.go +++ b/engine/graph/state.go @@ -40,6 +40,7 @@ type State struct { Vertex pgraph.Vertex Program string + Version string Hostname string World engine.World @@ -154,6 +155,7 @@ func (obj *State) Init() error { obj.init = &engine.Init{ Program: obj.Program, + Version: obj.Version, Hostname: obj.Hostname, // Watch: diff --git a/engine/resources.go b/engine/resources.go index 22650fa1..54831899 100644 --- a/engine/resources.go +++ b/engine/resources.go @@ -87,6 +87,9 @@ type Init struct { // Program is the name of the program. Program string + // Version is the version of the program. + Version string + // Hostname is the uuid for the host. Hostname string diff --git a/gapi/gapi.go b/gapi/gapi.go index 044b46a5..24d3e328 100644 --- a/gapi/gapi.go +++ b/gapi/gapi.go @@ -70,6 +70,7 @@ type CliInfo struct { // Data is the set of input values passed into the GAPI structs via Init. type Data struct { Program string // name of the originating program + Version string // version of the originating program Hostname string // uuid for the host, required for GAPI World engine.World Noop bool diff --git a/langpuppet/gapi.go b/langpuppet/gapi.go index 1009dedf..0333858b 100644 --- a/langpuppet/gapi.go +++ b/langpuppet/gapi.go @@ -178,6 +178,7 @@ func (obj *GAPI) Init(data *gapi.Data) error { dataLang := &gapi.Data{ Program: obj.data.Program, + Version: obj.data.Version, Hostname: obj.data.Hostname, World: obj.data.World, Noop: obj.data.Noop, @@ -189,6 +190,7 @@ func (obj *GAPI) Init(data *gapi.Data) error { } dataPuppet := &gapi.Data{ Program: obj.data.Program, + Version: obj.data.Version, Hostname: obj.data.Hostname, World: obj.data.World, Noop: obj.data.Noop, diff --git a/lib/main.go b/lib/main.go index 214bbb93..7816bad0 100644 --- a/lib/main.go +++ b/lib/main.go @@ -490,6 +490,7 @@ func (obj *Main) Run() error { obj.ge = &graph.Engine{ Program: obj.Program, + Version: obj.Version, Hostname: hostname, World: world, Prefix: fmt.Sprintf("%s/", path.Join(prefix, "engine")), @@ -579,6 +580,7 @@ func (obj *Main) Run() error { data := &gapi.Data{ Program: obj.Program, + Version: obj.Version, Hostname: hostname, World: world, Noop: mainDeploy.Noop,