Skip to content

Commit

Permalink
Merge pull request #177 from MonicaisHer/EDGEX-424-integrate-env-var-…
Browse files Browse the repository at this point in the history
…injection

feat(snap): use updated environment variable injection
  • Loading branch information
Lenny Goodell authored Apr 26, 2022
2 parents 238d080 + 5c4de0d commit b5c3ad0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
13 changes: 11 additions & 2 deletions snap/local/hooks/cmd/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ package main

import (
"fmt"
hooks "github.com/canonical/edgex-snap-hooks/v2"
local "github.com/edgexfoundry/device-rest-go/hooks"
"os"
"strings"

hooks "github.com/canonical/edgex-snap-hooks/v2"
"github.com/canonical/edgex-snap-hooks/v2/log"
"github.com/canonical/edgex-snap-hooks/v2/options"
local "github.com/edgexfoundry/device-rest-go/hooks"
)

var cli *hooks.CtlCli = hooks.NewSnapCtl()
Expand Down Expand Up @@ -97,4 +100,10 @@ func main() {
hooks.Error(fmt.Sprintf("Invalid value for 'autostart' : %s", autostart))
os.Exit(1)
}

log.SetComponentName("configure")
if err := options.ProcessAppConfig("device-rest"); err != nil {
hooks.Error(fmt.Sprintf("could not process options: %v", err))
os.Exit(1)
}
}
2 changes: 1 addition & 1 deletion snap/local/hooks/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/edgexfoundry/device-rest-go/hooks

require github.com/canonical/edgex-snap-hooks/v2 v2.1.1
require github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.5

go 1.17

4 changes: 2 additions & 2 deletions snap/local/hooks/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/canonical/edgex-snap-hooks/v2 v2.1.1 h1:qmDJ2RYd19I/NYwIdjqC/kWGVJWLcrT+h9NevB+Gz/A=
github.com/canonical/edgex-snap-hooks/v2 v2.1.1/go.mod h1:rOxrwdYL7hJDhxFH3uV+nVgLPjWOhJWgM5PRD5YG1jI=
github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.5 h1:EDFjmHy8CG4T8uFPqD+Per8Hgk250PvRsMgEDCXjYtE=
github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.5/go.mod h1:rOxrwdYL7hJDhxFH3uV+nVgLPjWOhJWgM5PRD5YG1jI=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down

0 comments on commit b5c3ad0

Please sign in to comment.