From fa72d583ef96e8fd0230f0e091e954cfbca7a21a Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Wed, 11 May 2022 10:06:17 +0300 Subject: [PATCH] Don't force latest k6 when building extensions an extension will always require k6 and a version of it. It makes little sense to force newer version on users especially as we keep breaking them and we need time to go fix them, but that can only happen after release. This still lets users specify the version (as latest for example) and require the latest k6, it just isn't the default. --- environment.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/environment.go b/environment.go index c2c9cdd..6701642 100644 --- a/environment.go +++ b/environment.go @@ -118,9 +118,13 @@ func (b Builder) newEnvironment(ctx context.Context) (*environment, error) { log.Println("[INFO] Pinning versions") if b.K6Repo == "" { // building with the default main repo - err = env.execGoModRequire(ctx, k6ModulePath, env.k6Version) - if err != nil { - return nil, err + if env.k6Version != "" { + // don't actually specify k6 version if it wasn't specified + // the extension(s) will require a version that they work with either way + err = env.execGoModRequire(ctx, k6ModulePath, env.k6Version) + if err != nil { + return nil, err + } } } else { // building with a forked repo, so get the main one and replace it with