Skip to content

Commit

Permalink
Forced to use default browser version in case empty browser version r…
Browse files Browse the repository at this point in the history
…ecieved
  • Loading branch information
alcounit committed Nov 9, 2020
1 parent df0095e commit dc2dc26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions platform/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
10 changes: 6 additions & 4 deletions platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc2dc26

Please sign in to comment.