feat: support nested structs, structured arrays, and better secret value handling in config (#4727)

This commit is contained in:
Garrett Delfosse
2022-10-25 00:11:00 +00:00
committed by GitHub
parent f9c6220263
commit 585045b359
11 changed files with 728 additions and 548 deletions
+4 -4
View File
@@ -26,8 +26,8 @@ import (
func server() *cobra.Command {
vip := deployment.NewViper()
cmd := agpl.Server(vip, func(ctx context.Context, options *agplcoderd.Options) (*agplcoderd.API, io.Closer, error) {
if options.DeploymentConfig.DERPServerRelayURL.Value != "" {
_, err := url.Parse(options.DeploymentConfig.DERPServerRelayURL.Value)
if options.DeploymentConfig.DERP.Server.RelayURL.Value != "" {
_, err := url.Parse(options.DeploymentConfig.DERP.Server.RelayURL.Value)
if err != nil {
return nil, nil, xerrors.Errorf("derp-server-relay-address must be a valid HTTP URL: %w", err)
}
@@ -63,8 +63,8 @@ func server() *cobra.Command {
SCIMAPIKey: []byte(options.DeploymentConfig.SCIMAPIKey.Value),
UserWorkspaceQuota: options.DeploymentConfig.UserWorkspaceQuota.Value,
RBAC: true,
DERPServerRelayAddress: options.DeploymentConfig.DERPServerRelayURL.Value,
DERPServerRegionID: options.DeploymentConfig.DERPServerRegionID.Value,
DERPServerRelayAddress: options.DeploymentConfig.DERP.Server.RelayURL.Value,
DERPServerRegionID: options.DeploymentConfig.DERP.Server.RegionID.Value,
Options: options,
}