From dc2dc2647c7ab88514fc0d2f30b5d909b20c3182 Mon Sep 17 00:00:00 2001 From: Danylo Kuvshynov Date: Mon, 9 Nov 2020 18:50:57 +0200 Subject: [PATCH] Forced to use default browser version in case empty browser version recieved --- config/config.go | 5 ++++- platform/kubernetes.go | 4 ++-- platform/platform.go | 10 ++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index 64a288f..4218875 100644 --- a/config/config.go +++ b/config/config.go @@ -72,11 +72,14 @@ func (cfg *BrowsersConfig) Find(name, version string) (*platform.BrowserSpec, er if !ok { return nil, fmt.Errorf("unknown browser version %s", version) } + v.BrowserName = name + v.BrowserVersion = c.DefaultVersion return v, nil } return nil, fmt.Errorf("unknown browser version %s", version) } - + v.BrowserName = name + v.BrowserVersion = version return v, nil } diff --git a/platform/kubernetes.go b/platform/kubernetes.go index 11d962d..a5491f9 100644 --- a/platform/kubernetes.go +++ b/platform/kubernetes.go @@ -110,8 +110,8 @@ func (cl *Client) Create(layout *ServiceSpec) (*Service, error) { labels := map[string]string{ defaults.serviceType: "browser", - defaults.browserName: layout.RequestedCapabilities.BrowserName, - defaults.browserVersion: layout.RequestedCapabilities.BrowserVersion, + defaults.browserName: layout.Template.BrowserName, + defaults.browserVersion: layout.Template.BrowserVersion, defaults.testName: layout.RequestedCapabilities.TestName, defaults.session: layout.SessionID, } diff --git a/platform/platform.go b/platform/platform.go index 834ae8c..acd07ec 100644 --- a/platform/platform.go +++ b/platform/platform.go @@ -27,10 +27,12 @@ type Spec struct { //BrowserSpec describes settings for Service type BrowserSpec struct { - Image string `yaml:"image" json:"image"` - Path string `yaml:"path" json:"path"` - Meta Meta `yaml:"meta" json:"meta"` - Spec Spec `yaml:"spec" json:"spec"` + BrowserName string `yaml:"-" json:"-"` + BrowserVersion string `yaml:"-" json:"-"` + Image string `yaml:"image" json:"image"` + Path string `yaml:"path" json:"path"` + Meta Meta `yaml:"meta" json:"meta"` + Spec Spec `yaml:"spec" json:"spec"` } //ServiceSpec describes data requred for creating service