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): Support for snap options to set environment variables #553

Merged
merged 3 commits into from
Sep 26, 2022

Conversation

farshidtz
Copy link
Member

@farshidtz farshidtz commented Sep 19, 2022

This PR will add support for setting environment variables for the service, via snap options.

In addition:

  • The install hook has been ported from bash to go (since the added configure hook is also in Go)
  • The install mode is changed to disable which means the service no longer starts by default. This is needed to allow setting the environment variables before the service start, dropping the need for a manual restart. This change may be considered a breaking change and needs further investigation. In particular, need to test if an upgrade from an older version results in a stopped service or not.

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-ui-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

Testing Instructions

snap install edgex-ui --channel=latest/edge/pr-553
snap set edgex-ui config.edgex-security-secret-store=false
snap start edgex-ui

snap install edgexfoundry
snap set security-secret-store=off

Access http://localhost:4000

New Dependency Instructions (If applicable)

The new dependency (github.com/canonical/edgex-snap-hooks/v2) has been approved in the past and used in other Go projects:

Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
@badboy-huaqiao badboy-huaqiao marked this pull request as ready for review September 22, 2022 05:54
@MonicaisHer
Copy link
Contributor

MonicaisHer commented Sep 26, 2022

Verified backward compatibility:

$ snap install edgex-ui
$ snap refresh edgex-ui --channel=latest/edge/pr-553
$ snap services edgex-ui
Service            Startup  Current  Notes
edgex-ui.edgex-ui  enabled  active   -

$ snap set edgex-ui config.edgex-security-secret-store=false
$ snap restart edgex-ui
$ snap install edgexfoundry

Access http://localhost:4000/ successfully

Copy link
Contributor

@MonicaisHer MonicaisHer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farshidtz Thank you, looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants