From 42213fe4b73b4ba55c624cabfcfab74fce211efe Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Thu, 20 Aug 2020 16:57:22 -0700 Subject: [PATCH 1/2] Update API configuration schema error message --- pkg/operator/resources/resources.go | 2 +- pkg/types/spec/validations.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/operator/resources/resources.go b/pkg/operator/resources/resources.go index e63d056d5f..be347a5863 100644 --- a/pkg/operator/resources/resources.go +++ b/pkg/operator/resources/resources.go @@ -93,7 +93,7 @@ func Deploy(projectBytes []byte, configFileName string, configBytes []byte, forc err = ValidateClusterAPIs(apiConfigs, projectFiles) if err != nil { - err = errors.Append(err, fmt.Sprintf("\n\napi configuration schema for:\n\nRealtime API can be found at https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\nBatch API can be found at https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\nTraffic Splitter can be found at https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) + err = errors.Append(err, fmt.Sprintf("\n\napi configuration schema can be found here:\n → Realtime API: https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\n → Batch API: https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\n → Traffic Splitter: https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) return nil, err } diff --git a/pkg/types/spec/validations.go b/pkg/types/spec/validations.go index c4dcc877a7..8eecbf6f29 100644 --- a/pkg/types/spec/validations.go +++ b/pkg/types/spec/validations.go @@ -597,7 +597,7 @@ func ExtractAPIConfigs(configBytes []byte, provider types.ProviderType, configFi case types.LocalProviderType: return nil, errors.Append(err, fmt.Sprintf("\n\napi configuration schema for Realtime API can be found at https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration", consts.CortexVersionMinor)) case types.AWSProviderType: - return nil, errors.Append(err, fmt.Sprintf("\n\napi configuration schema for:\n\nRealtime API can be found at https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\nBatch API can be found at https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\nTraffic Splitter can be found at https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) + return nil, errors.Append(err, fmt.Sprintf("\n\napi configuration schema can be found here:\n → Realtime API: https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\n → Batch API: https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\n → Traffic Splitter: https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) } } From bb9c9edd32034b985c220a81591655f5d77002ff Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 21 Aug 2020 11:30:48 -0700 Subject: [PATCH 2/2] Update formatting --- pkg/operator/resources/resources.go | 2 +- pkg/types/spec/validations.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/operator/resources/resources.go b/pkg/operator/resources/resources.go index be347a5863..d28a5150c5 100644 --- a/pkg/operator/resources/resources.go +++ b/pkg/operator/resources/resources.go @@ -93,7 +93,7 @@ func Deploy(projectBytes []byte, configFileName string, configBytes []byte, forc err = ValidateClusterAPIs(apiConfigs, projectFiles) if err != nil { - err = errors.Append(err, fmt.Sprintf("\n\napi configuration schema can be found here:\n → Realtime API: https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\n → Batch API: https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\n → Traffic Splitter: https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) + err = errors.Append(err, fmt.Sprintf("\n\napi configuration schema can be found here:\n → Realtime API: https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\n → Batch API: https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\n → Traffic Splitter: https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) return nil, err } diff --git a/pkg/types/spec/validations.go b/pkg/types/spec/validations.go index 8eecbf6f29..526cfd1d66 100644 --- a/pkg/types/spec/validations.go +++ b/pkg/types/spec/validations.go @@ -597,7 +597,7 @@ func ExtractAPIConfigs(configBytes []byte, provider types.ProviderType, configFi case types.LocalProviderType: return nil, errors.Append(err, fmt.Sprintf("\n\napi configuration schema for Realtime API can be found at https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration", consts.CortexVersionMinor)) case types.AWSProviderType: - return nil, errors.Append(err, fmt.Sprintf("\n\napi configuration schema can be found here:\n → Realtime API: https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\n → Batch API: https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\n → Traffic Splitter: https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) + return nil, errors.Append(err, fmt.Sprintf("\n\napi configuration schema can be found here:\n → Realtime API: https://docs.cortex.dev/v/%s/deployments/realtime-api/api-configuration\n → Batch API: https://docs.cortex.dev/v/%s/deployments/batch-api/api-configuration\n → Traffic Splitter: https://docs.cortex.dev/v/%s/deployments/realtime-api/traffic-splitter", consts.CortexVersionMinor, consts.CortexVersionMinor, consts.CortexVersionMinor)) } }