Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(snap): use updated environment variable injection #365

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions snap/local/hooks/cmd/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"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-mqtt-go/hooks"
)

Expand All @@ -49,6 +51,12 @@ func main() {

}

log.SetComponentName("configure")
if err := options.ProcessAppConfig("device-mqtt"); err != nil {
hooks.Error(fmt.Sprintf("could not process options: %v", err))
os.Exit(1)
}

// read env var override configuration
envJSON, err = cli.Config(hooks.EnvConfig)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion snap/local/hooks/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/edgexfoundry/device-mqtt-go/hooks

require github.com/canonical/edgex-snap-hooks/v2 v2.0.7
require github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.3

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.0.7 h1:R3a8PfMffUYJsY8uw7Rosu/KURkB55tTuO8YwETV5zY=
github.com/canonical/edgex-snap-hooks/v2 v2.0.7/go.mod h1:rOxrwdYL7hJDhxFH3uV+nVgLPjWOhJWgM5PRD5YG1jI=
github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.3 h1:kQ7tGjA7k6iAfsvLRKpdoLy0zwsG+4Wqn3DNkbJrhZ8=
github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.3/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