edgexfoundry / device-sdk-c

Owner: Device WG
Apache License 2.0
42 stars 42 forks source link

feat: Add command line/environment flag for commonConfig #486

Closed FelixTing closed 1 year ago

FelixTing commented 1 year ago

fix: #485

Hold until https://github.com/edgexfoundry/device-sdk-c/pull/484 is merged

PR Checklist

Please check if your PR fulfills the following requirements:

Testing Instructions

Non-secure mode testing

  1. From the latest compose builder run make run no-secty.
  2. Set the environment variable for non-secure testing export EDGEX_SECURITY_SECRET_STORE=false
  3. Run device-random example (/src/c/examples/random) with -cc=../commonconfiguration.yaml argument.
  4. The device-random service should bootstrap successfully without having the following error
    level=ERROR ts=2023-10-06T04:34:11Z app=device-random msg="Unable to load common config file: Unable to open configuration file"
    Error: 1: Unable to open configuration file
  5. The configuration can also be verified through the REST API: http://localhost:59999/api/v3/config

Secure mode testing

  1. From the latest compose builder, modify add-security.yml to add secret store token and registry ACL role for device-random, and then run make run.
  2. Set the environment variable for secure testing export EDGEX_SECURITY_SECRET_STORE=true
  3. Run device-random example (/src/c/examples/random) with -cc=../commonconfiguration.yaml argument.
  4. The device-random service should bootstrap successfully without the following error
    level=ERROR ts=2023-10-06T04:34:11Z app=device-random msg="Unable to load common config file: Unable to open configuration file"
    Error: 1: Unable to open configuration file

New Dependency Instructions (If applicable)

FelixTing commented 1 year ago

Hi @lenny-intel, this PR cannot be merged due to the change request. Could you please approve this PR if you are happy with the changes?