feat(config): ✨ Add EdgeConnectURL configuration parameter
Some checks failed
Go Tests / go-tests (push) Failing after 2m47s
Some checks failed
Go Tests / go-tests (push) Failing after 2m47s
Makes the EdgeConnect URL configurable through the config.toml file instead of hardcoding it in the provider code. This change: - Adds new EdgeConnectURL field to Config struct - Implements validation to ensure URL is provided - Updates example config.toml with default URL - Modifies provider to use configured URL value This improves deployment flexibility by allowing different edge connect endpoints without code changes.
This commit is contained in:
parent
d1105d1776
commit
8c9f2b37d8
3 changed files with 7 additions and 1 deletions
|
|
@ -48,6 +48,7 @@ type Config struct {
|
|||
Organization string `toml:"organization"`
|
||||
CloudletKey CloudletKey `toml:"cloudlet"`
|
||||
Region string `toml:"region"`
|
||||
EdgeConnectURL string `toml:"edge_connect_url"`
|
||||
}
|
||||
|
||||
type Credentials struct {
|
||||
|
|
@ -65,5 +66,9 @@ func (c *Config) Validate() error {
|
|||
return fmt.Errorf("log_file is not defined in provider config")
|
||||
}
|
||||
|
||||
if c.EdgeConnectURL == "" {
|
||||
return fmt.Errorf("edge_connect_url is not defined in provider config")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
edge_connect_url = "https://hub.apps.orca.platform.mg3.mdb.osc.live"
|
||||
organization = "edp-developer-framework"
|
||||
region = "EU"
|
||||
log_file = "./lala.log"
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ func NewEdgeConnectProvider(configPath, controllerID string) (execution.External
|
|||
}
|
||||
|
||||
client := edgeconnect.NewClientWithCredentials(
|
||||
"https://hub.apps.edge.platform.mg3.mdb.osc.live",
|
||||
conf.EdgeConnectURL,
|
||||
creds.Username,
|
||||
creds.Password,
|
||||
edgeconnect.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue