From b9f1d30fa7d880188bd80a8a2d5946480c8ffec8 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Thu, 18 Oct 2018 14:45:27 -0700 Subject: [PATCH] Remove e-mail from trial flow Signed-off-by: Daniel Hiltgen (cherry picked from commit 0ff9e5cd10718af0649c6977fb043f6849802c63) Signed-off-by: Sebastiaan van Stijn --- cli/command/engine/activate_test.go | 2 +- internal/licenseutils/client_test.go | 6 +++--- internal/licenseutils/utils.go | 2 +- internal/licenseutils/utils_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/command/engine/activate_test.go b/cli/command/engine/activate_test.go index a740d18041..9eff3b8cf0 100644 --- a/cli/command/engine/activate_test.go +++ b/cli/command/engine/activate_test.go @@ -92,7 +92,7 @@ func (c mockLicenseClient) GetHubUserByName(ctx context.Context, username string func (c mockLicenseClient) VerifyLicense(ctx context.Context, license model.IssuedLicense) (res *model.CheckResponse, err error) { return nil, fmt.Errorf("not implemented") } -func (c mockLicenseClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { +func (c mockLicenseClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { return "", fmt.Errorf("not implemented") } func (c mockLicenseClient) ListSubscriptions(ctx context.Context, authToken, dockerID string) (response []*model.Subscription, err error) { diff --git a/internal/licenseutils/client_test.go b/internal/licenseutils/client_test.go index 40bb37f2de..b0b202ebb1 100644 --- a/internal/licenseutils/client_test.go +++ b/internal/licenseutils/client_test.go @@ -13,7 +13,7 @@ type ( getHubUserOrgsFunc func(ctx context.Context, authToken string) (orgs []model.Org, err error) getHubUserByNameFunc func(ctx context.Context, username string) (user *model.User, err error) verifyLicenseFunc func(ctx context.Context, license model.IssuedLicense) (res *model.CheckResponse, err error) - generateNewTrialSubscriptionFunc func(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) + generateNewTrialSubscriptionFunc func(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) listSubscriptionsFunc func(ctx context.Context, authToken, dockerID string) (response []*model.Subscription, err error) listSubscriptionsDetailsFunc func(ctx context.Context, authToken, dockerID string) (response []*model.SubscriptionDetail, err error) downloadLicenseFromHubFunc func(ctx context.Context, authToken, subscriptionID string) (license *model.IssuedLicense, err error) @@ -52,9 +52,9 @@ func (c *fakeLicensingClient) VerifyLicense(ctx context.Context, license model.I return nil, nil } -func (c *fakeLicensingClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { +func (c *fakeLicensingClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { if c.generateNewTrialSubscriptionFunc != nil { - return c.generateNewTrialSubscriptionFunc(ctx, authToken, dockerID, email) + return c.generateNewTrialSubscriptionFunc(ctx, authToken, dockerID) } return "", nil } diff --git a/internal/licenseutils/utils.go b/internal/licenseutils/utils.go index a6809d17ed..d9503dc652 100644 --- a/internal/licenseutils/utils.go +++ b/internal/licenseutils/utils.go @@ -134,7 +134,7 @@ func (u HubUser) GetAvailableLicenses(ctx context.Context) ([]LicenseDisplay, er // GenerateTrialLicense will generate a new trial license for the specified user or org func (u HubUser) GenerateTrialLicense(ctx context.Context, targetID string) (*model.IssuedLicense, error) { - subID, err := u.Client.GenerateNewTrialSubscription(ctx, u.token, targetID, u.User.Email) + subID, err := u.Client.GenerateNewTrialSubscription(ctx, u.token, targetID) if err != nil { return nil, err } diff --git a/internal/licenseutils/utils_test.go b/internal/licenseutils/utils_test.go index 1033640de2..68b67239fe 100644 --- a/internal/licenseutils/utils_test.go +++ b/internal/licenseutils/utils_test.go @@ -147,7 +147,7 @@ func TestGenerateTrialFail(t *testing.T) { ctx := context.Background() user := HubUser{ Client: &fakeLicensingClient{ - generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { + generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { return "", fmt.Errorf("generate trial failure") }, }, @@ -161,7 +161,7 @@ func TestGenerateTrialHappy(t *testing.T) { ctx := context.Background() user := HubUser{ Client: &fakeLicensingClient{ - generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { + generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { return "subid", nil }, },