diff --git a/snap/local/hooks/cmd/configure/configure.go b/snap/local/hooks/cmd/configure/configure.go index aad4338a..01f59212 100644 --- a/snap/local/hooks/cmd/configure/configure.go +++ b/snap/local/hooks/cmd/configure/configure.go @@ -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() @@ -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) + } } diff --git a/snap/local/hooks/go.mod b/snap/local/hooks/go.mod index ab928d03..bb43b01c 100644 --- a/snap/local/hooks/go.mod +++ b/snap/local/hooks/go.mod @@ -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 diff --git a/snap/local/hooks/go.sum b/snap/local/hooks/go.sum index 0561495c..207bcb21 100644 --- a/snap/local/hooks/go.sum +++ b/snap/local/hooks/go.sum @@ -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=