Skip to content

Conversation

@jnan806
Copy link
Collaborator

@jnan806 jnan806 commented Feb 13, 2023

Signed-off-by: Jiangnan Jia [email protected]

Describe what this PR does / why we need it

Add configuration support

Does this pull request fix one issue?

Fixed #18

Describe how you did it

  1. add option style API in NewControlPlane for other control-plane to integrate
  2. Add Priority of loading config: NewControlPlane Options > SystemEnv > YamlFile > Default
    by this Priority order makes the unique value, when config-items were provided by several way,
  3. If start OpenSergo directly, can also provide config-items by command args, which will adapt to NewControlPlane Options.

Describe how to verify it

  1. exec ./main -h to get command args helps
  2. add different values in command args, SystemEnv, yaml file
# command args : -p means give a port -c means the path of config
./main -p 8080 -c /opensergo.yaml
# SystemEnv: /etc/profile
OPENSERGO_ENDPOINT_PORT=8081
# /opensergo.yaml    filePath which was given by command above
endpointPort: 8082

Special notes for reviews

@jnan806 jnan806 force-pushed the feature/support_config branch from a6818a4 to 68080f5 Compare February 14, 2023 01:58
Signed-off-by: Jiangnan Jia <[email protected]>
@jnan806 jnan806 force-pushed the feature/support_config branch from 68080f5 to b171373 Compare February 14, 2023 02:16
@sczyh30
Copy link
Member

sczyh30 commented Feb 15, 2023

cc @123liuziming @panxiaojun233

@sczyh30 sczyh30 added kind/feature Category issues or PRs related to feature request. area/configuration Issue related to configurations of the control plane labels Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/configuration Issue related to configurations of the control plane kind/feature Category issues or PRs related to feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configuration for OpenSergo control plane

2 participants