From 4927a3d767c46f4a8c0b09805dabaee36f90af42 Mon Sep 17 00:00:00 2001 From: Rohan Yadav Date: Tue, 27 Aug 2019 16:09:47 -0700 Subject: [PATCH] demo: Get a temporary license upon demo startup There is a wider discussion/design going on to serve licenses in a more general way in the future, so this commit is not aiming for a future-proof design, but instead an MVP to allow users to demo enterprise features within `cockroach demo`. We are not concerned about offline usage of enterprise features as users can obtain a license and enable features manually using SET. Fixes #40222. Release note (cli change): cockroach demo attempts to contact a license server to obtain a temporary license. cockroach demo now enables telemetry for the demo cluster. This feature can be opted out of by setting the `COCKROACH_SKIP_ENABLING_DIAGNOSTIC_REPORTING` environment variable (https://www.cockroachlabs.com/docs/stable/diagnostics-reporting.html). --- pkg/ccl/cliccl/demo.go | 1 - pkg/cli/demo.go | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/ccl/cliccl/demo.go b/pkg/ccl/cliccl/demo.go index fdf8d23df5c3..349af7c23879 100644 --- a/pkg/ccl/cliccl/demo.go +++ b/pkg/ccl/cliccl/demo.go @@ -46,7 +46,6 @@ func getLicense(clusterID uuid.UUID) (string, error) { return "", err } defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { return "", errors.New("unable to connect to licensing endpoint") } diff --git a/pkg/cli/demo.go b/pkg/cli/demo.go index c6eba639ce3e..f7363a6ec84a 100644 --- a/pkg/cli/demo.go +++ b/pkg/cli/demo.go @@ -49,9 +49,9 @@ subcommands: e.g. "cockroach demo startrek". See --help for a full list. By default, the 'movr' dataset is pre-loaded. You can also use --empty to avoid pre-loading a dataset. -cockroach demo attempts to connect to a Cockroach Labs server to obtain a -temporary enterprise license for demoing enterprise features and enable -telemetry back to Cockroach Labs. In order to disable this behavior, set the +cockroach demo attempts to connect to a Cockroach Labs server to obtain a +temporary enterprise license for demoing enterprise features and enable +telemetry back to Cockroach Labs. In order to disable this behavior, set the environment variable "COCKROACH_SKIP_ENABLING_DIAGNOSTIC_REPORTING". `, Example: ` cockroach demo`,