|
|
@@ -232,20 +232,23 @@ func (e *EnvConfigLoader) LoadConfig() (res *config.Config, err error) {
|
|
|
res.PowerDNSClient = powerdns.NewClient(sc.PowerDNSAPIServerURL, sc.PowerDNSAPIKey, sc.AppRootDomain)
|
|
|
}
|
|
|
|
|
|
- if sc.ClusterControlPlaneAddress == "" {
|
|
|
- return res, errors.New("must provide CLUSTER_CONTROL_PLANE_ADDRESS")
|
|
|
- }
|
|
|
- client := porterv1connect.NewClusterControlPlaneServiceClient(http.DefaultClient, sc.ClusterControlPlaneAddress)
|
|
|
- res.ClusterControlPlaneClient = client
|
|
|
+ res.DisableCAPIProvisioner = sc.DisableCAPIProvisioner
|
|
|
+ if sc.DisableCAPIProvisioner {
|
|
|
+ if sc.ClusterControlPlaneAddress == "" {
|
|
|
+ return res, errors.New("must provide CLUSTER_CONTROL_PLANE_ADDRESS")
|
|
|
+ }
|
|
|
+ client := porterv1connect.NewClusterControlPlaneServiceClient(http.DefaultClient, sc.ClusterControlPlaneAddress)
|
|
|
+ res.ClusterControlPlaneClient = client
|
|
|
|
|
|
- if sc.NATSUrl == "" {
|
|
|
- return res, errors.New("must provide NATS_URL")
|
|
|
- }
|
|
|
- pnats, err := nats.NewConnection(ctx, nats.Config{URL: sc.NATSUrl})
|
|
|
- if err != nil {
|
|
|
- return res, fmt.Errorf("error setting up connection to NATS cluster")
|
|
|
+ if sc.NATSUrl == "" {
|
|
|
+ return res, errors.New("must provide NATS_URL")
|
|
|
+ }
|
|
|
+ pnats, err := nats.NewConnection(ctx, nats.Config{URL: sc.NATSUrl})
|
|
|
+ if err != nil {
|
|
|
+ return res, fmt.Errorf("error setting up connection to NATS cluster")
|
|
|
+ }
|
|
|
+ res.NATS = pnats
|
|
|
}
|
|
|
- res.NATS = pnats
|
|
|
|
|
|
return res, nil
|
|
|
}
|